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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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
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)