Configure the CSV rendering extension
Implementation:
By default the CSV rendering extension generates plain text files, without any formatting, and the first row contains the headers for all columns (you may choose whether to have this header row or not).
In Telerik Reporting, device information settings are used to pass rendering parameters to a rendering extension. You can specify device information settings in a variety of ways. You can use the <Telerik.Reporting> configuration section to specify rendering parameters globally. Programmatically, you can use the ReportProcessor.RenderReport() method. For more information about specifying rendering parameters globally, see Configuring Telerik Reporting.
The example below shows a sample application configuration file (App.config or Web.config depending on whether it is a Windows Forms or ASP.NET application) in which we modify the original CSV rendering extension settings to generate a CSV file without the header row (NoHeader = True) and all TextBox items that contain static text (not an expression) skipped (NoStaticText = True):
In Telerik Reporting, device information settings are used to pass rendering parameters to a rendering extension. You can specify device information settings in a variety of ways. You can use the <Telerik.Reporting> configuration section to specify rendering parameters globally. Programmatically, you can use the ReportProcessor.RenderReport() method. For more information about specifying rendering parameters globally, see Configuring Telerik Reporting.
The example below shows a sample application configuration file (App.config or Web.config depending on whether it is a Windows Forms or ASP.NET application) in which we modify the original CSV rendering extension settings to generate a CSV file without the header row (NoHeader = True) and all TextBox items that contain static text (not an expression) skipped (NoStaticText = True):
<?xml version="1.0"?> | |||||||||||||||||||||||||||
<configuration> | |||||||||||||||||||||||||||
<!-- The configSectins element should be the first child element of configuration --> | |||||||||||||||||||||||||||
<configSections> | |||||||||||||||||||||||||||
<!-- Substitute Version=X.X.X.X with the assembly version you are using! --> <section | |||||||||||||||||||||||||||
name="Telerik.Reporting" | |||||||||||||||||||||||||||
type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=X.X.X.X, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" | |||||||||||||||||||||||||||
allowLocation="true" | |||||||||||||||||||||||||||
allowDefinition="Everywhere"/> | |||||||||||||||||||||||||||
</configSections> | |||||||||||||||||||||||||||
<Telerik.Reporting> | |||||||||||||||||||||||||||
<Extensions> | |||||||||||||||||||||||||||
<Render> | |||||||||||||||||||||||||||
<Extension name="CSV"> | |||||||||||||||||||||||||||
<Parameters> | |||||||||||||||||||||||||||
<Parameter name="NoHeader" value="true"/> | |||||||||||||||||||||||||||
<Parameter name="NoStaticText" value="true"/> | |||||||||||||||||||||||||||
</Parameters> | |||||||||||||||||||||||||||
</Extension> | |||||||||||||||||||||||||||
</Render> | |||||||||||||||||||||||||||
</Extensions> | |||||||||||||||||||||||||||
</Telerik.Reporting> | |||||||||||||||||||||||||||
</configuration> If the report exported with default settings looked like this:
With the given device information you will get:
|
Source: Configuring the CSV Rendering Extension
No comments:
Post a Comment