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

Exporting chart along with Grid

1 Answer 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
VEDA VIDVA NARAYANAN SATTANATHAN
Top achievements
Rank 1
VEDA VIDVA NARAYANAN SATTANATHAN asked on 22 Dec 2008, 06:59 AM
Hi,

I have two controls in a page
1. Chart Control
2. Grid control
I want to export both chart  and grid control to PDF or Excel format when exporting the data.
So that both the chart and grid are in the same file that is exported. Is there any way to do it?

I also have implemented custom paging in grid so that only the records equal to page size is fetched from the database each time the page index is changed. Is there a way to apply all the formatting (grouping, filtering,sorting) done by user on all the records when it is exported from grid.

Regards
Veda

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 22 Dec 2008, 09:44 AM
Hello VEDA VIDVA NARAYANAN SATTANATHAN,

About the Excel export of both controls:
Unfortunately this scenario is not supported. Each of RadGrid and RadChart has exporting methods, that concern only itself and no outer controls can be involved. You can use RadGrid tableview's ExportToExcel / ExportToWord methods and RadChart's Save method to export the controls separately and then you will need to additionally manipulate the files so that the image is added to RadGrid export.

About the PDF export of both controls:
I am afraid this scenario is not supported. The chart image is served by a http handler and this is not supported by RadGrid export mechanism.

I have notified our developers for this scenario, so they will consider providing support for it in a future version of RadControls. Please, accept our apologies for the inconvenience caused. Your Telerik points have been updated.

You can use the following workaround -- define a regular asp:Image control next to the chart. In ItemDataBound event of the grid call RadChart.Save method to save the chart as image, set the image's ImageUrl property to that image and hide the chart. This way RadGrid will have to export images and this scenario is supported out of the box.

Regarding your question about RadGrid custom paging and export:
I think that the approach presented in this topic from the documentation can help you in the development:
http://www.telerik.com/help/aspnet-ajax/grdexport.html (search for 'Export with custom paging')

Kind regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
VEDA VIDVA NARAYANAN SATTANATHAN
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or