Home > ASP.NET > How to render report in excel format whenver reportviewer is placed inside updatepanel.

How to render report in excel format whenver reportviewer is placed inside updatepanel.

Whenever we try to keep report viewer in update panel export button of report viewer doest work properly.Whenever you go to child report and try to export ,u will be shocked to see that report exported one is parent report not child report.u cant export child report whenever u try to keep report viewer inside update panel.Solution is try to use custom rendering provide by report viewer ..I.e  u need to keep dropdownlist outside update panel.whenever u select an item in dropdownlist selected index event handling is fired.in tht try to use reportviewer.render() method …… it will return byte array .write those byte on to a file of particular format and use

            Response.ContentType = "application/ms-excel";
            Response.AddHeader("content-disposition", "attachment; filename=report.xls");
            Response.WriteFile()

dont forget to keep reponse.close;

Advertisements
Categories: ASP.NET
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: