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
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.
Peter
the Telerik team
Have you done any updates to address this issue?
(so that default export type can be set to PDF?)
Thanks.
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!
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.
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
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.
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
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.
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
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
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.
Still It doesn't work for IE. Any solution for this...?
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.