hi
Hi,
Thanks for your posting and using Aspose.Cells for Java.
Thanks
for highlighting the issue. We have now logged your issue in our
database. We will look into your issue and fix it. Once the issue is
fixed or we have some other update for you, we will let you know asap.
This issue has been logged as CELLSJAVA-40432.
Hi,
Thanks for your posting and using Aspose.Cells for Java.
We have fixed this issue.
Please download and try this fix: Aspose.Cells for Java v7.4.0.3 and let us know your feedback.
options . The picture is in appendix.
hi thanks for the fix.
i got that problem fixed but in another template i am not getting what i am expected
i highlighted the portion which is causing the issue.
i modified the flag “save source data with file” to true in pivot table’s
options .
please look into this and provide me the suggestion to solve this issue.
thanks
Hi,
hi
i am attaching sample code
Workbook workbook = new Workbook(excelFileName);
workbook.calculateFormula(true);
int sheetCount = workbook.getWorksheets().getCount();
for (int i = 1; i < sheetCount; i++) {
Worksheet ws = workbook.getWorksheets().get(i);
ws.autoFitRows();
ws.getPageSetup().setFitToPagesWide(10);
ws.getPageSetup().setFitToPagesTall(1);
ws.getPageSetup().setPaperSize(40);
ws.getPageSetup().setOrientation(1);
ws.getPageSetup().setZoom(20);
ws.setGridlinesVisible(true);
System.out.println(ws.getCells().getMaxDataColumn());
ArrayList colsFromExcel1 = new ArrayList();
if(excelFileName.contains(“Extract”)){
Row row1 = ws.getCells()
.getRow(0);
Iterator im1 = row1.iterator();
while (im1.hasNext()) {
Cell cell = (Cell) im1.next();
colsFromExcel1.add(cell.getStringValue());
}
System.out.println(“cols size after formatting:”
+ colsFromExcel1.size());
}
for(int k =0;k<ws.getPivotTables().getCount();k++){
System.out.println(“in start…1111… 2222222222222222222222222”);
// ws.getPivotTables().get(k).setRefreshDataOnOpeningFile(true);
ws.getPivotTables().get(k).setRefreshDataFlag(true);
if(excelFileName.contains(“Extract”)){
}else{
ws.getPivotTables().get(k).refreshData();
}
ws.getPivotTables().get(k).calculateData();
ws.getPivotTables().get(k).setRefreshDataFlag(false);
}
if(excelFileName.contains(“Extract”)){
for (int v = 0; v < colsFromExcel1.size(); v++) {
ws.autoFitColumn(v);
ws.autoFitRows();
//if(v==0) continue;
if(ws.getCells().getRows().getRowByIndex(1).get(v).getDisplayStringValue()!=""){
System.out.println(ws.getCells()
.getRows().getRowByIndex(1).getCellByIndex(v)
.getType());
// Style style = null;
StyleFlag flagin = null;
flagin = new StyleFlag();
Style style = workbook.getWorksheets().get(i)
.getCells().getRows().getRowByIndex(1)
.getStyle();
style.setCustom("@");
flagin.setNumberFormat(true);
// sheet.Cells.ApplyColumnStyle(dateCol.Column,
// style, flag);
ws.getCells()
.getColumns().getColumnByIndex(v)
.applyStyle(style, flagin);
}
}
}
}
//save the workbook as pdf report. Save pdf with same name
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
workbook.save(getPdfFileName(excelFileName), pdfSaveOptions);
} catch (Exception ex) {
ex.printStackTrace();
// log.error("Failed to generate PDF report " + excelFileName, ex);
return false;
}
Hi,
hi
my excel file has pivoted options and it will generate data taking source as another sheet so when i convert that excel file as pdf i am not getting all the data in the pdf so i used the below code to refresh the pivoted sheets of each worksheet then i got all the data
for(int k =0;k<ws.getPivotTables().getCount();k++){
System.out.println(“in start…1111… 2222222222222222222222222”);
ws.getPivotTables().get(k).setRefreshDataOnOpeningFile(true);
ws.getPivotTables().get(k).setRefreshDataFlag(true);
if(excelFileName.contains(“Extract”)){
}else{
ws.getPivotTables().get(k).refreshData();
}
ws.getPivotTables().get(k).calculateData();
ws.getPivotTables().get(k).setRefreshDataFlag(false);
}
if i comment above code i am able to see my problem mentioned above is fixed but the data is not completely displayed in the pdf. (see pdf1)
but if try to use the above version of aspose cells i am not getting the problem which i mentioned above is not fixing (see pdf2)
i want both of the things to get worked. can you please provide me the solution for above problem.
thanks
Hi,
Thanks Amjad.
waiting …fingers crossed…
hi amjad
any update on the above issue?
Hi,
Thanks for your posting and using Aspose.Cells.
Please spare us some time. Our developers are on Spring Holidays, they will get back on next week.
Once, we will have some update for you, we will let you know asap.
Hi Shakeel
This is a high priority issue for us in our environment. So can you please provide the fix quickly so that we can apply it and test that.
thanks
Hi,
Thanks for your posting and using Aspose.Cells.
We have logged your comments against this issue. Hopefully, your issue will be fixed soon. Once, we will have some update for you, we will let you know asap.
Hi,
We are sorry that we could not support refreshing pivot table’s data without refreshing it’s source.
If you want both of the things to get worked, we recommend that you could set flag “refresh data when opening the file” to true in MS Excel first.
Then you could saving to pdf correctly without refreshing pivot table’s source.
You could see the picture and the result pdf in the appendix.
The issues you have found earlier (filed as CELLSJAVA-40432) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.