Freeze Row when converting Excel to PDF

Hi,


Is there a way to show the the first row of the excel worksheet on every page of a pdf document which is created by converting an excel document to pdf. 

I tried freezing the the row before converting the excel to pdf but that did not help. 

I basically want to show the first row of the excel spreadsheet on every page of the pdf document

Below is a snippet of the code in use:


IRange range = worksheet[2, 1];

range.FreezePanes();


XlsIORendererSettings settings = new XlsIORendererSettings();

settings.LayoutOptions = LayoutOptions.FitAllColumnsOnOnePage;

settings.DisplayGridLines = GridLinesDisplayStyle.Visible;

XlsIORenderer renderer = new XlsIORenderer();

 PdfDocument pdfDocument = renderer.ConvertToPDF(worksheet, settings);

.........


3 Replies

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team January 3, 2022 07:48 AM UTC

Hi Seenivasen, 

Greetings from Syncfusion. 

Freeze panes do not satisfy your requirement in Excel to PDF conversion. This is the behavior in Microsoft Excel also. We suggest you to use PrintTitleRows of PageSetup in IWorksheet to achieve your requirement. 

Code Snippet: 
 
worksheet.PageSetup.PrintTitleRows = "A1:C1:"; 

Please go through the below link for more details. 

Regards, 
Keerthi. 



SE Seenivasen January 8, 2022 06:45 AM UTC

Thank you. Your recommendation works :)



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team January 10, 2022 04:31 AM UTC

Hi Seenivasen, 

We are glad that the provided suggestion helped you. Kindly let us know if you need any further assistance. 

Regards, 
Keerthi. 


Loader.
Up arrow icon