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

ShowGridlines device setting for C# window form application

5 Answers 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
LIOW
Top achievements
Rank 1
LIOW asked on 23 Apr 2012, 11:01 AM
 Since the excel grid lines are shown or not is controlled via the ShowGridlines device setting. Is there any sample code for C#? I have no idea how to configure even after read the following articles:



5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 23 Apr 2012, 11:33 AM
Hi LIOW,

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 >

0
LIOW
Top achievements
Rank 1
answered on 24 Apr 2012, 02:36 AM
Hi Steve,

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
0
Steve
Telerik team
answered on 24 Apr 2012, 09:22 AM
Hello 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 >

0
Nauman
Top achievements
Rank 1
answered on 28 Aug 2014, 12:51 PM
Hello Steve,

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



0
Stef
Telerik team
answered on 01 Sep 2014, 01:33 PM
Hello Nauman,

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.

 
Tags
General Discussions
Asked by
LIOW
Top achievements
Rank 1
Answers by
Steve
Telerik team
LIOW
Top achievements
Rank 1
Nauman
Top achievements
Rank 1
Stef
Telerik team
Share this question
or