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

RadGrid exports a blank excel file iis8

1 Answer 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ralph
Top achievements
Rank 1
Ralph asked on 01 Jun 2015, 04:41 PM

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. 


1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 04 Jun 2015, 09:08 AM
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
Tags
Grid
Asked by
Ralph
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or