JN

Hi guys ,

I am facing error when 

var output = Context.createOutputObject(Constants.OutputXLSX,"Test_XLSX.xlsx")

09.output.BeginTable(100,Constants.C_BLACK,Constants.C_WHITE,Constants.FMT_LEFT | Constants.FMT_ITALIC,0);
10.
11.output.TableRow();
12.output.TableCell("iyerauth", 50, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
13 .output.TableCell("iyerauth", 50, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_RED, 0, Constants.FMT_LEFT, 0)
14.output.WriteReport()

Error:

Error running script:

Script:test_xlsx,line14

wrapped java.lang.NullPointerException(test_xlsx#14)

I want to have a background color for that particular cell. The error is thrown only if I give a color value (Constants.C_BLUE,Constants.C_RED,etc.), if I give C_TRANSPARENT no error is thrown.

I also tried for creating a style sheet using

output.createCellStyle() 

 function but when I do that I get error .."couldn't find function createCellStyle in output object"...

Can any one how to create a style sheet for the XLSX ouput 

Output Object = com.idsscheer.report.output.outputobject.excel.AExcelGenerator@e13ae5	

Thanks in advance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

 

by Martin Miskovic
Posted on Tue, 03/24/2015 - 09:09

Hi,

I tested your code and it provides result as expected if you choose .xls instead of .xlsx output file.

Also get rid of the <html> tags.

Not sure why this is the problem though.

var output = Context.createOutputObject(Constants.OutputXLS,"Test_XLSX.xls")

The .xlsx worked fine either, but he recognized only black or white colors (both font & background).

Martin

0
by JeyaKarthik N R Author
Posted on Tue, 03/24/2015 - 10:11

In reply to by martin.miskovic

Hi Martin,

Thanks for ur reply.!! I know that .xls file works good. But I want to have .xlsx file with background color for certain cells.

Is there any way to do this ?

 

0
by Martin Miskovic
Posted on Fri, 03/27/2015 - 09:33

I am sorry, but all my tests end up being success with .xls, but failure with .xlsx.

Why do you insist on using .xlsx file?

Martin

0
by JeyaKarthik N R Author
Posted on Mon, 03/30/2015 - 09:26

In reply to by martin.miskovic

Thanks again!!

I have more than 65000 rows to be included in a report. Thats why I want to have xlsx file as output.

I figured out the problem. The Problem is when I am defining the cell Style with different patterns it is throwing error assuming XLSX output doesn't recognize fill Pattern in cell style declaration.

And finally I got the xlsx file with colored cells by 

defining cell style with Constants.NO_FILL then added cell_style.setFillPattern(Constants.SOLID_FOREGROUND)

 

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock