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

[Solved] Error on ExportToPdf in IE7

2 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Furner
Top achievements
Rank 2
Brian Furner asked on 20 Aug 2009, 10:36 PM
I have a RadGrid with a DetailTable that throws an error on export to pdf in IE7 and earlier.  Export works fine in IE8, Firefox, and Chrome, but throws the following error in IE7 and earlier:
    System.SystemException: At least one of minimum, optimum, or maximum IPD must be specified on table.

Here is the source code for the RadGrid
<telerik:RadGrid ID="rgrdPayroll" runat="server" AutoGenerateColumns="False" DataSourceID="odsPersonnelByPI" 
    GridLines="None"
    <MasterTableView DataSourceID="odsPersonnelByPI" DataKeyNames="DisplayName" HierarchyLoadMode="ServerBind"
        <DetailTables> 
            <telerik:GridTableView runat="server" DataSourceID="odsPayrollByPI" GridLines="None"
                <ParentTableRelation> 
                    <telerik:GridRelationFields DetailKeyField="DisplayName" MasterKeyField="DisplayName" /> 
                </ParentTableRelation> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="SlAcct6No" HeaderText="Account" UniqueName="SlAcct6No"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="AcctName" HeaderText="Account Name" UniqueName="AcctName"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Pay" DataType="System.Decimal" HeaderText="Pay" 
                        ReadOnly="True" SortExpression="Pay" UniqueName="Pay" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Benfit" DataType="System.Decimal" HeaderText="Benefit" 
                        ReadOnly="True" SortExpression="Benfit" UniqueName="Benfit" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Total" DataType="System.Decimal" HeaderText="Total" 
                        ReadOnly="True" SortExpression="Total" UniqueName="Total" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
                    </telerik:GridBoundColumn> 
                </Columns> 
            </telerik:GridTableView> 
        </DetailTables> 
        <ExpandCollapseColumn Visible="True"
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Personnel" SortExpression="DisplayName" 
                UniqueName="DisplayName"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Total" DataType="System.Decimal" HeaderText="Total" 
                ReadOnly="True" SortExpression="Total" UniqueName="Total Salary" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
            </telerik:GridBoundColumn> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 

And here is the C# code that runs when the export button is clicked:

protected void btnPDFPersonnel_Click(object sender, EventArgs e) 
    rgrdPayroll.ExportSettings.FileName = ddlPIs.SelectedValue.Substring(0, ddlPIs.SelectedValue.IndexOf(',')) + "_Personnel"
    rgrdPayroll.ExportSettings.OpenInNewWindow = true
    rgrdPayroll.ExportSettings.ExportOnlyData = true
    rgrdPayroll.ExportSettings.IgnorePaging = false
    rgrdPayroll.ExportSettings.Pdf.PageWidth = Unit.Parse("297mm"); 
    rgrdPayroll.ExportSettings.Pdf.PageHeight = Unit.Parse("216mm"); 
    foreach (GridItem item in rgrdPayroll.MasterTableView.Items) 
    { 
        item.Expanded = true
    } 
    rgrdPayroll.MasterTableView.ExportToPdf(); 
 
 

Has anybody run across this error before in IE7?  Why would this same code work in the other browsers by not IE7?

Thanks,

Brian

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 21 Aug 2009, 09:23 AM
Hello Brian,

To avoid this error you should define width to your GridTableViews (or at least to the nested tables). An example is shown below:
<MasterTableView DataSourceID="odsPersonnelByPI" DataKeyNames="DisplayName" HierarchyLoadMode="ServerBind" Width="100%">  
    <DetailTables>  
        <telerik:GridTableView runat="server" DataSourceID="odsPayrollByPI" GridLines="None" Width="100%">  

I hope this helps.

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Brian Furner
Top achievements
Rank 2
answered on 21 Aug 2009, 02:08 PM
Thanks Daniel.
Adding Width="100%" to the nested table took care of the issue.

Tags
Grid
Asked by
Brian Furner
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Brian Furner
Top achievements
Rank 2
Share this question
or