This is a migrated thread and some comments may be shown as answers.

Page number and more when exporting in pdf

5 Answers 618 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrea
Top achievements
Rank 1
Andrea asked on 21 Dec 2011, 01:06 AM
Is there any way to add page number and repeat column header on every page when exporting gridview to pdf?
Thanks

5 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 23 Dec 2011, 04:54 PM
Hello Andrea,

Thank you for writing.

Currently our export to PDF feature does not support page customization and we have not planned these features. Nevertheless, if more people request the same, we will consider improving our API.

You could try using the PageTitle property of ExportToPDF to mimic the repetition of the header cells on each page. The PageTitle property is a string property so you will have to experiment a bit to align the text with the columns.

Should you have other questions, I would be glad to assist.

Regards,
Jack
the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Udo
Top achievements
Rank 1
answered on 28 Dec 2014, 04:27 AM
"Is there any way to add page number and repeat column header on every page when exporting gridview to pdf?"
I think too, that this Feature - page customization - makes sense.

"You could try using the PageTitle property of ExportToPDF to mimic the repetition of the header cells on each page. The PageTitle property is a string property so you will have to experiment a bit to align the text with the columns."

This can not be the solution.


Greetings
Udo
0
Stefan
Telerik team
answered on 29 Dec 2014, 02:24 PM
Hi Udo,

Thank you for your opinion. Here is a feature request for such a functionality where you can add your vote: http://feedback.telerik.com/Project/154/Feedback/Details/111266-add-radgridview-one-should-be-able-to-show-the-header-row-on-each-page-exporte. And here is another one for the page number: http://feedback.telerik.com/Project/154/Feedback/Details/111264-add-radgridview-add-header-and-footer-functionality-when-exporting-to-pdf.

I hope that you find this useful.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Sanjay
Top achievements
Rank 1
answered on 21 Sep 2015, 06:35 AM

Hi There,

We are using version 2015.1.225.40. When gridview is exported to PDF using either SpreadExport or ExportToPDF ,can we put page number on each PDF documents generated, i..e Page 1 of 3 , Page 2 of 3 , Page 3 of 3.

Thanks in Anticipation

 

0
Stefan
Telerik team
answered on 21 Sep 2015, 11:24 AM
Hi Sanjay,

Thank you for writing.

Neither of the providers mentioned supports page numbering. However, you can use our PdfProcessing functionality and print the page number. Here is a small sample:
RadFixedDocument document;
PdfFormatProvider provider = new PdfFormatProvider();
using (Stream stream = File.OpenRead("..\\..\\text.pdf"))
{
    document = provider.Import(stream);
 
    foreach (RadFixedPage page in document.Pages)
    {
        FixedContentEditor editor = new FixedContentEditor(page);
        editor.Position.Translate(page.Size.Width / 2, page.Size.Height - 50);
         
        int pageNum = document.Pages.IndexOf(page)+1;
        editor.DrawText(pageNum + " of " + document.Pages.Count);
    }
 
}
 
using (Stream output = File.OpenWrite("..\\..\\text.pdf"))
{
    provider.Export(document, output);
}

More information regarding RadPdfProcessing is available here: http://www.telerik.com/help/winforms/pdfprocessing-editing-fixedcontenteditor.html.

I hope this helps.

Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Andrea
Top achievements
Rank 1
Answers by
Jack
Telerik team
Udo
Top achievements
Rank 1
Stefan
Telerik team
Sanjay
Top achievements
Rank 1
Share this question
or