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

[Solved] Need urgent help in PDF export

3 Answers 204 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nayan Paregi
Top achievements
Rank 1
Nayan Paregi asked on 16 Oct 2009, 03:21 AM
Hi,

I have downloaded trial version of Telerik and trying to ceck whether my requirement are fullfill by telerik export functionality. All thing are seems fine just now wanted to give page number in PDF document on top like "Page 7 of 10", "Page 1 of 10"

Can you pls help me to sort out problem

Thanks in advance
Nayan Paregi

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 Oct 2009, 01:57 PM
Hello Nayan,

I'm afraid it is not possible to insert page numbers using RadGrid's PDF export functionality.

Let me know if I can assist you further.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Marie
Top achievements
Rank 1
answered on 10 Jul 2014, 01:04 PM
I did this and works...
protected void ExportPdfSettings()
        {
...
// Divides total rows by 22(rows per page) to get the total pages of a PDF
            dataTable = (DataTable)Session["RadGridData"];
            int count = dataTable.Rows.Count;
            double total = 0.0;
            if (count >= 1 && count < 22)
                total = 1;
            if (count >= 22)
            {
                total = ((count - 1) / 22) + 1;
            }


            RadGridItemList.ExportSettings.Pdf.PageFooter.RightCell.Text = "<div> / " + total + " pages </div>";
            RadGridItemList.ExportSettings.Pdf.PageFooter.RightCell.TextAlign = GridPdfPageHeaderFooterCell.CellTextAlign.Left;

....}
and in the client page I put this code
<ExportSettings HideStructureColumns="false" ExportOnlyData="false" IgnorePaging="true"
                OpenInNewWindow="true">
                <Pdf>
                    <PageFooter>
                        <MiddleCell Text="<?page-number?>" TextAlign="Right" />
                    </PageFooter>
                </Pdf>
            </ExportSettings>
0
Marie
Top achievements
Rank 1
answered on 10 Jul 2014, 01:09 PM
You can put both in the same line:
the same code....
RadGridItemList.ExportSettings.Pdf.PageFooter.RightCell.Text = "<div style='margin-right:3em'><?page-number?> / " + total + " pages </div>";
Tags
Grid
Asked by
Nayan Paregi
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Marie
Top achievements
Rank 1
Share this question
or