PDF printing

The attached zip shows the workbook and the resulting pdf file. Note that on the map sheet all of the numbers show #NA but they are correct in the workbook. Also, the last page shows no values in the pdf but does in the workbook.

To recreate, just open the xlsm file, do a workbook.calculate() and then:

workbook.Worksheets("Regions").IsVisible = False
workbook.Worksheets("ISO").IsVisible = False
workbook.Worksheets("LowOutput").IsVisible = False
workbook.Worksheets("Map").PageSetup.Zoom = 40
workbook.Worksheets("Nuclear").PageSetup.Zoom = 43
workbook.Worksheets("NRSR").PageSetup.Zoom = 51Finally, save the workbook as a pdf.

One other note, I was receiving a calculation error in cell E25 on the Nuclear sheet. I made a change on the ISO sheet, simply concatenating columns A and B. This fixed the calc error, even though nothing references those cells (I had planned to change the cell reference, but just adding the concatenation fixed it). To see this problem, just clear column D in the ISO sheet, then open the file and do a workbook,Calculate().

Rick

Hello Rick,


Thank you for using Aspose.Cells.

I have checked your source xls file (no xlsm as you mentioned) and I found that on the MAP worksheet, all the numbers are showing as #N/A. Since, these refer to the K column of Nuclear sheet which is #N/A, so the conversion will show these #N/A as in the output PDF. I tried to manually evaluate the formulas in excel, but the values didn’t change. Can you please confirm if you have sent us the right file?

Also, I would request you to highlight the problematic areas in the resultant PDF by encircling them with red if possible. This will help us in identifying the issues more easily and investigate these further. I have used the following lines of code for creating the output PDF and, currently, it is the same as yours.

Workbook workbook = new Workbook("D://x1001.xls");
workbook.CalculateFormula();
PdfSaveOptions saveOptions = new PdfSaveOptions(SaveFormat.Pdf);
workbook.Save("D://x1001.pdf", saveOptions);

I also recommend you to download and use our latest fix: Aspose.Cells for .NET v7.2.1.7 and let us know your feedback.

The file is an xls, sorry. The reason your file shows NA in column K is that the date formula in K4 and K23 is dynamic. I've attached a file with the date in those column set to 6/8/2012 so you can see the issue (or you can just change K4 and K23 to 6/8/2012 in the file you have).

Also, the final page in the PDF shows no data, but in the workbook on the Nuclear sheet, starting at row 56 there is valid data.

I am using aspose.cells 7.2.1.7 as you mentioned in your message.

Rick

Hi,


Thank you for your feedback.

Please correct me if I am missing something. I could not reproduce the first part of your mentioned issue i.e. “N/A” in the map worksheet, as you can see in the attached screenshot.

However, I was able to reproduce the second part of your mentioned issues, i.e. “final page in the PDF shows no data”. I am forwarding these details to our development team and will let you know once we get an update from them.

I have used the following lines of code at my end:

Workbook workbook = new Workbook("D://x1001.xls");
workbook.CalculateFormula();
workbook.Worksheets["Regions"].IsVisible = false;
workbook.Worksheets["ISO"].IsVisible = false;
workbook.Worksheets["LowOutput"].IsVisible = false;
workbook.Worksheets["Map"].PageSetup.Zoom = 40;
workbook.Worksheets["Nuclear"].PageSetup.Zoom = 43;
workbook.Worksheets["NRSR"].PageSetup.Zoom = 51;
PdfSaveOptions saveOptions = new PdfSaveOptions(SaveFormat.Pdf);
workbook.Save("D://x1001.pdf", saveOptions);

The issue has been logged as: CELLSNET-40735.

I've attached 2 more files, and using the code below my map continues to show #NA instead of any values. I'm using the latest version of Cells for Net.

Dim workbook As Workbook
workbook = New Workbook(strName)
workbook.CalculateFormula()
Dim strMyDoc As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
workbook.Worksheets("Regions").IsVisible = False
workbook.Worksheets("ISO").IsVisible = False
workbook.Worksheets("LowOutput").IsVisible = False
workbook.Worksheets("Map").PageSetup.Zoom = 40
workbook.Worksheets("Nuclear").PageSetup.Zoom = 43
workbook.Worksheets("NRSR").PageSetup.Zoom = 51
strName = strMyDoc & "\nucleartest.pdf"
workbook.Save(strName, New XlsSaveOptions(SaveFormat.Pdf))

Hi,


Thanks for providing us more files.

This time I am able to reproduce the “#N/A” issue in the rendered Map sheet of the output PDF file. We have logged it against your existing issue “CELLSNET-40735” and we will also look into this issue. Once we have any update, we will let you know here.

Thank you.

Hi,

Please download and try the latest version:
Aspose.Cells
for .NET v7.2.1.7



Please call ShapeCollection.UpdateSelectedValue() to update the value of
the shapes.

See the following code.

C#


Workbook workbook = new Workbook(@“D:\FileTemp\x1001.xls”);

workbook.CalculateFormula();

for (int i = 0; i < workbook.Worksheets.Count; i++)

{

workbook.Worksheets[i].Shapes.UpdateSelectedValue();

}