Setting the default CSV Separator for exports

Stimulsoft Reports.JS discussion
Post Reply
compuaid
Posts: 14
Joined: Mon Aug 22, 2022 3:30 pm

Setting the default CSV Separator for exports

Post by compuaid »

Is there a way in Stimulsoft Reports.JS to set the default CSV separator to comma rather than semi-colon? We would like for our users to not have to remember to change the setting to a comma when they choose to export Data from the Stimulsoft Viewer.
compuaid
Posts: 14
Joined: Mon Aug 22, 2022 3:30 pm

Re: Setting the default CSV Separator for exports

Post by compuaid »

I found the answer to this using ChatGPT! Here is the code it provided:

Code: Select all

// Create an instance of the CSV export settings
var csvSettings = new Stimulsoft.Report.Export.StiCsvExportSettings();

// Set the separator character to a comma(,)
csvSettings.separator = ',';

// Assign the CSV export settings to the report
report.exportSettings = csvSettings;

Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Setting the default CSV Separator for exports

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply