Hi Team ,
Hi Karan,
Thanks for your posting and using Aspose.Cells for Java.
Please download and use the latest version: Aspose.Cells for Java 7.7.2 and see if it makes any difference.
Some xls/xlsx files do not open well in Open Office Calc because these application are not meant to work with these files primarily. In such cases, it is not the bug of Aspose.Cells but limitation of these applications.
If your problem persists, then please provide us your source xls/xlsx files and sample code replicating this issue with the latest version.
We will look into your issue and help you asap.
Hi Team ,
Hi Karan,
Thanks for your posting and using Aspose.Cells for Java.
Could you comment your license related code and then check how the latest version works at your end? If it is not working fine, then please provide us your sample code replicating this issue for our investigation. Also provide us any source files which you are using in your code.
Please also provide us your output xls/xlsx file which is showing fine in MS-Excel but not showing up in Libra Office / Open Office.
Kindly send us your license using the steps mentioned in this article.
We will look into it why your license is not working and fix this issue in the latest version.
Hi Shakeel ,
Workbook writeWorkbook = new Workbook();
SaveOptions opt = new OoxmlSaveOptions();
if(format.indexOf(“2003”)!=-1)
{
isAsposeSupport=asposeUtil.isAsposeSuport(processID);
opt = new XlsSaveOptions();
}
if(“Y”.equalsIgnoreCase(showLog)){
out.println(“FORMAT “+format+”
”);
out.println(“FLAG “+flag+”
”);
out.println(“ASPOSE SUPPORT “+isAsposeSupport+”
”);
}
OutputStream outExcel = response.getOutputStream();
if((“1”.equals(flag)||“2”.equals(flag)) && isAsposeSupport)
{
try{
if(!isNull(processID) && !isNull(user_id) && !isNull(format))
{
String maxClobProfile = asposeUtil.getProfile(“XXEIS_RSC_GENERATE_EXCEL”,null);
fileName=reportName+""+user_id+""+processID+"_"+flag;
if(format.indexOf(“2003”)!=-1)
{
fileName+=".xls";
response.setContentType(“application/vnd.ms-excel; charset=UTF-8”);
opt.setSaveFormat(FileFormatType.EXCEL_97_TO_2003);
}
else
{
fileName+=".xlsx";
response.setContentType(“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8”);
opt.setSaveFormat(FileFormatType.XLSX);
}
EISRSCCommonUtil.writeLog(“OUTPUT_FILES”,“EISRSCGenerateJAVAExcel : Excel : Output File Name -> “+fileName,isLogEnabled,processID);
response.setHeader(“content-disposition”, “inline; filename=”” +fileName+ “””);
if(maxClobProfile==null || maxClobProfile.trim().length()==0 || “-999”.equalsIgnoreCase(maxClobProfile) || format.indexOf(“2003”)!=-1 || isReportSet)
{
// Modified by Sukesh for MLS, passing mlsLoginLangCode
gcsv.genearateClob(processID,writeWorkbook,user_id,format,flag,logPath,opt, mlsLoginLangCode);
writeWorkbook.save(outExcel,opt);
outExcel.close();
}
Hi Karan,
Thanks for your posting and using Aspose.Cells.
Could you please try again? I have checked it by sending the file to myself and it works fine. Please see the screenshot how to send an email to me.
Please also provide us some more simplified and runnable sample code to investigate this issue.
Screenshot:
Hi Shakeel ,
Hi Karan,
Thanks for using Aspose.Cells.
I could not test your license issue, because the string you provided is actually fragments of license and not a complete license file. You need to set the license as it is without any modification to make it work perfectly.
Also, I tested your code after doing some modifications and did not find any issue. The output xlsx file opens fine in OpenOffice without any issue. I have attached the output xlsx file for your reference.
The code you provided does not actually do anything other than creating the workbook and sending it to stream.
Java
Workbook writeWorkbook = new Workbook();
SaveOptions opt = new OoxmlSaveOptions(SaveFormat.XLSX);
OutputStream outExcel = response.getOutputStream();
Worksheet worksheet = writeWorkbook.getWorksheets().get(0);
Cell cell = worksheet.getCells().get(“A1”);
cell.putValue(“Hello World!”);
response.setContentType(“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8”);
response.setHeader(“content-disposition”, “attachment;filename=output.xlsx”);
try
{
writeWorkbook.save(outExcel, opt);
}catch(Exception e)
{
//writeError(e, response);
return;
}
Screenshot:
Hi Team,
Hi Karan,
Thanks for using Aspose.Cells.
We have converted your Sample_Output_XLSX.xlsx into ods using the older and newer version and data is not lost. I have attached the output ods file for your reference.
Kindly use the latest version: Aspose.Cells for Java 7.7.2 and comment your license related code. Because we do not fix bugs in older versions. You will have to use latest version first. If issue still occurs with the latest version, then please provide us your sample code replicating the issue. We will look into it and fix this issue