Generate ods file

Hi team,


Previously we were generating .xlsx files using the below code.

(opt is the SaveOptions which i’m getting from jsp.)

((OoxmlSaveOptions)opt).setLightCellsDataProvider(new EISRSCLightCellsDataClob(processID,rowCount,noOfCols,noOfClobs,format,1,bufferIndex,dataClob, columnTypeVec));



I used the similar code to generate .ods file with the below changes
(File got generated, but there was no data)
((OdsSaveOptions)opt).setLightCellsDataProvider(new EISRSCLightCellsDataClob(processID,rowCount,noOfCols,noOfClobs,format,1,bufferIndex,dataClob, columnTypeVec));

but i got an error…
method setLightCellsDataProvider(xx.reporting.server.EISRSCLightCellsDataClob) not found in class com.aspose.cells.OdsSaveOptions


Can you please suggest any solution.

Thanks,
Sukesh

Hi Sukesh,

Thank you for using Aspose products.

The mentioned problem could be due to some bug in current version of the API, therefore we would request you to please give a try to the latest build of Aspose.Cells for Java 7.7.2.4 on your end to see if it makes any difference. In case the problem persists, we will require a standalone executable sample application (most preferably console app) along with template file (if any) to reproduce the problem on our end.

Please keep us posted with your test results.

Hi,

Thanks for using Aspose.Cells.

Currently we only support LightCells APIs for Excel97-2003 and XLSX file
formats. So you cannot save ODS files in lightcells mode.

Hi Shakeel,


Is there any alternate method which i can use?

Hi,


Well, I am afraid, as there is no support to generate ODS file in LightCells mode, so you have to use normal Aspose.Cells for Java APIs to create ODS file formats without involving LightCells APIs (with its interface(s)) etc.
e.g
Sample code:
workbook.save(stringFilePath, SaveFormat.ODS);



Thank you.


To generate an ODS (Open Document Spreadsheet) file, you can use various methods depending on your programming language or the software you’re working with. Here are a few examples:

Using Microsoft Excel sheet:

  1. Open Microsoft Excel.
  2. Create or import the data you want to include in the ODS file.
  3. Click on “File” and then select “Save As” or “Save a Copy.”
  4. In the “Save As” dialog box, choose the ODS file format from the available options.
  5. Provide a name for the file and choose the desired location to save it.
  6. Click “Save” to generate the ODS file.

Using LibreOffice Calc:

  1. Open LibreOffice Calc.
  2. Enter or import the data you want to include in the ODS file.
  3. Click on “File” and then select “Save As.”
  4. In the “Save As” dialog box, choose the ODS file format from the available options.
  5. Specify a name for the file and select the desired location to save it.
  6. Click “Save” to generate the ODS file.

Using Python with the pandas library: If you want to generate an ODS file programmatically using Python, you can use the pandas library. Here’s an example:

pythonCopy code

import pandas as pd

data = {'Column1': [1, 2, 3], 'Column2': ['A', 'B', 'C']}
df = pd.DataFrame(data)

output_file = 'output.ods'
df.to_ods(output_file, sheet_name='Sheet1')

In the above example, the pandas library is used to create a DataFrame object with some sample data. Then, the to_ods method is used to save the DataFrame as an ODS file with the specified name (output.ods) and sheet name (Sheet1).

These are just a few examples of how you can generate ODS files. The specific method you choose will depend on your requirements and the tools or programming languages you’re using.

@onridiko
Aspose.Cells supports reading and wring ODS, but we do not support generating ODS file in LightCells mode,