We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Format issue with lightcellDataProvider

hi

how to apply the column wise format with lightcelldataprovider.
i am using this one.
it takes more time.
Style[] arrStyle = new Style[noOfCols];
for(int i=0; i<noOfCols; i++)
arrStyle[i] = (Style)styleHashTable.get(String.valueOf(i));
arrStyleIndex = CellsHelper.gatherStyles(writeWorkbook, arrStyle);


public void startCell(Cell cell)
{
try{
if(colIndex<cellValue.length)
{
cell.setValue(cellValue[colIndex],true);
cell.setStyle(arrStyleIndex[colIndex%arrStyleIndex.length]);
}
}
catch(Exception e)
{
e.printStackTrace();
}
}


Thanks & Regards
Ranjith.


Hi,
To apply column wise format with LightCells, it is same with the common way you set column styles. That is, you can just get corresponding Column and then set Style to it before Workbook.save() call. The code is simple as following:
Style style...
...
Column col = cells.getColumn(index);
col.setStyle(style);
...
workbook.getSaveOptions().setLightCellsDataProvider(...);
workbook.save(...);

hi

we are trying to creating the excel using LightCellDataProvider.

autofit column is not working in this case.


could you please give some solution.

Thanks & regards
Ranjith.

Hi Ranjith,


I have replied to your other post with latest fix for Aspose.Cells JAVA v.2.5.3.8 as attachment. Please test this issue with latest JAR and let us know of your feedback.

Thank you

hi

we are still facing the issue.

Thanks & regards.

ranjith.

Hi,

We have escalated your issue to our development team. Once we will get any update, we will let you know.

This issue has been logged as CELLSJAVA-27957.

Hi,

Because you are saving the workbook by LightCellsDataProvider, you should know that there is no cell data when you call autofit methods. So the column width cannot be determined.

In light mode, we are afraid you have to look for other solutions to determine the proper column width and set it to corresponding Column object before saving the file.