CSV Data Export including Column Names as headfer

Stimulsoft Reports.WPF discussion
Post Reply
Paul J
Posts: 2
Joined: Tue Aug 16, 2011 9:04 pm
Location: Melbourne, Australia

CSV Data Export including Column Names as headfer

Post by Paul J »

G'day All,

I've got a very basic report which has two data bands with a table on each. Each table has 15 columns and one row. The first table is intended to be a header for the other table.

When I preview this report in Designer, it's ugly but it works - there's one header row, and lots of "data" rows. However, when I export the report as CVS, the top table gets exported with a new header row, which is the names of the all the columns.

I cannot find a setting which will tell the table or the databand not to export this derived header row. Any suggestions?

Paul J.
Attachments
Example Export.xlsx
Example Export (actually exports as CSV).
(9.29 KiB) Downloaded 230 times
RPT072-13MonthFluctuationsReport.mrt
The Report in question
(37.16 KiB) Downloaded 194 times
Paul J
Posts: 2
Joined: Tue Aug 16, 2011 9:04 pm
Location: Melbourne, Australia

Re: CSV Data Export including Column Names as headfer

Post by Paul J »

OK, I found a partial solution. When exported from the designer with "Skip Column Headers" checked, the report rendered without the column header names.

This report was being rendered in code, so I was able to do the following:

Code: Select all

Dim ExportSettings As StiCsvExportSettings = New StiCsvExportSettings()
ExportSettings.SkipColumnHeaders = True

Dim lFileName As String = IO.Path.Combine(_ReportOutputPath, lServerFileName)

Using f As New System.IO.FileStream(lFileName, System.IO.FileMode.CreateNew, System.IO.FileAccess.Write)
    lExport.ExportCsv(lSTIReport, f, ExportSettings)
    f.Close()

End Using
I was slightly annoyed to discover that I had to use the version of "ExportCsv" that took a Stream instead of a file name. There is no overloaded version of ExportCsv with the signature (Report, Filename, Settings)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: CSV Data Export including Column Names as headfer

Post by HighAley »

Hello.
Paul J wrote:I was slightly annoyed to discover that I had to use the version of "ExportCsv" that took a Stream instead of a file name. There is no overloaded version of ExportCsv with the signature (Report, Filename, Settings)
Unfortunately, we couldn't provide overloaded method on all possible requirements.
We made only most used overloads to satisfy the majority.

Thank you.
Post Reply