5 Answers, 1 is accepted
There is a C# sample code at the bottom of the Telerik Reporting Configuration Section help article that shows how to define a device setting and use it as argument in the RenderReport method of the report.
Regards,
Steve
the Telerik team
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >
Where should i place the code block in order to change the default action of predefined export function of the reportViewer itself? Is it under below function?
private void reportViewer1_Export(object sender, Telerik.ReportViewer.WinForms.ExportEventArgs args) { } Please advice. Regards, Liow
The best place to alter the predefined behavior of a rendering extension is the configuration file of your application. The C# code you asked about is only useful if you export the reports programmatically, whenever you're using the report viewers to show a report and export from it, you should add the device setting info in the application configuration file as per the help articles you've referenced in your first post:
i.e. you need to add the following:
<
configSections
>
<
section
name
=
"Telerik.Reporting"
type
=
"Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=6.0.12.215, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
allowLocation
=
"true"
allowDefinition
=
"Everywhere"
/>
</
configSections
>
<
Telerik.Reporting
>
<
Extensions
>
<
Render
>
<
Extension
name
=
"XLSX"
>
<
Parameters
>
<
Parameter
name
=
"ShowGridlines"
value
=
"true"
/>
</
Parameters
>
</
Extension
>
</
Render
>
</
Extensions
>
</
Telerik.Reporting
>
Note the above setting is for the OpenXML format (.xlsx), should you need this to apply to the Excel 97-2003 format as well (.xls), add the same for the XLS extension. Regards,
Steve
the Telerik team
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >
I have put your piece of code in my app.config, but there seems no change in export to xlsx file, its still showing me the 'export 97-2003' with .xls extension.
I am using
1. Telerik Version 8.0.14.225 Q1 2014
2. DocumentFormat.OpenXml Version 2.0.5022.0
I am stuck with the same default behavior of Telerik Report Viewer.
Your Help will be appreciated,
Regards,
Nauman Usmani
Please refer to my post in the following forum thread: Missing export formats.
If you have further questions, let us continue the discussion in the above linked thread.
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.