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

Problem in Exporting grid data to pdf

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ram
Top achievements
Rank 1
Ram asked on 27 Mar 2009, 02:00 PM
Hi, I am using Radcontrols of Q2 2008 and I am using acrobat Reader Version 8

My problem is when I am exporting grid data to pdf where it works fine on some machines and on some machines it throws following error:

There was an error in opening this document. This file can not be found.

This happens only when I directly opens the file with out saving it.

my code is as follows:

<radG:RadGrid ID="dgReport" runat="server" Skin="Default" EnableEmbeddedSkins="false" >
                                <ExportSettings OpenInNewWindow="True" IgnorePaging="True">
                                    <Pdf Author="Anonymous" Title="RadGrid export" Subject="RadGrid Export" Keywords="None"
                                        AllowCopy="True" AllowModify="True" PageTopMargin="1in" PageBottomMargin="1in"
                                        PageLeftMargin="0.2in" PageRightMargin="0.2in"></Pdf>
                                </ExportSettings>
                                <MasterTableView  HeaderStyle-Wrap="false" ItemStyle-Wrap="false">
                                    <ExpandCollapseColumn>
                                        <HeaderStyle Width="20px" />
                                    </ExpandCollapseColumn>
                                    <RowIndicatorColumn>
                                        <HeaderStyle Width="20px" />
                                    </RowIndicatorColumn>
                                  
                                </MasterTableView>
                                <FilterMenu EnableTheming="True">
                                    <CollapseAnimation Duration="200" Type="OutQuint" />
                                </FilterMenu>
            </radG:RadGrid>

code behind:

bool isPdfExport = false;
protected void btnExportToPdf_Click(object sender, EventArgs e)
        {
          
                isPdfExport = true;
                 dgReport.ExportSettings.ExportOnlyData = false;
                dgReport.ExportSettings.Pdf.PageWidth = 2000;
                dgDReport.MasterTableView.ExportToPdf();
         }

can any one suggest the solution for this.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Mar 2009, 04:03 PM
Hello Ram,

Could you please try to set OpenInNewWindow="False"?
Let me know whether this helps to avoid the problem.

Best regards,
Daniel
the Telerik team

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