chart line series are not converted properly when converting from excel to pdf using C# or Powershell

Hi Syncfusion,

when converted from excel file into pdf document, charts inside the worksheet are not converted appropriately
the two issue are 
The two important issues are:
  • Only one line series is displayed rather than three as in Excel
  • The label for these line graphs says "#REF" rather than the graph title
Please help.

Thanks

Attachment: Excel_to_pdf_conversion_issues_88c9b4b9.zip

13 Replies 1 reply marked as answer

SK Shamini Kiruba Sobers Syncfusion Team September 11, 2020 05:58 PM UTC

Hi Nagesh, 

Greetings from Syncfusion. 

Please find the response for your queries from the following table. 

Query 
Response 
Only one line series is displayed rather than three as in Excel 
We are able to reproduce the reported issue and validating it currently. We will share the validation details in two business days on September 15th, 2020. 

The label for these line graphs says "#REF" rather than the graph title 
We are unable to reproduce the reported issue with the given file at our end. The sample we tried at our end along with the output can be downloaded from the following link. 

Kindly modify the sample to reproduce the issue and share us to investigate further. 


Regards, 
Shamini 



SK Shamini Kiruba Sobers Syncfusion Team September 15, 2020 01:55 PM UTC

Hi Nagesh, 

We have validated the issue Line series are missing in Excel-to-PDF conversion and logged a defect report. The fix for the issue will be available in the upcoming weekly NuGet release planned to be rolled out by third week of September 2020. You can track the status of the issue through the following link. 


Also, please confirm the Syncfusion XlsIO version you are using at your end. 

Regards, 
Shamini


PN Preethi Nesakkan Gnanadurai Syncfusion Team September 16, 2020 04:27 AM UTC

From: Rudraiah, NageshSent: Tuesday, September 15, 2020 2:20 PM
To: Syncfusion Support <[email protected]>
Subject: Re: Syncfusion support community forum 157772, chart line series are not converted properly when converting from excel to pdf using C# or Powershell, has been updated. 


Hi, 
 
Thanks for the quick respond and confirming that as a bug. 
As requested, the current version of Syncfusion XlsIO we are using is 18.2460.0.44. 
Let me know if any more details required. 



SK Shamini Kiruba Sobers Syncfusion Team September 16, 2020 08:38 AM UTC

Hi Nagesh, 

Thanks for the update. We will provide patch for the fix on September 21st, 2020 in the version 18.2.0.44
  
  
Regards, 
Shamini 



PN Preethi Nesakkan Gnanadurai Syncfusion Team September 16, 2020 09:02 AM UTC

From: Rudraiah, Nagesh Sent: Wednesday, September 16, 2020 4:55 AM
To: Syncfusion Support <[email protected]>
Subject: Re: Syncfusion support community forum 157772, chart line series are not converted properly when converting from excel to pdf using C# or Powershell, has been updated. 


My Observations on the file behavior. 
1) the file which I provided to you people is "COVID Servicing Impact v1 2020-09-07.xlsx" which is of size 8421 KB. If directly use the file to convert to PDF then the issue occurs as stated earlier with respect to Chart series not dispalying. 
But If Open the file in local Excel editor and just click on save button then file size automatically increases to 12562 KB, So, here if I use this increased file to convert to PDF then I am getting Charts and its series appropriately. 
Please analyse and provide the right fix or suggested, which is a great help. 
 
Regards, 
Nagesh R


SK Shamini Kiruba Sobers Syncfusion Team September 18, 2020 06:36 AM UTC

Hi Nagesh, 

Thanks for sharing the details. We will consider this and we can provide the fix for the issue on September 21st, 2020 as promised earlier. 

Regards, 
Shamini 



SK Shamini Kiruba Sobers Syncfusion Team September 22, 2020 04:23 AM UTC

Hi Nagesh, 

Due to a delay in getting the testing results, we were unable to share the patch. As we are in the final stage of testing the fix, we will share the patch within few hours once done. 

Regards,
Shamini 



PN Preethi Nesakkan Gnanadurai Syncfusion Team September 22, 2020 08:24 AM UTC

From: Rudraiah, Nagesh Sent: Tuesday, September 22, 2020 1:55 AM
To: Syncfusion Support <[email protected]>
Subject: Re: Syncfusion support community forum 157772, chart line series are not converted properly when converting from excel to pdf using C# or Powershell, has been updated. 


Ok. thanks for the information. We understand the situation. And will be waiting for the patch arrvial. 
 
Regards, 
Nagesh R 



SK Shamini Kiruba Sobers Syncfusion Team September 22, 2020 06:07 PM UTC

Hi Nagesh, 

We appreciate your patience. 

We have fixed the issue Line series are missing in Excel-to-PDF conversion and generated patch in the version v18.2.0.44. The patch with fix to resolve the reported issue can be downloaded from the following link. 


Recommended approach - exe will perform automatic configuration       
   
Please find the patch setup from below location:       
       
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment       
   
Please find the patch assemblies alone from below location:       

     
Assembly Version: 18.2.0.44 

Installation Directions :        
This patch should replace the files “Syncfusion.XlsIO.Base.dll” under the following folder.       
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6       
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\18.2.0.44\precompiledassemblies\18.2.0.44\4.6    
       
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.       
       
Note :        
You can change how you receive bug fixes by navigating to the following link and updating your preferences.        
    
Disclaimer :   
Please note that we have created this patch for version 18.2.0.44 specifically to resolve the issue confirmed in the forum 157772
              
If you have received other patches for the same version for other products, please apply all patches in the order received.       
      
This fix will be included in our release version 18.3-SP1 which will be rolled out by end of October 2020.  

Regards,     
Shamini 


Marked as answer

PN Preethi Nesakkan Gnanadurai Syncfusion Team September 23, 2020 07:07 AM UTC

From: Rudraiah, Nagesh Sent: Wednesday, September 23, 2020 2:50 AM
To: Syncfusion Support <[email protected]>
Subject: Re: Syncfusion support community forum 157772, chart line series are not converted properly when converting from excel to pdf using C# or Powershell, has been updated. 


Hi, 
 
Thanks for providing a patch and I did a 1 level unit testing of the issue using the patch provided and its working fine now, Issue got resolved. 
I am able to see all the chart series in converted pdf file as per the excel document. But I noticed that Why the Horizontal(Category) Axis values are not coming as in the excel document sheet which has charts, I see there are several  Horizontal(Category) Axis values in generated pdf file which are not there in excel also displaying vertically clubbed,which is causing the next line series text is overlapping and dispalying over the Horizontal(Category) Axis, casusing unable to read properly.So,any suggestion to this issue will be higly helpful. 
 
Attached the converted pdf file. Excel file is already provided intial stages of issue creation. for more details 
 
Thanks 

COVID_Servicing_Impact_v1_2020-09-07



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team September 25, 2020 01:07 PM UTC

Hi Nagesh, 

We will check the reported query and share the details on September 28th,2020. 

We appreciate your patience. 

Regards, 
Keerthi. 



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team September 28, 2020 11:39 AM UTC

Hi Nagesh, 

Thanks for your patience. 

We are glad that the provided patch helped you. We are able to reproduce the issue and validating it currently. We will share the validation details on September 30th,2020.  

Regards, 
Keerthi. 



SK Shamini Kiruba Sobers Syncfusion Team September 30, 2020 09:39 AM UTC

Hi Nagesh, 

Thanks for the patience. 

We have validated the issue and found that the Major unit scale type is set to automatic for the charts in the input Excel document. When the scale is set to automatic, Microsoft Excel automatically uses the type as “Months” based on the data. Since XlsIO cannot detect the Major unit scale type, it uses “Days” type for major unit. To convert the chart similar to Microsoft Excel, we need to set the Major unit scale to “Month” as below. 

Code snippet: 

ExcelEngine engine = new ExcelEngine(); 
IWorkbook workbook = engine.Excel.Workbooks.Open(DataPathBase + "COVID Servicing Impact v1 2020-09-07.xlsx"); 
IWorksheet worksheet = workbook.Worksheets[0]; 
 
engine.Excel.ChartToImageConverter = new ChartToImageConverter(); 
engine.Excel.ChartToImageConverter.ScalingMode = ScalingMode.Best; 
 
foreach (IChart chart in workbook.ActiveSheet.Charts) 
{ 
    chart.PrimaryCategoryAxis.MajorUnitScale = ExcelChartBaseUnit.Month; 
} 
 
ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook.ActiveSheet); 
PdfDocument pdf = converter.Convert(); 
pdf.Save("Output.pdf"); 

Kindly let us know if the solution helps. 

Regards, 
Shamini 


Loader.
Up arrow icon