We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF rendering With Aspose.Cells Version 8.6.2.0

I am using Aspose.Cells Version 8.6.2.0 and have the attached xlsx file to generate the attached pdf file with the following code.



public static void GetExcelPdfResults(Workbook workbook, string product, int dealerNumber = 999999, RateChartType chartType = RateChartType.NDC, string rateID = “ZZZZZZ”, string deductible = “”)

{

DateTime now = DateTime.Now;

string dateTime = now.Year.ToString() + now.Month.ToString().PadLeft(2, ‘0’) + now.Day.ToString().PadLeft(2, ‘0’) + now.Hour.ToString().PadLeft(2, ‘0’) + now.Minute.ToString().PadLeft(2, ‘0’) + now.Second.ToString().PadLeft(2, ‘0’) + now.Millisecond.ToString().PadLeft(3, ‘0’);

string fileName = product + “" + dealerNumber + "” + rateID + “" + chartType.ToString() + "” + dateTime;

workbook.Save(ConfigurationManager.AppSettings[“Rate_Chart_Excel_Template_Directory”] + product + @"" + fileName + (deductible == “” ? “” : “" + deductible) + “.xlsx”, SaveFormat.Xlsx);

workbook.Save(ConfigurationManager.AppSettings[“Rate_Chart_Excel_Template_Directory”] + product + @"" + fileName + (deductible == “” ? “” : "
” + deductible) + “.pdf”, SaveFormat.Pdf);

}



The result is very different from the xlsx file.



Please advise.

Hi,


Thanks for providing us template file and sample code segment.

Please call Workbook.CalculateFormula() method before rendering to PDF file format. I have tested it using your template file and it works fine.

Thank you.