Export to pdf is not displaying the records in proper format

2 posts, 0 answers
  1. Amitkumar
    Amitkumar avatar
    66 posts
    Member since:
    Aug 2009

    Posted 23 Feb 2010 Link to this post

    Hi All,

    I am using RadGrid, and i am using following functions to export grid data, all export method works fine except export to pdf, it will not display data properlly in pdf file

    protected void BtnExcel_Click(object sender, EventArgs e)
                ViewState["ExportingPDF"] = null;

                switch ((sender as Button).ID)
                    case "Excel":
                        foreach (GridItem commandItem in this.rgAgenda.MasterTableView.GetItems(GridItemType.CommandItem))
                            commandItem.Visible = false;

                    case "CSV":
                        rgAgenda.MasterTableView.ExportToCSV(); break;
                    case "Word":
                        rgAgenda.MasterTableView.ExportToWord(); break;
                    case "PDF":
                        rgAgenda.ExportSettings.OpenInNewWindow = true;
                        ViewState["ExportingPDF"] = "True";

            private void SetExport()
                rgAgenda.ExportSettings.ExportOnlyData = true;
                rgAgenda.ExportSettings.IgnorePaging = true;
                rgAgenda.ExportSettings.OpenInNewWindow = false;
                rgAgenda.ExportSettings.FileName = "AppointmentsInGrid";

                // Removing command item from the exported document
                foreach (GridItem commandItem in this.rgAgenda.MasterTableView.GetItems(GridItemType.CommandItem))
                    commandItem.Visible = false;

            private void ExportToPDF()
                if (ddlPaperSize.SelectedIndex > 0 && ddlPaperSize.SelectedIndex <= 5)
                    rgAgenda.ExportSettings.Pdf.AllowAdd = false;
                    rgAgenda.ExportSettings.Pdf.AllowCopy = true;
                    rgAgenda.ExportSettings.Pdf.AllowModify = true;
                    rgAgenda.ExportSettings.Pdf.AllowPrinting = true;
                    rgAgenda.ExportSettings.Pdf.Author = "Anonymous";

                    rgAgenda.ExportSettings.Pdf.PageTitle = "Appointments Report";
                    rgAgenda.ExportSettings.Pdf.Subject = "PDF Export";
                    rgAgenda.ExportSettings.Pdf.Title = "PDF Export";

                    rgAgenda.ExportSettings.Pdf.PaperSize = (GridPaperSize)Enum.Parse(typeof(GridPaperSize), ddlPaperSize.SelectedValue);

    Thanks & Regards
    Amit Prajapati

  2. Daniel
    Daniel avatar
    4949 posts

    Posted 23 Feb 2010 Link to this post

    Hello Amit,

    I'm not sure that I understand what do you mean. Could you please provide more detailed information about the problem?

    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
Back to Top