We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Conversion excel to PDF giving exception Index out of bounds.

Thread ID:

Created:

Updated:

Platform:

Replies:

150841 Jan 21,2020 06:10 PM UTC Feb 7,2020 12:02 PM UTC ASP.NET MVC - EJ 2 3
loading
Tags: XlsIO
Cláudio Walter
Asked On January 21, 2020 06:10 PM UTC

Hello,

during the conversion of a excel file to pdf, it was throw the exception "The index was out of bounds [...] [ Name of parameter: Index ]".

The excel is a model that uses tags to fill through code, then we convert the result to pdf. Attached I will the result that should be converted to pdf.

Attachment: result_3c19812a.zip

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On January 22, 2020 12:51 PM UTC

Hi Cláudio, 

Greetings from Syncfusion. 

We are able to reproduce the reported issue and validating it currently. We will share the validation details on 24th January 2020. 

Regards, 
Keerthi. 


Abirami Varadharajan [Syncfusion]
Replied On January 27, 2020 01:35 AM UTC

Hi Claudio, 

Thank you for your patience. 

We confirmed the issue with “Exception throws while ExcelToPDF conversion on creating PivotTable only with Row Fields” is a defect and logged a defect report for the same. The patch for this issue is estimated to be available on 7th February 2020. You can track the status of defect report through following feedback link. 
 
 
Regards, 
Abirami 



Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On February 7, 2020 12:02 PM UTC

Hi Cláudio, 

Thanks for your patience. 

We have fixed the issue Exception throws while ExcelToPDF conversion on creating PivotTable only with Row Fields and generated patch in the version v17.4.0.39.  

We suggest you to use the patch with following code snippet. 

Code Snippet: 

            //Instantiate ExcelEngine 
            using (ExcelEngine excelEngine = new ExcelEngine()) 
            { 
                //Initialize IApplication 
                IApplication application = excelEngine.Excel; 
 
                //Set the default application version 
                application.DefaultVersion = ExcelVersion.Excel2013; 
 
                //Load the existing Excel docuemnt into IWorkbook 
                IWorkbook workbook = application.Workbooks.Open(Server.MapPath("App_Data/result.xlsx"), ExcelOpenType.Automatic); 
 
                //Initialize ExcelToPdfConverter 
                ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook); 
                 
                //Initialize ExcelToPdfConverterSettings and disable the gridlines 
                ExcelToPdfConverterSettings converterSettings = new ExcelToPdfConverterSettings(); 
                converterSettings.DisplayGridLines = GridLinesDisplayStyle.Invisible; 
 
                //Initialize PDF document 
                PdfDocument pdfDocument = new PdfDocument(); 
 
                //Convert Excel document into PDF document 
                pdfDocument = converter.Convert(converterSettings); 
 
                //Open the document in browser after saving it 
                pdfDocument.Save("Output.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save); 
            } 

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: 17.4.0.39 

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\17.4.0.39\precompiledassemblies\17.4.0.39\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 17.4.0.39 specifically to resolve the issues reported in forum 150841.      
              
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.1 which will be rolled out by end of March 2020.  

Regards,     
Keerthi. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon