Hi
I have a problem related to export to excel.
In my application,I have two columns with leading zeros, say column “A” and "B". as a csv file.
When i convert this to excel using aspose, the leading zeros
are visible in the both columns, but not really in the value field, see the
formula field(the zeros are terminated) for the column A.(Where as B is treated as text)
My values are in text data type in the csv file and I would like this to be text in excel as well. (Just like what is shown in “B” column)
What can be done to manage this?
code snippet:
TxtLoadOptions opts = new TxtLoadOptions(LoadFormat.CSV);
opts.setSeparator(’,’);
opts.setEncoding(Encoding.getDefault());
opts.setConvertDateTimeData(true);
Workbook newWB = new Workbook(newFile.getAbsolutePath(), opts);
Worksheet newSheet = newWB.getWorksheets().get(0);
Cells tmpCells = newSheet.getCells();
int nextCount = count+tmpCells.getMaxDataRow()+1;
if(nextCount > sheetRowLimit)
{
Worksheet ws = resultWss.get(resultWss.add());
resultCells = ws.getCells();
nextCount -= count;
count = 0;
}
resultCells.copyRows(tmpCells, 0, count, nextCount-count);
count = nextCount;
sheetCounter++;
remainingRows = totalRows - sheetCounter*sheetRowLimit;
Kind regards
Praba