File generationg using lightcell dataprovider

hi

is there any way to generate two xlsx files using light cell data provider at same time.

means

i am using light cell data provider.

we are planning to save excel and excel with pivot using light cell data provider.

using this code.

opt.setLightCellsDataProvider(new LightCellsData(writeWorkbook,processID,rowCount,noOfCols,noOfClobs,logPath));

writeWorkbook.save(“C:\”+excelfileName+"_1.xlsx",FileFormatType.XLSX);

//code to generate pivot table

addPivotTable2Sheet(writeWorkbook,format);

writeWorkbook.save(“C:\”+excelfileName+"_2.xlsx",FileFormatType.XLSX);


the files are generated but
the second file contains no data in data sheet.

please find the attached files.

Thanks & Regards

Ranjith.


Hi,

If you want to re-use the LightCellsDataHandler, you need to reset the handler’s status so that nextSheet()/nextRow()/nextCell() can give valid data when re-used by next save process. After the first save process, the set handler’s status must be at the end of dataset. That’s why the second saved file has no data.

hi

Thanks for your response.

could you give one simple example.

if we use two lightcelldataprovider. then working fine.

but the entire excel generation will be started.this not required us.

for example: we are generating excel having 10,00,000 rows and 37 columns.

it takes some 20 min.

i want to generate both excel and pivot excel for this one . if i use the above process it takes more than 40 min.

means we doing generation again for pivot.


generating pivot is just adding a sheet to the excel file.

is there any way to re use light cell data provider data set.

Thanks & Regards

Ranjith.




Hi,

We are afraid it is impossible to get your desired result.

As you know, when saving workbook with LightCellsDataProvider, cells data is saved to file directly instead of building the complete data model in memory. If you re-save the workbook again, there is no cells data in the workbook object and you have to provide the cells data set again to the save process.

It is the choice of saving memory(use lightcellsdataprovide) or saving time(build complete data model, that is, fill all cells data into the workbook object in memory). We are afraid there is no better way to get the both at same time.