HEADER / FOOTER - PAGE NUMBERS WITH SUB PAGE NUMBERS

Dear Sir,

I have 15 Columns in SFDATAGRID, while exporting to pdf columns are separated as per page size into subsequent pages.

Example in First Page I got 5 columns, in second page getting 3 Columns, in Third Page.. 4 columns and  subsequently next page getting 3 columns.

Requirements :

On Every page I want Page No. with sub page numbers like Page 1( A Part), Page 1(B Part), Page 1(C Part), Page 1(D Part)... and so on..

as per my example for First page where I got 5 Columns will show header as 1(A Part), next 3 columns are also same part will show header as 1(B Part), then for next 4 Columns header will be 1(C Part).....etc


Result text will be : 1(A Part), 1(B Part)... or 1/1 Part, 1/2 Part, 1/3 Part..

the above result text are sub part of the Main page which is required as Header.

Where as Normal Page number is required in footer. 

Hope that you will understand and reply me at the earliest.





On First Page I want "Page no. 1

3 Replies

AA Arulraj A Syncfusion Team September 18, 2018 05:36 AM UTC

Hi Deepak, 
 
Thanks for contacting Syncfusion support. 
 
At present, PdfGrid exporting doesn’t have the behavior to achieving your requirement of adding subpage numbers. However you can add normal page number at the footer of the pdf by using the PdfPageNumberField and PdfCompositeField. Please refer to the following code example.  
 
Code Example:  
  
RectangleF bounds = new RectangleF(0, 10, document.Pages[0].GetClientSize().Width, 50); 
PdfPageTemplateElement footer = new PdfPageTemplateElement(bounds); 
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 7); 
PdfBrush brush = new PdfSolidBrush(Color.Black); 
 
//Create page number field. 
PdfPageNumberField pageNumber = new PdfPageNumberField(font, brush); 
 
//Add the fields in composite fields. 
PdfCompositeField compositeField = new PdfCompositeField(font, brush, "{0}", pageNumber); 
compositeField.Bounds = footer.Bounds; 
 
//Draw the composite field in footer. 
compositeField.Draw(footer.Graphics, new PointF(250, 40)); 
 
//Add the footer template at the bottom. 
document.Template.Bottom = footer; 
  
 
Arulraj A 



DE Deepak September 23, 2018 12:58 PM UTC

Hi Arulraj A,

Thanks for your reply.

What is the Solution for adding subpage numbers ?



AA Arulraj A Syncfusion Team September 24, 2018 11:52 AM UTC

Hi Deepak, 

Thanks for your update. 

We regret to know you that as we specified in our last update, PdfGrid exporting does not have support to add subpage numbers as per your requirement. There is no possibility to achieve it in sample level also. It is only possible to add same header or footer to all the pages. 
Please let us now if you have any other queries. 
 
Regards, 
Arulraj A 


Loader.
Up arrow icon