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

Set Default Export Type To PDF (Web)

14 Answers 458 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arthur Wu
Top achievements
Rank 1
Arthur Wu asked on 30 Aug 2010, 05:06 AM
Hi~

i have a webpage,and one of the page put a reportviewer in it.

then , i read this http://www.telerik.com/community/forums/reporting/telerik-reporting/set-default-export-from-exportgroup.aspx

this let my viewer can only export one file type ,"PDF"

but, my customer said,if we can only export PDF File.

why should we still have to select a type then export.

is anyway to set the default export type to some type on PageLoad even or ReportViewer's properties? (e.g PDF or XPS )

Thanks.

14 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 01 Sep 2010, 09:22 AM
Hello Arthur Wu,

The Web Report Viewer export UI doesn't offer such customization in the current version, however this is logged in our database as future request. For the time being our suggestion is to hide the viewer's export option and add a simple custom UI with a dropdown or a button that will export to PDF by default. To hide the export options set the Web Report Viewer ShowExportGroup to false.

Check out the How do I display a PDF directly in the browser without exporting first? that elaborates on exporting programmatically.

Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sumit
Top achievements
Rank 1
answered on 25 Jan 2012, 04:05 AM
Hi Peter,

Have you done any updates to address this issue?
(so that default export type can be set to PDF?)

Thanks.
0
Steve
Telerik team
answered on 25 Jan 2012, 10:08 AM
Hi Sumit,

It has not been done yet. Please use the provided workaround for the time being.

Regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Jon
Top achievements
Rank 1
answered on 22 Apr 2013, 03:19 PM
Any progress on this yet?
0
Stef
Telerik team
answered on 25 Apr 2013, 01:15 PM
Hi Jon,

There is no way to select the default export option. Using the described approach in Exporting Report Programmatically help article you can hide the export group from the toolbar and add your own button on the page. If you prefer, you can use javascript to set the selected value of the export group drop-down list.

Let us know if you have any further questions.

All the best,
Stef
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Jon
Top achievements
Rank 1
answered on 25 Apr 2013, 01:29 PM
Hi Stef,

Thanks for the reply.

Did you mean that you can use JS to set the drop down in the existing toolbar or a custom toolbar?  If the existing one is there a sample somewhere?

Regards

Jon
0
Stef
Telerik team
answered on 29 Apr 2013, 12:47 PM
Hi Jon,

Let say you have an ASP.Net Reportviewer control on the page with an ID set to ReportViewer1, then you can use the following javascript to set the desired export option:
<script>
          onload = function () {
              document.getElementById('ReportViewer1_ReportToolbar_ExportGr_FormatList_DropDownList').value = 'PDF';
          }
      </script>

I hope this points you in the right direction.

All the best,
Stef
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Jon
Top achievements
Rank 1
answered on 29 Apr 2013, 01:25 PM
Hi Stef,

Thanks for that.  Almost there with it - the Export button needs to be enabled as well - Looks like something to do with the uxReportViewer_ReportToolbar_ExportGr_Export object....

Regards

Jon
0
Stef
Telerik team
answered on 01 May 2013, 04:28 PM
Hello Jon,

That is correct, you can style the link using its ID as you have to ensure you override the default styles.

Kind regards,
Stef
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Jon
Top achievements
Rank 1
answered on 02 May 2013, 07:44 AM
Hi Stef

Could you possibly give me a JS example of how to do that both for the drop down list and the export button.  

While I can disable the style I'm not exactly sure how to disable and ensure that the correct 'active' class gets applied.

Best Regards

Jon
0
Jon
Top achievements
Rank 1
answered on 02 May 2013, 08:54 AM
Hi again Stef

I've got the below now but still having issues.  This works in Chrome but in IE I have to change the drop down to another value then back again.  I'm guessing that some onclick event needs to be tied up in IE?

onload = function() {
    document.getElementById('uxReportViewer_ReportToolbar_ExportGr_FormatList_DropDownList').value = 'PDF';
    document.getElementById('uxReportViewer_ReportToolbar_ExportGr_Export').className = 'ActiveLink';
}


Also you have a spelling mistake in one of the functions in the JS - StyelExists , guessing that that should be StyleExists :)

Regards

Jon

0
Stef
Telerik team
answered on 06 May 2013, 03:50 PM
Hi Jon,

You need to remove the disabled attribute from the anchor tag of the Export link, e.g.:
document.getElementById('ReportViewer1_ReportToolbar_ExportGr_Export').removeAttribute("disabled");

I hope this helps.

Greetings,
Stef
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Anuradha
Top achievements
Rank 1
answered on 02 Jul 2014, 08:03 AM
Hi Stef ,

Still It doesn't work for IE. Any solution for this...?
0
Stef
Telerik team
answered on 04 Jul 2014, 03:33 PM
Hi Anuradha,

The discussed in this thread approach is a hack as the ASP.NET ReportViewer uses iframes to render its toolbar and different sections. The recommended approach is to switch to the new HTML5 Report Viewer and Reporting REST service, where you can freely modify the template.

In the case of the ASP.NET ReportViewer, the better approach would be to use custom toolbar and your own UI for the export options, where each can be handled with exporting in code.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Arthur Wu
Top achievements
Rank 1
Answers by
Peter
Telerik team
Sumit
Top achievements
Rank 1
Steve
Telerik team
Jon
Top achievements
Rank 1
Stef
Telerik team
Anuradha
Top achievements
Rank 1
Share this question
or