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

Windowed opened on export of reportviewer

2 Answers 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 03 Sep 2009, 02:47 PM
Does anyone know of a way to prevent the opening of a browser window on export? Basically you click on the export link and it opens a new window which in turn opens acrobat. So then you have to close acrobat and then close the blank window opened by the reportviewer control.  This behavior does not seem to exist when adding an export button to the grid.

Current behavior: http://demos.telerik.com/reporting/sales-dashboard/demo.aspx
Desired behavior: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx

2 Answers, 1 is accepted

Sort by
0
Accepted
Chavdar
Telerik team
answered on 03 Sep 2009, 03:56 PM
Hi Robert Gayo,

This behavior of the report viewer is by design. To override it you can use the following javascript code:

    <script type="text/javascript"
        ReportViewer.prototype.ExportInternal = function(format, pageIndex) { 
            var url = this.baseExportUrl + "&ExportFormat=" + format; 
            window.open(url, "_self"); 
        } 
    </script> 

You can place it right after the report viewer's definition.

Best wishes,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Robert
Top achievements
Rank 1
answered on 03 Sep 2009, 05:55 PM
Thanks... that does the trick.
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Robert
Top achievements
Rank 1
Share this question
or