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

Export to PDF, CSV etc

4 Answers 106 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Kalyani
Top achievements
Rank 1
Kalyani asked on 17 Mar 2014, 06:15 PM
I have a rad pivot grid and I am trying to export the grid to pdf and csv.  I am able to export it to excel.   Is there a work around to get it exported to other formats.  Would appreciate any suggestions you might have.

I tried this for .csv  but I am unable to get any data.  

protected void btnExportCSV_Click(object sender, EventArgs e)
 {
  Response.Clear();
  Response.Buffer = true;
  Response.AddHeader("content-disposition",
   "attachment;filename=GridViewExport.csv");
  Response.Charset = "";
  Response.ContentType = "application/text";

  RadPivotGrid1.AllowPaging = false;
  RadPivotGrid1.DataBind();

  StringBuilder sb = new StringBuilder();
  for (int i = 0; i < RadPivotGrid1.Fields.Count; i++)
  {   
    //add separator
   sb.Append(RadPivotGrid1.Fields[i].ToString() + ',');
   }
   //append new line
   sb.Append("\r\n");
   lblTest.Text = sb.ToString();
  Response.Output.Write(sb.ToString());
  Response.Flush();
  Response.End();
 }

I think I am not doing this right?  What is the best way to loop through the cells in a pivot grid and get data.  
  for (int i = 0; i < RadPivotGrid1.Fields.Count; i++)
  {   
    //add separator
   sb.Append(RadPivotGrid1.Fields[i].ToString() + ',');
   }

Thanks

4 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 20 Mar 2014, 12:56 PM
Hi Kalyani,

I am afraid that RadPivotGrid could be exported only to Excel at the moment.

Regards,
Kostadin
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
nagaraju
Top achievements
Rank 1
answered on 16 Feb 2015, 06:37 AM
Hi Kostadin,

when we can expect RadPivotGrid Exporting to PDF.

Thank you
0
Kostadin
Telerik team
answered on 18 Feb 2015, 02:29 PM
Hello Nagaraju,

I am afraid I can not provide you with a specific time frame but if export to PDF is available it will be announced in Telerik web site.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
nagaraju
Top achievements
Rank 1
answered on 09 Jul 2015, 06:47 AM

 

Thank you Kostadin  :)

Tags
PivotGrid
Asked by
Kalyani
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
nagaraju
Top achievements
Rank 1
Share this question
or