RadGrid exports a blank excel file iis8

2 posts, 0 answers
  1. Ralph
    Ralph avatar
    1 posts
    Member since:
    Aug 2013

    Posted 01 Jun 2015 Link to this post

    Hello, 

    I have a Simple RadGrid that is using Export to Excel.  When running locally on Visual Studio 2012 i have no issues.  When it runs on the prduction server using IIS 8 I get blank spread sheets. 

     

    Markup: 

    <telerik:radgrid id="rgCReport" runat="server" datasourceid="LinqDataSource1" autogeneratecolumns="false" allowpaging="True"
                 allowsorting="True" clientsettings-resizing-allowcolumnresize="true" enabletheming="False"
                 pagesize="20" cellspacing="0" gridlines="None">
                 <ExportSettings>
                    <Excel Format="ExcelML" />
                 </ExportSettings>
                 <MasterTableView  PagerStyle-Mode="NextPrevAndNumeric" AutoGenerateColumns="false" EditMode="InPlace" >
                     <NoRecordsTemplate>
                         No Request Found
                     </NoRecordsTemplate>
                    
                     <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                     </RowIndicatorColumn>
                     <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                     </ExpandCollapseColumn>
                     <Columns>
                         <telerik:GridBoundColumn DataField="Created" HeaderText="Created" SortExpression="Created"
                             UniqueName="Created" DataFormatString="{0:d}<br/>{0:t}">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="DealerName" HeaderText="Dealer Name" SortExpression="DealerName"
                             UniqueName="DealerName">
                             <HeaderStyle Width="110px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" SortExpression="FirstName"
                             UniqueName="FirstName">
                             <HeaderStyle Width="110px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" SortExpression="LastName"
                             UniqueName="LastName">
                             <HeaderStyle Width="110px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="PhoneNumber" HeaderText="Phone" SortExpression="PhoneNumber"
                             UniqueName="PhoneNumber">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Email" HeaderText="Email" SortExpression="Email"
                             UniqueName="Email">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="DealerCity" HeaderText="Dealer City" SortExpression="DealerCity"
                             UniqueName="DealerCity">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="DealerState" HeaderText="Dealer State" SortExpression="DealerState"
                             UniqueName="DealerState">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="PCMethod" HeaderText="Contact Method" SortExpression="PCMethod"
                             UniqueName="PCMethod">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Comments" Display="false" HeaderText="Comments" SortExpression="Comments"
                             UniqueName="Comments">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                          <telerik:GridBoundColumn DataField="CarModel" Display="false" HeaderText="Model" SortExpression="Comments"
                             UniqueName="CarModel">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                          <telerik:GridBoundColumn DataField="CarVin" Display="false" HeaderText="Vin" SortExpression="Comments"
                             UniqueName="CarVin">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                          <telerik:GridBoundColumn DataField="CarYear" Display="false" HeaderText="Year" SortExpression="Comments"
                             UniqueName="CarYear">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
                          <telerik:GridBoundColumn DataField="CarMake" Display="false" HeaderText="Make" SortExpression="Comments"
                             UniqueName="CarMake">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
     
                         <telerik:GridBoundColumn DataField="Preferred" HeaderText="Preferred" SortExpression="Preferred"
                             UniqueName="Preferred">
                             <HeaderStyle Width="68px" />
                         </telerik:GridBoundColumn>
     
     
                     </Columns>
                     <EditFormSettings>
                         <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                         </EditColumn>
                     </EditFormSettings>
                 </MasterTableView>
       
                 <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                 </HeaderContextMenu>
             </telerik:radgrid>

     

    Code Behind:

    protected void exportBtn_Click(object sender, EventArgs e)
     {
     
         this.rgCReport.MasterTableView.GetColumn("Comments").Display = true;
         this.rgCReport.MasterTableView.GetColumn("CarModel").Display = true;
         this.rgCReport.MasterTableView.GetColumn("CarVin").Display = true;
         this.rgCReport.MasterTableView.GetColumn("CarYear").Display = true;
         this.rgCReport.MasterTableView.GetColumn("CarMake").Display = true;
         this.rgCReport.ExportSettings.FileName = "Dealer Contact Report";
         this.rgCReport.ExportSettings.ExportOnlyData = true;
         this.rgCReport.ExportSettings.IgnorePaging = true;
         this.rgCReport.MasterTableView.ExportToExcel();
     
     }


     Is there something i can check to see why this is happening? there are no console errors in browser. 


  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 04 Jun 2015 Link to this post

    Hi Ralph,

    When exporting arrays, ArrayList, custom objects, LinqDataSource you should set UseAllDataFields="true" in MasterTableView.
    <MasterTableView UseAllDataFields="true" ... >

    Please try to enabling and let me know about the result.

    Regards,
    Kostadin
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top