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

Export to Excel GridView

6 Answers 190 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Elver Emilio Cano Cardona
Top achievements
Rank 1
Elver Emilio Cano Cardona asked on 20 Apr 2011, 03:35 PM
Hi.. how are you..

I am exporting a GridView with several columns... one of them is a type checkbox..it's neccesary to chose the rows in the grid.
see attach name "GridViewCheckBox.JPG" and i need export the information in the grid but when i export it.. He put the the field Checkbox like FALSE OR TRUE (see the image "exportexcelgridview.jpg" ) and need that export without this column.. there a option when i am exporting can i chose wich column want to export ?? and i neet to show the column like Checkbox..

Thanks very much..

6 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 20 Apr 2011, 05:26 PM
Hello,

I'll try and answer your questions as I currently understand them.

1: You can export only certain rows on the grid by first filtering the grid based on the criteria you wish to show in the export. For more information on filtering please refer to this help topic. Once you have filtered and exported, you can clear the filters if you wish. In order to use this you need to set:
exporter.HiddenRowOption = HiddenOption.DoNotExport;


2: You can export only certain columns by hiding the columns before export, and showing them again after, and in your export options choose.
exporter.HiddenColumnOption = HiddenOption.DoNotExport;

3: you can format the output as it is being rendered by using the ExcelCellFormatting event.
Please refer to this help topic for more information

I hope that helps but please let me know if you have any questions
Richard
0
Praveena
Top achievements
Rank 1
answered on 22 Nov 2011, 10:23 AM
Hi all,

             I have 3 radgrids in my form. One below the other. Now i have to export all the 3 radgrids data into excel one after the other. Please let me know how to achieve it.
exporter = new ExportToExcelML(this.dgPurpose);
        exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
        exporter.SheetName = "Sheet";
        string fileName = "D:\\ExportedData123.xls";
        exporter.RunExport(fileName);

From the above code one datagrid data is exported. However i am not sure how to export all three radgrid data. Please help me at the earliest

Thanks and Regards,
A.Praveena devi
0
Martin Vasilev
Telerik team
answered on 24 Nov 2011, 06:03 PM
Hello Praveena,

Thank you for writing.

We do not support exporting different RadGridViews into one and the same Excel file. We will include this functionality in one of the future release, if we have more customer requests for the same.

Let me know if you have any other questions.

Kind regards,
Martin Vasilev
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

0
Praveena
Top achievements
Rank 1
answered on 25 Nov 2011, 07:55 AM
Hi Martin,

             I somehow achieved this. What i did is created one datatable which will have all the rows of 3 girds. Then programatically i created radgrid with columns exactly matching to that datatable and rows binded from that datatable. After that i exported that rad grid to excel. Final result is achieved. However i am struck up now with formatting. Is there a way to merge excel cells only for rows (not headers) when we export through excel? If that is not possible atleast can we make wrap text and headers bold when we export to excel from rad grid?

Thanks and Regards,
Praveena
0
Praveena
Top achievements
Rank 1
answered on 28 Nov 2011, 06:02 AM
Hi,

   I have explored and completed on formatting like bold, font size, wrap text, back color and fore color. However i have to do text orientation. Like if there is any any date like 12/12/2010. It should be rotated (say eg -90) text orientation property whch we have in excel. It will be rotated to vertical and appear. Is it possible to achieve. Please reply me at the earliest.

Regards,
Praveena.
0
Ivan Petrov
Telerik team
answered on 30 Nov 2011, 11:13 AM
Hi Praveena,

Thank you for getting back to me.

I am glad you found a work-around for exporting more than one grid into one and the same file and you have found your way through the cell formatting. Unfortunately, our export function does not support cell merge nor changing the text orientation. We will add these features in our list for consideration when we plan our next releases.

Hope this helps. Let me know if you have any other questions.

Greetings,
Ivan Petrov
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Tags
GridView
Asked by
Elver Emilio Cano Cardona
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Praveena
Top achievements
Rank 1
Martin Vasilev
Telerik team
Ivan Petrov
Telerik team
Share this question
or