Hi,
I am not completely sure about Xls Gen code segments but, yes, you can create the style object once and set its attributes or options accordingly then you only have to specify the style to your desired cells. e.g
you may add lines to set style for your desired cells, i.e. (although i am not an expert in cold fusion, so you may modify/fix it accordingly)
........................
<cfset cell = cells.get(10,17)>
<cfset cell.putValue("Val1")>
<cfset cell.setStyle(style1)>
<cfset cell = cells.get(11,18)>
<cfset cell.putValue("Val2")>
<cfset cell.setStyle(style1)>
<cfset cell = cells.get(12,19)>
<cfset cell.putValue("Val3")>
<cfset cell.setStyle(style1)>
..................
Also, Aspose.Cells for Java does provide other ways to create style object e.g
C# code:
Workbook workbook = new Workbook();
//...............
Style style = workbook.createStyle();
also other way:
int styleIndex = workbook.getStyles().add();
Style style = workbook.getStyles().get(styleIndex);
Hope this helps.
Thank you.
Amjad Sahi
Support Developer,
Aspose Sialkot Team
Contact Us