Tag property & export to CSV
Tag property & export to CSV
Hello,
I started to use StimulSoft few weeks ago, with C# and BO.
Now I try to generate an export to CSV format. But I have a problem: when the file was generated, the first line contains: "Table_Cell5,Table_Cell6,Table_Cell7,Table_Cell8" and not my header (create with anothers Table_Cell).
So how can I have the header into the first line of my CSV file ?
I found this: http://forum.stimulsoft.com/viewtopic.php?t=649
But here, the Tag property is used and I don't know how to change it with the Designer. Can you explain me how to do, please ?
Thanks in advance for your help !
I started to use StimulSoft few weeks ago, with C# and BO.
Now I try to generate an export to CSV format. But I have a problem: when the file was generated, the first line contains: "Table_Cell5,Table_Cell6,Table_Cell7,Table_Cell8" and not my header (create with anothers Table_Cell).
So how can I have the header into the first line of my CSV file ?
I found this: http://forum.stimulsoft.com/viewtopic.php?t=649
But here, the Tag property is used and I don't know how to change it with the Designer. Can you explain me how to do, please ?
Thanks in advance for your help !
Re: Tag property & export to CSV
Hello,
By default in Csv, Dbf and Xml exports only textboxes from DataBand are exported ("only data"). The default name of column corresponds to the name of the textbox.
If you want another name of column, you should rename textbox or write in the Tag property of textbox the following expression:Please check the screenshot in attachment for information how to set the Tag property of the component.
If you use the version 2015.2 or later, you also can do the following workaround:
In the export settings menu you can set the "Bands Filter" property to the "Data and Headers/Footers", and check the "Skip Column Headers" option.
Now text from header will be exported as column headers.
Thank you.
By default in Csv, Dbf and Xml exports only textboxes from DataBand are exported ("only data"). The default name of column corresponds to the name of the textbox.
If you want another name of column, you should rename textbox or write in the Tag property of textbox the following expression:
Code: Select all
CSV: "NameCsv"; DBF: "NameDBF"; XML: "NameXml"; Default: "NameDefaultForCsvAndDbfAndXml";
If you use the version 2015.2 or later, you also can do the following workaround:
In the export settings menu you can set the "Bands Filter" property to the "Data and Headers/Footers", and check the "Skip Column Headers" option.
Now text from header will be exported as column headers.
Thank you.
- Attachments
-
- export_settings.png (27.59 KiB) Viewed 5026 times
-
- tag_property.png (167.03 KiB) Viewed 5026 times
Re: Tag property & export to CSV
Hello Ivan,
Thanks a lot for your help !
I cannot use the second method beacause I use the 2014 3.0 version. But the first method works fine ! Thanks to show me where I can edit Tag property, it's very useful.
During testing, I found a problem with this method: Report.ExportDocument(StiCsvExportService, string)
When I try to use this method, I have an exception: The incorrect type of the settings argument is used. The StiCsvExportSettings is need to be used.
Is it a bug ? Or I don't well using this methods ?
Thanks again for your help.
Thanks a lot for your help !
I cannot use the second method beacause I use the 2014 3.0 version. But the first method works fine ! Thanks to show me where I can edit Tag property, it's very useful.
During testing, I found a problem with this method: Report.ExportDocument(StiCsvExportService, string)
When I try to use this method, I have an exception: The incorrect type of the settings argument is used. The StiCsvExportSettings is need to be used.
Is it a bug ? Or I don't well using this methods ?
Code: Select all
Stimulsoft.Report.StiReport report = this.stiDesignerControl.Report;
report.Render(true);
// Get filepath
string filepath = GetFilePath("CSV File|*.csv");
// Export document
StiCsvExportService service = new StiCsvExportService();
report.ExportDocument(service, filepath);
// Open document
System.Diagnostics.Process.Start(filepath);
Re: Tag property & export to CSV
Hello,
Please try to check the last build and let us know about the result.
Thank you.
Please try to check the last build and let us know about the result.
Thank you.
Re: Tag property & export to CSV
Hello Aleksey,
Thank you for your reply. Unfortunately, I think I just have a licence, not a subscription.
Thanks.
Thank you for your reply. Unfortunately, I think I just have a licence, not a subscription.
Thanks.
Re: Tag property & export to CSV
Hello,
Please try to modify your code:
Thank you.
Please try to modify your code:
Code: Select all
// Export document
StiCsvExportSettings settings = new StiCsvExportSettings();
rep.ExportDocument(StiExportFormat.Csv, filepath, settings);
Re: Tag property & export to CSV
Hello Ivan,
Thanks for your reply.
Your code works but user cannot edit setting like with StiCsvExportService. Or I can use StiCsvExportService bialog box to get a StiCsvExportSettings?
Thanks for your help (and sorry for this later answer).
Thanks for your reply.
Your code works but user cannot edit setting like with StiCsvExportService. Or I can use StiCsvExportService bialog box to get a StiCsvExportSettings?
Thanks for your help (and sorry for this later answer).
Re: Tag property & export to CSV
Hello.
Yes, please, try to use next code to export the report:
Thank you.
Yes, please, try to use next code to export the report:
Code: Select all
StiCsvExportService service = new StiCsvExportService();
service .Export(report, filepath);
Re: Tag property & export to CSV
Hello HighAley,
Thanks for your help.
Unfortunately I have the same error with this code: The incorrect type of the 'settings' argument is used. The StiCsvExportSettings is need to be used.
Thanks for your help.
Unfortunately I have the same error with this code: The incorrect type of the 'settings' argument is used. The StiCsvExportSettings is need to be used.
Re: Tag property & export to CSV
Hello,
The issue is fixed in the last build. Please try to check the build 2016.1.8 from 2016.04.15.
Thank you.
The issue is fixed in the last build. Please try to check the build 2016.1.8 from 2016.04.15.
Thank you.