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

export to csv issue

7 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chris
Top achievements
Rank 1
chris asked on 05 Feb 2009, 03:13 PM
I have a radgid that has a button for each export. (csv,xls,word,pdf) They are all set up the same and they all work except for the csv one. The CSV is only exporting the headers not the data. It used to work and nothing has changed that has anything to do with the export but now it is not working. I have tried the following steps. Rebooted my machine and restarted VS and i have also rerefrenced Telerik.Web.UI.dll and it is still only giving me "MenuId","MenuPageKey","MenuHeader","MenuLinkText","MenuLink","MenuSortOrder","MenuView","MenuHeaderSortOrder"

PDF word and excel all give me full data

below is my radgrid code and the code for the exports.
<telerik:RadGrid ID="RadGrid1" OnSortCommand="RadGrid1_SortCommand" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnNeedDataSource="RadGrid1_NeedDataSource" 
        AllowSorting="True" PageSize="15" AllowPaging="True" runat="server" EnableEmbeddedSkins="false" 
        Skin="EasyEcomm" AutoGenerateColumns="true" ExportSettings-ExportOnlyData="false" ExportSettings-FileName="SqlExport" 
         ExportSettings-OpenInNewWindow="true"
        <PagerStyle Mode="Slider" /> 
        <ClientSettings EnableRowHoverStyle="true"
        </ClientSettings> 
    </telerik:RadGrid> 
    <asp:Label ID="SqlStatementLabel" runat="server" Text=""></asp:Label><br /> 
    <div class="bottom_left_div" runat="server" id="ButtonsDiv"
        <br /> 
        <asp:Button ID="BackButton" runat="server" Text="&lt;&lt; Back" OnClick="BackButton_Click" /><asp:Button 
            ID="ExportCSVButton" runat="server" Text="Export to CSV" OnClick="ExportCSVButton_Click" /> 
            <asp:Button 
            ID="ExportXLSButton" runat="server" Text="Export to XLS" OnClick="ExportXLSButton_Click" /> 
             
            <asp:Button 
            ID="ExportWRDButton" runat="server" Text="Export to Word" OnClick="ExportWRDButton_Click" /> 
            <asp:Button 
            ID="ExportPDFButton" runat="server" Text="Export to PDF" OnClick="ExportPDFButton_Click" /> 
             
             
        
    </div> 

    protected void ExportCSVButton_Click(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.AllowPaging = false
        RadGrid1.MasterTableView.Rebind();  
        RadGrid1.ExportSettings.IgnorePaging = true
        RadGrid1.MasterTableView.ExportToCSV(); 
    } 
   
 
    protected void ExportXLSButton_Click(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.AllowPaging = false
        RadGrid1.MasterTableView.Rebind();  
        RadGrid1.ExportSettings.IgnorePaging = true
        RadGrid1.MasterTableView.ExportToExcel(); 
    } 
 
    protected void ExportWRDButton_Click(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.AllowPaging = false
        RadGrid1.MasterTableView.Rebind();  
        RadGrid1.ExportSettings.IgnorePaging = true
        RadGrid1.MasterTableView.ExportToWord(); 
    } 
 
    protected void ExportPDFButton_Click(object sender, EventArgs e) 
    { 
        RadGrid1.ExportSettings.Pdf.PageHeight = Unit.Parse("162mm"); 
        RadGrid1.ExportSettings.Pdf.PageWidth = Unit.Parse("600mm"); 
        RadGrid1.MasterTableView.AllowPaging = false
        RadGrid1.MasterTableView.Rebind();  
        RadGrid1.ExportSettings.IgnorePaging = true
        RadGrid1.MasterTableView.ExportToPdf(); 
    } 


Thank you for your help

7 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 05 Feb 2009, 05:22 PM
Hello Chris,

I'm unable to reproduce the problem you have. Could you please test the attached website (based on your code) locally and let me know how to modify it according to your scenario?

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
chris
Top achievements
Rank 1
answered on 05 Feb 2009, 08:51 PM
Daniel,
   I have attached a striped down working version of the project to a ticket in my account with 2 other issues that are all happening in the same section(s). I did not want to link it here. Please take a look at it and let me know what is going on with the radgid and radtabs ajax combination. I'm a noob so im sure i have once setting wrong that is messing the whole thing up.

Thanks for your time.
0
Accepted
Daniel
Telerik team
answered on 10 Feb 2009, 03:17 PM
Hello Chris,

I noticed that my colleague Pavlina  already answered your support ticket. Let us know if you have more questions.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
chris
Top achievements
Rank 1
answered on 10 Feb 2009, 05:34 PM
yes he has responded to the ticket. There is only one more issue and we will be good to go. Thanks for your help
0
Paul
Top achievements
Rank 1
answered on 18 May 2012, 06:50 PM
I'm running into the same issue as this person.  Can you post the resolution to this problem?
0
Richard
Top achievements
Rank 1
answered on 22 May 2012, 07:32 PM
Paul,

Can you duplicate the same behavior in your environment when running this online demo and exporting to CSV?

Also, what version of the RadGrid are you using?

I'd suggest posting your .aspx code so that we can review your settings for possible causes.

Cheers!
0
Paul
Top achievements
Rank 1
answered on 22 May 2012, 07:34 PM
I was able to resolve this issue by rebinding to the data prior to exporting to CSV.
Tags
Grid
Asked by
chris
Top achievements
Rank 1
Answers by
Daniel
Telerik team
chris
Top achievements
Rank 1
Paul
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or