Save to FileFormatType.Pdf - Wrong formatted date/time

Hi again :slight_smile:
I’ve a problem using function TEXT on result of a NOW() function converting xls to PDF format.

Attached you can find original Sheet and PDF produced with:

Aspose.Cells.License c_license = new Aspose.Cells.License();
c_license.SetLicense(@“C:\Programmi\Aspose\Aspose.Cells\License\Aspose.Cells.lic”);
Workbook aWk = new Workbook();
aWk.Open(@“C:\Temp\AsposePDF.xls”);
aWk.CalculateFormula();
aWk.Save(@“C:\Temp\AsposePDF.pdf”, FileFormatType.Pdf);

thanks for any help !!
Paolo

Hi Paolo,

Thanks for providing us the template files.

Yes, we found the issue. The issue seems to be with the "gg/mm/aaaa hh:mm:ss" which is not parsed correctly. We will check it if we can support it soon. We will get back to you soon.

Thank you.

Hi Paolo,

Thank you for considering Aspose.

We do not support the number format “gg/mm/aaaa hh:mm:ss” at the moment. Please simply change the number format as “/mm/dddd hh:mm:ss” and it will work fine as per your requirement.

Thank You & Best Regards,

Are you shure that “/mm/dddd hh:mm:ss” is a correct format ?

I’m trying with that but it doesn’t work.

thanks
Paolo


Hi Paolo,

Well, I tried to replace the format with "\/mm/dddd hh:mm:ss" in your template file and it works on my US-English local settings, what are yours?

I have attached input and output files here.

Thank you.

Sorry, I’m working with Italian local settings …

thanks

Hi,

Thank you for considering Aspose.

Well, for italian locale the provided format does not work fine. We will further look into it and get back to you soon.

Thank You & Best Regards,

Hi,

Thank you for considering Aspose.

Please try the attached latest version with the following code.

Workbook workbook = new Workbook();

workbook.Open("F:\\FileTemp\\AsposePDF.xls");

workbook.Region = CountryCode.Italy;

workbook.CalculateFormula();

workbook.Save("F:\\FileTemp\\dest.pdf");

Thank You & Best Regards,

GREAT !!

many thanks !!

Paolo