Tab instead of spaces

Discussion forum about all things Report Builder (all versions).
jdurban
Germany
Posts: 54
Joined: 09 Oct 2018, 09:30
Location: Karlsruhe, Germany

Tab instead of spaces

Post by jdurban » 25 Jan 2021, 11:05

Hi,
user wants a given report as a csv file. But not only data, things like sum should be included, too.
There is a optionto create a ascii file but in this file the the items/fields/text are not separated wigh tabs, spaces are used.
This prevents the user to open the file in Excel and do something. E.g. a line in the file looks like:
text1.........text1........10
(dots are for space)
I want:
text1<tab>text2<tab>10
(<tab> is for the tab char).

Is it possible to replace somewhere the sapces with a tab without changing the report (even with changing the report I see no option).

My solution now would be to jump into the SAM_Report* action, catch the data and print it to a file. But thinks like sum of a break group I had to do myself, I can't catch the sum on application site.

thanks and best regards
Jürgen

User avatar
Charlie
Canada
Posts: 640
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: Tab instead of spaces

Post by Charlie » 25 Jan 2021, 18:43

G'day Jürgen,

For the system I supported, I really did not like the headache of exporting a report to CSV because of the problem with values calculated by the report template.

I wound up creating a standard window class for reports, a cStdReport class. All reports derived from that would populate a child table in that window, and for every row fetched do whatever calculations and put calculated values in the child table's columns. (i.e. a class of columns for data retrieved via SQL, and a class of columns for post-fetch calculations.)

The associated report template would then be strictly for presentation.

Exporting data from a child table to a CSV file was then so much easier.

I highly recommend this approach. Mind you, if there is indeed an easy-peasy solution for CSV export the way you're thinking, then please disregard this reply to your post !

jdurban
Germany
Posts: 54
Joined: 09 Oct 2018, 09:30
Location: Karlsruhe, Germany

Re: Tab instead of spaces

Post by jdurban » 25 Jan 2021, 20:27

Hi Charlie,
thanks for your idea - interesting!
In my case I will not change the reports or the way how data will be selected - it works since years and if I would change this we to test it too much. copying data before they are passed to the report would be ok. Your solution does not cover things like sums and other calculations which are done by the report. The next point is that in the csv file should be the headline, too. Yeah, funny ideas of the user, I know.
If I have to store all the data passed to the report then a grid would be a big help.

thanks and best regards
Jürgen

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests