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

exportToExcel in Excel Empty

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
salih
Top achievements
Rank 1
salih asked on 25 Sep 2012, 05:45 PM
Hi ,
my radgirid sample markup
<telerik:RadGrid ID="RadCagri" runat="server"
             CellSpacing="0" Culture="tr-TR" Height="380px" GridLines="None"
    AllowPaging="True" AutoGenerateColumns="False" CssClass="Grid_Modul"
    AllowFilteringByColumn="True" AllowSorting="True" Skin="Simple">           
                  
            <MasterTableView DataKeyNames="GERCEKADI" HierarchyLoadMode="Client" >
            <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
            </EditFormSettings>
 
            <PagerStyle Mode="NextPrevAndNumeric" />
           <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
               <Columns>
 
                     <telerik:GridBoundColumn DataField="GERCEKADI" HeaderText="Çağrı Merkezi Uzm."
                       FilterControlAltText="Filter GERCEKADI column" UniqueName="GERCEKADI"
                       FilterControlWidth="250px"><ItemStyle Wrap="False" /></telerik:GridBoundColumn>
 
                  <telerik:GridBoundColumn DataField="TXTUNVAN" HeaderText="Müşteri Adı"
                       FilterControlAltText="Filter TXTUNVAN column" UniqueName="AG" DataType="System.String" FilterControlWidth="400px">
                       <ItemStyle Wrap="False" /></telerik:GridBoundColumn>
 
                  <telerik:GridBoundColumn DataField="TXTPROJEADI" HeaderText="Proje"
                       FilterControlAltText="Filter TXTPROJEADI column" DataType="System.String"
                       UniqueName="TXTPROJEADI">
                       <ItemStyle Wrap="False" /></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn DataField="LNGMERKEZKOD" HeaderText="merkez Kod"
                       FilterControlAltText="Filter LNGMERKEZKOD column" DataType="System.Int32"
                       UniqueName="LNGMERKEZKOD" Display="false">
                       <ItemStyle Wrap="False" /></telerik:GridBoundColumn>
 
 
                      <telerik:GridDateTimeColumn DataField="TRHTARIH"
                       DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime"
                       FilterControlAltText="Filter TRHTARIH column" FilterControlWidth="150px"
                       HeaderText="Arama Tarihi" UniqueName="TRHTARIH">
                       <ItemStyle Wrap="False" /></telerik:GridDateTimeColumn>
                 
                   <telerik:GridDateTimeColumn DataField="TXTSAAT"
                       DataFormatString="{0:HH:mm:ss}" DataType="System.DateTime" FilterControlWidth="100px"
                       FilterControlAltText="Filter TXTSAAT column" HeaderText="Arama Saati"
                       MinDate="" UniqueName="TXTSAAT">
                   </telerik:GridDateTimeColumn>
 
                    <telerik:GridBoundColumn DataField="TXTDEPARTMAN" HeaderText="Çağrı Kuyruğu"
                       FilterControlAltText="Filter TXTDEPARTMAN column" DataType="System.String"
                       UniqueName="TXTDEPARTMAN">
                       <ItemStyle Wrap="False" /></telerik:GridBoundColumn>
 
                </Columns>
              </MasterTableView>
             <ClientSettings>
                <DataBinding Location="GridMasterDetailsService.svc" FilterParameterType="Linq" SelectMethod="GetCLG"
                 SortParameterType="Linq" ShowEmptyRowsOnLoad="True">               
                </DataBinding>
                <ClientEvents OnDataBound="RadCagri_DataBound" OnDataBinding="RadCagri_DataBinding" OnGridCreated="RadCagriCriteria" />
                <Selecting AllowRowSelect="True"></Selecting>
                <Scrolling AllowScroll="True"></Scrolling>
            </ClientSettings>
             
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
             
 
 
 
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu></telerik:RadGrid>
and my button click 
RadCagri.ExportSettings.ExportOnlyData = True
       RadCagri.ExportSettings.IgnorePaging = True
       RadCagri.ExportSettings.OpenInNewWindow = True
       RadCagri.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerBind
       RadCagri.MasterTableView.ExportToExcel()
but export excell empty whyy my page usercontrol

Help mee Thanks

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 28 Sep 2012, 12:17 PM
Hello Salih,

Exporting with client-side binding is not supported, RadGrid should be bound server-side, otherwise you will receive an empty file. But still you can workaround it using the approach described in this forum thread.

Regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
salih
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or