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

Problems exporting RadGrid content to PDF

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eliaquim
Top achievements
Rank 1
Eliaquim asked on 17 Nov 2008, 01:13 PM
Hello,

I'm having problems when exporting RadGrid to PDF. After exporting, the pdf file shows only a part of my grid. Example: if the grid has 20 columns with large width, only 3 or 4 columns appears in the final file. How can i format this grid so that all columns appears in the pdf file?

My code is something like this:

grid.ExportSettings.IgnorePaging = false;
grid.ExportSettings.OpenInNewWindow = true;
grid.ExportSettings.ExportOnlyData = true;
grid.ExportSettings.FileName = "test";
//this was a try to do what i want... :(
grid.ExportSettings.Pdf.PageHeight = Unit.Parse("162mm");
grid.ExportSettings.Pdf.PageWidth = Unit.Parse("600mm");

Is that possible?
Thanks.

Eliaquim

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 18 Nov 2008, 02:50 PM
Hello Eliaquim,

A possible approach would be to change the font size on export:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    if (e.Item is GridDataItem || e.Item is GridHeaderItem) 
    { 
        foreach (TableCell cell in e.Item.Cells) 
        { 
            cell.Style["font-family"] = "Arial Narrow"
            cell.Style["font-size"] = "6pt"
        } 
    } 

You can find more information in the following article:
Exporting tips and tricks

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Eliaquim
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or