Export to Excel GridView

7 posts, 0 answers
  1. Elver Emilio Cano Cardona
    Elver Emilio Cano Cardona avatar
    25 posts
    Member since:
    Dec 2009

    Posted 20 Apr 2011 Link to this post

    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..
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 20 Apr 2011 Link to this post

    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
  3. Praveena
    Praveena avatar
    3 posts
    Member since:
    Feb 2011

    Posted 22 Nov 2011 Link to this post

    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
  4. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 24 Nov 2011 Link to this post

    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.

  5. Praveena
    Praveena avatar
    3 posts
    Member since:
    Feb 2011

    Posted 25 Nov 2011 Link to this post

    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
  6. Praveena
    Praveena avatar
    3 posts
    Member since:
    Feb 2011

    Posted 28 Nov 2011 Link to this post

    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.
  7. Ivan Petrov
    Admin
    Ivan Petrov avatar
    705 posts

    Posted 30 Nov 2011 Link to this post

    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.

Back to Top