From 548701f423e6580cf174055bdeacbc9ec50c0d96 Mon Sep 17 00:00:00 2001 From: KB Bot Date: Thu, 20 Nov 2025 13:12:39 +0000 Subject: [PATCH 1/5] Added new kb article adjusting-currency-formatting-csv-export-reporting --- ...urrency-formatting-csv-export-reporting.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 knowledge-base/adjusting-currency-formatting-csv-export-reporting.md diff --git a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md new file mode 100644 index 000000000..a27238837 --- /dev/null +++ b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md @@ -0,0 +1,82 @@ +--- +title: Adjusting Currency Formatting for CSV Export in Telerik Reporting +description: Learn how to ensure numeric values are recognized correctly when exporting reports with currency formatting to CSV in Telerik Reporting. +type: how-to +page_title: Handling Currency Formatting for CSV Export in Reporting +meta_title: Handling Currency Formatting for CSV Export in Reporting +slug: adjusting-currency-formatting-csv-export-reporting +tags: reporting, csv, export, currency formatting, textbox, format property, reportprocessor +res_type: kb +ticketid: 1703567 +--- + +## Environment + + + + + + + + + + + + +
ProductReporting
Version19.3.25.1111
+ +## Description + +When exporting reports to CSV with the ReportProcessor class in Telerik Reporting, currency values formatted using a TextBox's `Format` property (e.g., `"{0:C2}"`) include group separators and currency symbols. This formatting prevents Excel from recognizing the exported values as numbers. Contrary to expectations, the CSV rendering extension respects the `Format` property of report items, which is intentional behavior. Adjusting the `Culture` object does not resolve this issue due to changes in the report processing pipeline. + +This knowledge base article also answers the following questions: +- How to export reports to CSV with numeric values in Reporting? +- How to remove currency formatting for CSV export in Reporting? +- How to handle Excel numeric recognition for exported CSV reports? + +## Solution + +To ensure numeric values are recognized correctly in CSV export, programmatically remove the `Format` property from the relevant TextBox items before exporting the report. Follow these steps: + +1. Locate the TextBox items in the report. +2. Clear the `Format` property of the TextBox items programmatically before the export operation. + +Here is an example implementation: + +```csharp +private void GenerateReport(string format) +{ + // Check if the export format is CSV + if (format == "CSV") + { + // Locate the specific TextBox item + var textBox = report.Items.Find("textBox2", true).FirstOrDefault(); + if (textBox is Telerik.Reporting.TextBox textBox2) + { + // Clear the Format property + textBox2.Format = null; + } + + // Optional: Clear formatting for all TextBox items in the report + var textBoxItems = report.Items.Find(typeof(Telerik.Reporting.TextBox), true).ToList(); + foreach (var item in textBoxItems) + { + if (item is Telerik.Reporting.TextBox textBoxItem) + { + textBoxItem.Format = null; + } + } + } + + // Proceed with report generation logic + ... +} +``` + +This approach removes formatting applied to the TextBox items, ensuring the exported CSV contains raw numeric values. + +## See Also + +- [CSV Rendering Design Considerations](https://docs.telerik.com/reporting/styling/rendering-and-paging/design-considerations-for-report-rendering/csv-rendering-design-considerations) +- [Telerik Reporting TextBox Documentation](https://docs.telerik.com/reporting/api/html/T_Telerik_Reporting_TextBox.htm) +- [How to Export Reports Programmatically](https://docs.telerik.com/reporting/programmatic-reporting/exporting-reports-programmatically) From 8ede669dbe2a2d9760b3146a2ffa4247e0049a54 Mon Sep 17 00:00:00 2001 From: IvetNikolova <118352332+IvetNikolova@users.noreply.github.com> Date: Thu, 20 Nov 2025 15:26:54 +0200 Subject: [PATCH 2/5] Update adjusting-currency-formatting-csv-export-reporting.md --- ...urrency-formatting-csv-export-reporting.md | 74 ++++++++----------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md index a27238837..dc9a18a76 100644 --- a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md +++ b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md @@ -1,6 +1,6 @@ --- -title: Adjusting Currency Formatting for CSV Export in Telerik Reporting -description: Learn how to ensure numeric values are recognized correctly when exporting reports with currency formatting to CSV in Telerik Reporting. +title: Adjusting Currency Formatting for CSV Export +description: Learn how to ensure numeric values are recognized correctly when exporting reports with currency formatting to CSV type: how-to page_title: Handling Currency Formatting for CSV Export in Reporting meta_title: Handling Currency Formatting for CSV Export in Reporting @@ -13,70 +13,58 @@ ticketid: 1703567 ## Environment - - - - - - - - - - + + + + + + + + + +
ProductReporting
Version19.3.25.1111
ProductReporting
Version19.3.25.1111
## Description -When exporting reports to CSV with the ReportProcessor class in Telerik Reporting, currency values formatted using a TextBox's `Format` property (e.g., `"{0:C2}"`) include group separators and currency symbols. This formatting prevents Excel from recognizing the exported values as numbers. Contrary to expectations, the CSV rendering extension respects the `Format` property of report items, which is intentional behavior. Adjusting the `Culture` object does not resolve this issue due to changes in the report processing pipeline. - -This knowledge base article also answers the following questions: -- How to export reports to CSV with numeric values in Reporting? -- How to remove currency formatting for CSV export in Reporting? -- How to handle Excel numeric recognition for exported CSV reports? +When exporting reports to CSV with the ReportProcessor class in Telerik Reporting, currency values formatted using a [TextBox]({%slug telerikreporting/designing-reports/report-structure/textbox%})'s `Format` property (e.g., `"{0:C2}"`) include group separators and currency symbols. This formatting prevents Excel from recognizing the exported values as numbers. Contrary to expectations, the CSV rendering extension respects the `Format` property of report items, which is intentional behavior. Adjusting the `Culture` object does not resolve this issue due to changes in the report processing pipeline. ## Solution To ensure numeric values are recognized correctly in CSV export, programmatically remove the `Format` property from the relevant TextBox items before exporting the report. Follow these steps: 1. Locate the TextBox items in the report. -2. Clear the `Format` property of the TextBox items programmatically before the export operation. +1. Clear the `Format` property of the TextBox items programmatically before the export operation. Here is an example implementation: ```csharp -private void GenerateReport(string format) -{ - // Check if the export format is CSV - if (format == "CSV") - { - // Locate the specific TextBox item - var textBox = report.Items.Find("textBox2", true).FirstOrDefault(); - if (textBox is Telerik.Reporting.TextBox textBox2) - { - // Clear the Format property - textBox2.Format = null; - } - // Optional: Clear formatting for all TextBox items in the report - var textBoxItems = report.Items.Find(typeof(Telerik.Reporting.TextBox), true).ToList(); - foreach (var item in textBoxItems) + private void GenerateReport(string format) { - if (item is Telerik.Reporting.TextBox textBoxItem) + ... + if (format == "CSV") { - textBoxItem.Format = null; + var textBox2 = report.Items.Find("textBox2", true).FirstOrDefault(); + (textBox2 as Telerik.Reporting.TextBox).Format = null; } + ... } - } - // Proceed with report generation logic - ... -} +``` + +To apply this approach to multiple textbox items in similar scenarios, modify the code that locates the items as needed. For example: + +```csharp + +var textBoxItems = report.Items.Find(typeof(Telerik.Reporting.TextBox), true).ToList(); + ``` This approach removes formatting applied to the TextBox items, ensuring the exported CSV contains raw numeric values. ## See Also -- [CSV Rendering Design Considerations](https://docs.telerik.com/reporting/styling/rendering-and-paging/design-considerations-for-report-rendering/csv-rendering-design-considerations) -- [Telerik Reporting TextBox Documentation](https://docs.telerik.com/reporting/api/html/T_Telerik_Reporting_TextBox.htm) -- [How to Export Reports Programmatically](https://docs.telerik.com/reporting/programmatic-reporting/exporting-reports-programmatically) +* [CSV Rendering Design Considerations]({%slug telerikreporting/designing-reports/rendering-and-paging/design-considerations-for-report-rendering/csv-rendering-design-considerations%}) +* [TextBox Report Item Overview]({%slug telerikreporting/designing-reports/report-structure/textbox%}) +* [Device Information Settings for the CSV rendering format]({%slug telerikreporting/using-reports-in-applications/export-and-configure/configure-the-export-formats/csv-device-information-settings%}) From e4ece4ec53b39ea52b1db0bb85c083ff0d414657 Mon Sep 17 00:00:00 2001 From: Todor Arabadzhiev Date: Thu, 20 Nov 2025 17:54:32 +0200 Subject: [PATCH 3/5] Update adjusting-currency-formatting-csv-export-reporting.md --- ...urrency-formatting-csv-export-reporting.md | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md index dc9a18a76..01b26de4e 100644 --- a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md +++ b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md @@ -18,10 +18,6 @@ ticketid: 1703567 Product Reporting - - Version - 19.3.25.1111 - @@ -38,28 +34,24 @@ To ensure numeric values are recognized correctly in CSV export, programmaticall Here is an example implementation: -```csharp - - private void GenerateReport(string format) - { - ... - if (format == "CSV") - { - var textBox2 = report.Items.Find("textBox2", true).FirstOrDefault(); +````CSharp +private void GenerateReport(string format) +{ + //... + if (format == "CSV") + { + var textBox2 = report.Items.Find("textBox2", true).FirstOrDefault(); (textBox2 as Telerik.Reporting.TextBox).Format = null; - } - ... - } - -``` + } + //... +} +```` To apply this approach to multiple textbox items in similar scenarios, modify the code that locates the items as needed. For example: -```csharp - +````CSharp var textBoxItems = report.Items.Find(typeof(Telerik.Reporting.TextBox), true).ToList(); - -``` +```` This approach removes formatting applied to the TextBox items, ensuring the exported CSV contains raw numeric values. From c8edfff289e07499933a30fa2fc1779ea62d0fc5 Mon Sep 17 00:00:00 2001 From: IvetNikolova <118352332+IvetNikolova@users.noreply.github.com> Date: Tue, 9 Dec 2025 16:36:44 +0200 Subject: [PATCH 4/5] Update adjusting-currency-formatting-csv-export-reporting.md --- ...sting-currency-formatting-csv-export-reporting.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md index 01b26de4e..8fedcdabc 100644 --- a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md +++ b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md @@ -27,7 +27,17 @@ When exporting reports to CSV with the ReportProcessor class in Telerik Reportin ## Solution -To ensure numeric values are recognized correctly in CSV export, programmatically remove the `Format` property from the relevant TextBox items before exporting the report. Follow these steps: +To ensure numeric values are recognized correctly in CSV export, programmatically remove the `Format` property from the relevant TextBox items before exporting the report. The following examples demonstrate different approaches to resolving this issue: + +Example 1: + +Consider using data binding for the `Format` property: + +``` += RenderingFormat.Name = "CSV" ? Null : "{0:C2}" +``` + +Example 2: 1. Locate the TextBox items in the report. 1. Clear the `Format` property of the TextBox items programmatically before the export operation. From e5e5e01999321046838db0ad831da0d3fd164ddd Mon Sep 17 00:00:00 2001 From: Todor Arabadzhiev Date: Thu, 11 Dec 2025 17:23:14 +0200 Subject: [PATCH 5/5] Update adjusting-currency-formatting-csv-export-reporting.md --- .../adjusting-currency-formatting-csv-export-reporting.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md index 8fedcdabc..00a9f4299 100644 --- a/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md +++ b/knowledge-base/adjusting-currency-formatting-csv-export-reporting.md @@ -33,9 +33,7 @@ Example 1: Consider using data binding for the `Format` property: -``` -= RenderingFormat.Name = "CSV" ? Null : "{0:C2}" -``` +`= RenderingFormat.Name = "CSV" ? Null : "{0:C2}"` Example 2: