Last Updated: 02 Jul 2021 08:31 by ADMIN
Created on: 29 Jun 2021 19:18
Category: SpreadProcessing
Type: Bug Report
SpreadProcessing: All times are changed to be at the twelfth minute in certain cases


I am writing a piece of code in VB that converts Excel files that a user uploads into PDF files.  It merges all of them into one fixed document and exports that fixed document to a PDF. Whenever I upload specifically the "Schedule" default layout from Google Sheets, exported to xlsx format, all my times are changed from 9:30 AM or 1:28 PM to 9:12 AM and 1:12 PM respectively.

Reproduction Steps:

  1. Make a new sheet on Google Sheets using the "Schedule" layout.
  2. Export it to .xlsx
  3. Read the file into a spreadsheet, convert that spreadsheet to a PDF, save it, and open the PDF.
  4. All of the times should be incorrectly written.

A few key notes that may help with resolving the issue :

  • The conversion from .xlsx to a Workbook datatype does not have any issues. When importing to Workbook then exporting to XLSX, the sheets remained unchanged.
  • MS Excel does not have any issues viewing the exported XLSX file with the correct times, which means it is most likely a problem with the ExportToFixedDocument process.
  • Writing times in the same format manually and exporting it from Google Sheets does not create this bug. So far, I have only found that the "Schedule" layout will cause this issue.

Below I have written a snippet of my code, as well as included the xlsx file and the pdf file that results from it. I am using one of the latest versions of Telerik Document Processing, having been downloaded on 6/25/2021. 


Using infileStream As Stream = File.OpenRead(inputFilePath) Dim inputFormatter AsNew Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider Dim imported As Spreadsheet.Model.Workbook = inputFormatter.Import(infileStream) imported.ActiveWorksheet.WorksheetPageSetup.PaperType = Model.PaperTypes.Letter imported.ActiveWorksheet.WorksheetPageSetup.CenterHorizontally = True imported.ActiveWorksheet.WorksheetPageSetup.FitToPages = TrueDim format AsNew Spreadsheet.FormatProviders.Pdf.PdfFormatProvider Dim fixedDoc As Fixed.Model.RadFixedDocument = format.ExportToFixedDocument(imported) primaryDoc.Merge(fixedDoc) EndUsing

1 comment
Posted on: 02 Jul 2021 08:31

Hi Kaya,

I was able to reproduce the observed behavior with the attached file. I have approved the issue and updated your Telerik points. Our developers will look into the issue. You can track its status right here on the portal. 

The value is stored correctly but when the format string is used to display it (in this file there is a custom format string), it is incorrectly formatted and the wrong result appears. To work around this you can change the format to one of the predefined formats (see attached) and the file will be converted as expected.

Should you have any other questions do not hesitate to ask.

Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Attached Files: