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

empty page when using exporttopdf

7 Answers 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mohammad
Top achievements
Rank 1
Mohammad asked on 01 Feb 2011, 10:39 AM
hi
when I test your demo to export radgridview to pdf, it created a pdf with 5 empty pages !!!!!!
5 bookmarks but With white page !!!!!
what can I do Know?

7 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 01 Feb 2011, 11:08 AM
Hello,

Please review this documentation on exporting to PDF. If you are still haivng issues I can create a smal sample for you.
Regards,
Richard
0
Mohammad
Top achievements
Rank 1
answered on 01 Feb 2011, 11:34 AM
hi
I know how I can make export but It dont work correctly even your winform demo!!!!!!!
does it need any prerequest except telerik Q3.... and .net framework 3.5sp1
0
Richard Slade
Top achievements
Rank 2
answered on 01 Feb 2011, 11:53 AM
Hello,

The demos see to function correctly. Please can you try this small exmaple

Designer File
namespace RadGridView_Export_C
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components;
  
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
  
        #region Windows Form Designer generated code
  
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.radButton1 = new Telerik.WinControls.UI.RadButton();
            this.radGridView1 = new Telerik.WinControls.UI.RadGridView();
            ((System.ComponentModel.ISupportInitialize)(this.radButton1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).BeginInit();
            this.SuspendLayout();
            // 
            // radButton1
            // 
            this.radButton1.Location = new System.Drawing.Point(224, 295);
            this.radButton1.Name = "radButton1";
            this.radButton1.Size = new System.Drawing.Size(130, 24);
            this.radButton1.TabIndex = 0;
            this.radButton1.Text = "Export";
            this.radButton1.Click += new System.EventHandler(this.radButton1_Click);
            // 
            // radGridView1
            // 
            this.radGridView1.Location = new System.Drawing.Point(13, 13);
            this.radGridView1.Name = "radGridView1";
            this.radGridView1.Size = new System.Drawing.Size(341, 265);
            this.radGridView1.TabIndex = 1;
            this.radGridView1.Text = "radGridView1";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(366, 331);
            this.Controls.Add(this.radGridView1);
            this.Controls.Add(this.radButton1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            ((System.ComponentModel.ISupportInitialize)(this.radButton1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).EndInit();
            this.ResumeLayout(false);
  
        }
  
        #endregion
  
        private Telerik.WinControls.UI.RadButton radButton1;
        private Telerik.WinControls.UI.RadGridView radGridView1;
    }
}

Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls.UI;
using Telerik.WinControls.Data;
using Telerik.WinControls.UI.Export;
  
namespace RadGridView_Export_C
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
  
        private void Form1_Load(object sender, EventArgs e)
        {
            GridViewTextBoxColumn stringColumn = new GridViewTextBoxColumn();
            stringColumn.Name = "MyString";
            stringColumn.HeaderText = "MyString";
            stringColumn.FieldName = "MyString";
            this.radGridView1.Columns.Add(stringColumn);
  
            this.radGridView1.Rows.Add("This is the first string");
            this.radGridView1.Rows.Add("This is the second string");
            this.radGridView1.Rows.Add("This is the third string");
  
        }
  
        private void radButton1_Click(object sender, EventArgs e)
        {
            ExportToPDF exporter = new ExportToPDF(this.radGridView1);
            exporter.ExportVisualSettings = true;
            exporter.RunExport(@"YourPath...\MyFile.pdf");
        }
    }
}

As you can see from the attached screenshot, the PDF was created correctly.
Regards,
Richard
0
Mohammad
Top achievements
Rank 1
answered on 01 Feb 2011, 03:02 PM
hi
I saw your sample but when start it ,I see a white page that open in the acrobat
!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;-(
0
Richard Slade
Top achievements
Rank 2
answered on 01 Feb 2011, 03:07 PM
Hello,

Form what I understand you have tried my sample above and you only see a blank page. Is that correct? If so, then can you open any PDF File on that PC?
Regards,
Richard
0
Mohammad
Top achievements
Rank 1
answered on 01 Feb 2011, 04:28 PM
hi
yes
I can open and see pdf files either Can export from reportviewer too!!!!!!!!!!!!!
0
Richard Slade
Top achievements
Rank 2
answered on 01 Feb 2011, 04:34 PM
I'm afraid I cannot replicate your issue at this time. From what I understand you have tried the sample I provided and this does not work for you, nor does the demo on the Telerik installation though you can view other PDF Files on that PC, and also use it from Telerik Reporting.

Are you able to use my sample when compiled on another PC? If not, then I would advise opening a support ticket at this time.
regards,
Richard
Tags
GridView
Asked by
Mohammad
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Mohammad
Top achievements
Rank 1
Share this question
or