I have bind one 25 record rows report programmatically.
Report display well.
When I select export to CSV file using direct report viewer, csv file get generated but it has double number of columns.
First shows columns with all rows with source dataset table column names and then data name.
I have attached sample image file.
See the gray back ground columns are extra columns.
Please provide me help on how to remove these unwanted primary columns.
18 Answers, 1 is accepted
We have a KB article on Configuring the CSV Rendering Extension which explains how to remove the static text in your report.
Write us if you need further assistance.
Best wishes,
Milen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thank you for the help
I have followed steps given in KB article to remove extra columns from csv file, while rendering the report Following server error generated
Line 10: <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> Line 11: <configSections> Line 12: <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=3.2.9.1104, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" /> Line 13: </configSections> Line 14: <Telerik.Reporting>
I have checked system registry entries for Fusion EnableLog DWORD =1, it is there,
Please let me know is any other way eliminate this error.
Thank you in advanced
You have not used the code from the KB article we have referenced, as in the Telerik Reporting section, the Telerik.Reporting.Processing.Config.ReportingConfigurationSection type is loaded from the Telerik.Reporting.dll assembly and not from Telerik.Reporting.Processing. Please copy the given code in the KB article as it is without any changes, excluding the version number of the assemblies of course.
Regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I have used same code from KB artical. And added version number as 3.2.9.1104 (my current evalualtion copy version)
The code is given below
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> |
<configSections> |
<section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=3.2.9.1104, 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> |
<!-- other code on file --> |
</configuration> |
Please advice.
It seems that you have not read my previous reply carefully, namely:
wrong
<section name="Telerik.Reporting"
type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=3.2.9.1104, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" />
should be
correct
<section name="Telerik.Reporting"
type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=3.2.9.1104, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" />
The KB article references the correct code and not the one you have pasted!
Best wishes,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Hello Steve,
I apologies, that was my mistake while writing code. I have corrected and it is working fine now.
Thank you again.
I have bind one 3 record rows report programmatically. Report display well.
I have implemented on Configuring the CSV Rendering Extension .When I select export to CSV file using direct report viewer, csv file get generated but it has double number of columns.But same error will be occurred.
I tried adding the csv extension configuration section.
But unfortunately this doesn't work as wanted because our label text boxes contain the expression "=GetLocalString(.....)" for localized labels.
How to get localized labels without having them in the csv export? And why are the headers of the report on each data line in csv?
if they'd be only on the first line this would make sense and not be a problem.
I'd suggest that each text box should be configurable if it shall be in the csv export or not.
You can configure the viewer in your application or ReportProcessor to export in CSV format without Static Text (NoStaticText). For the purpose extend the start application configuration and:
- Add the device settings for all viewer's in the project;
- Set the device info for the ReportProcessor only (check Extensions Element)
More details about the CSV rendering can be found in the Design Considerations for CSV Rendering.
In general, this is data rendering and the purpose is to export the data as it is visualized - including labels(TextBox items showing some not expression text) and flatten data(which is why group headers data is repeated).
Note that you can export the meaningful for you data without using the reporting engine by creating s simple stream with the concatenated values.
Regards,
Stef
Telerik
New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.
Note that you can export the meaningful for you data without using the reporting engine by creating s simple stream with the concatenated values.
[/quote]
Can you go in to more depth on how to create this simple stream?
You can add custom UI e.g. button to start the data export. The export will not use the reporting engine, instead it should:
- Read the data assigned to the report - use the same data retrieval method as in the report;
- Serialize the data in properly formatted string, which finally can be written in a TXT, CSV or other type of file;
If you prefer to use the reporting engine and its CSV extension, the final document will contain a description of the visible report layout with the assigned to it data.
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.
Below is a quote from my last post in your support ticket on the same topic:
"The HTML template of the viewer is provided with your Telerik Reporting installation under C:\Program Files (x86)\Telerik\Reporting R2 2016\Html5\ReportViewer\templates - Installation Directories. You can modify the HTML file and add it in the project's structure. then set the viewer's templateUrl to the address of the HTML file.
...
Please note that customizing the HTML file would mean manual upgrade and merge of the viewer's HTML file.
...
"
You can add/remove HTML elements, modify them to have attributes helping you to find them via CSS selectors and etc.
Regards,
Stef
Telerik by Progress
This is very strange that when i export to excel the column headers are working fine , but the same is not working when i export to CSV file ???
The result CSV will not include only the data bound to the report. The CSV rendering mechanism aims to export the report structure and the data visualized by the corresponding items - Design Considerations for CSV Rendering.
The settings you can control are whether to have a header with items Name properties' values, or static content of TextBox items' not visualizing fields of the assigned data - CSV Device Information Settings.
In case you need to export only the data displayed by the report, you will need to add custom logic for reading the data and saving it as text in a CSV file without the reporting engine.
Regards,
Stef
Telerik by Progress
It took me way too long to get this working but I finally got it. I understand that in some situations hierarchical/grouped data needs to be flattened to show in a CSV but all I had was a simple table with no groups and it's far too complicated to get this to export as expected. For reference I had 3 columns: ColumnA, ColumnB, and ColumnC and when they exported I was getting:
textbox4 textbox5 textbox6 textbox7 textbox8 textbox9
ColumnA DataXXX ColumnB DataXYX ColumnC DataXYZ
ColumnA DataYYY ColumnB DataYXY ColumnC DataYXZ
ColumnA DataZZZ ColumnB DataZXY ColumnC DataZYX
... ... ... ... ... ...
When I ended up with was:
ColumnA ColumnB ColumnC
DataXXX DataXYX DataXYZ
DataYYY DataYXY DataYXZ
DataZZZ DataZXY DataZYX
... ... ...
To get here I:
- Went into Telerik Report Designer and in the Report Explorer panel I clicked on the top level node.
- Under the behavior section I clicked on the ... button for RuntimeSettings.
- I added a Member and set the Name property to CSV and the Description to CSV (comma delimited)
- I clicked the ... button next to Parameters for the member and created a new parameter called NoStaticText with a Parameter Value of true
- I then went to my table in the Report Explorer tree and renamed the textboxes that show the data (not the textboxes for the headers) ColumnA, ColumnB, ColumnC, etc
The fact that this pretty basic formatting change is not easier or better documented is an issue.
I have done the following
<Extension name="CSV">
<Parameters>
<Parameter name="NoHeader" value="true"/>
<Parameter name="NoStaticText" value="true"/>
</Parameters>
</Extension>
yet the csv rendering displays with double the no. of columns. Any other method to solve this
Hi Darshan,
The applied settings would remove the headers (items' names) and the static values (values that are not Expressions). Here are some links that may be useful:
You may also consider a custom rendering extension.