Hello, I would like to inform you that I have an error of when a template create from OpenOffice after the application “Aspose.Cells” the document generate contains formulas errors or we can not open it. There is no property to apply on the document to avoid this problem? How can I solve this problem? Thank you for your help
Hi,
hi,
Thanks you for your fast response , this version has compatible with Java 7 ?
thanks you for your help
Hi,
hello,
HOW CAN I Detect an OpenOffice Document?
Aspose supports documents created or modified by OpenOffice ???
thanks you
Hi,
String filePath = dirPath + “sampleOpenOffice.ods”;
//Detect its file format type, it is generic code, you can try XLSX, XLS, CSV, XLSB files as well
FileFormatInfo finfo = FileFormatUtil.detectFileFormat(filePath);
//Once, you detected the fileformat, then create LoadOptions
LoadOptions opts = new LoadOptions(finfo.getLoadFormat());
//Load your file with correct format
Workbook wb = new Workbook(filePath, opts);
//Access first worksheet and put some value in cell B4
Worksheet ws = wb.getWorksheets().get(0);
Cell cell = ws.getCells().get(“B4”);
cell.putValue(“Hello Dev_J.”);
//Set it with yellow fill color and red font color
Style st = cell.getStyle();
st.setPattern(BackgroundType.SOLID);
st.setForegroundColor(Color.getYellow());
st.getFont().setColor(Color.getRed());
cell.setStyle(st);
// ws.AutoFitColumn(cell.Column);
//Save the workbook in ODS format
wb.save(filePath + “-out.ods”, SaveFormat.ODS);
String filePath = dirPath + “sampleOpenOffice.ods”;
//Detect its file format type, it is generic code, you can try XLSX, XLS, CSV, XLSB files as well
FileFormatInfo finfo = FileFormatUtil.DetectFileFormat(filePath);
//Once, you detected the fileformat, then create LoadOptions
LoadOptions opts = new LoadOptions(finfo.LoadFormat);
//Load your file with correct format
Workbook wb = new Workbook(filePath, opts);
//Access first worksheet and put some value in cell B4
Worksheet ws = wb.Worksheets[0];
Cell cell = ws.Cells[“B4”];
cell.PutValue(“Hello Dev_J.”);
//Set it with yellow fill color and red font color
Style st = cell.GetStyle();
st.Pattern = BackgroundType.Solid;
st.ForegroundColor = Color.Yellow;
st.Font.Color = Color.Red;
cell.SetStyle(st);
// ws.AutoFitColumn(cell.Column);
//Save the workbook in ODS format
wb.Save(filePath + “-out.ods”, SaveFormat.ODS);