Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Details of group horizontal in stead of vertical 1

Status
Not open for further replies.

botsb

Programmer
Jun 10, 2004
5
NL
Hi there!

Currently I’m working on a database export/import job and I don’t have much tools available on my PC, only a simple CSV-editor and CR 11. I haven’t used CR much in the past. My database export is a rather simple CSV-table which looks like this:

BuildingName;PropertyID
BuildingA;1218
BuildingB;928
BuildingB;929
BuildingB;930
BuildingC;747
BuidlingC;848

In CR I have grouped my data on the field BuildingName. So my report looks like this:

BuildingA [=group]
1218 [=details]

BuildingB
928
929
930

BuildingC
747
848

But what I want is to create a report which looks like this:

BuildingA;1218
BuidlingB;928^929^930
BuildingC;747^848

How can I get the PropertyID’s horizontal in stead of vertical?

I searched the forum, but couldn’t find a proper solution for my problem. I can’t use a Cross-Tab, because at the end, I want to export my CR-report again to a CSV-table. The import-module of the new database, which is rather a set of scripts, uses CSV-tables as input.

I hope somebody can help this newbie to CR. Every hint is welcome!

Greetings from Holland
Peter
 
When I first had this challenge, Synapsevampire helped me with the solution, as I remember. By the way, why isn't he present on the forum anymore?

Here is the three formula solution:

@AccummulateDetails //suppress and place in the detail section
whileprintingrecords;
stringvar DetailsList := DetailsList + {table.details} + '^'

@ResetDetailsList //suppress and place in the header
whileprintingrecords;
stringvar DetailsList := ''

@DispDetailsList //to be put in the group footer
whileprintingrecords;
stringvar DetailsList;
left(DetailsList, length(DetailsList)-1)


Dana
 
Hi Dana,

You're the greatest!!! A few minutes ago I tried this set of formula's and it works perfect!!! I only have to make an export to a TXT-file instead of a CSV-file. This saves me a LOT of work. Thank you for sharing this solution.

Greetings

Peter
 
Hi there,

When I use Dana's formula's and I try to supress the header and the detail section in my report, i got the following error:

String length is less then zero or not an integer.

I suspect that the fact that I'm grouping on another formula causes this particular error message.

Actually I've two sorts of types BuildingNames in my table, so I created a formula, which looks first in another field which of type of BuildingName it is and depending on the type mentioned there, (re)builds it in a certain way. The outcome of this formula I'm using to group my PropertyID's on.

I first thought that maybe the irregular length of the content IN my PropertyID field or the fact that is was sometimes empty, caused the problem, but when I tried with a simple dummy file (without grouping on a formula), I didn't get the error message.

Somebody familiar with this problem?

Greetings,

Peter







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top