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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display groups horizontally rather than vertically?

Status
Not open for further replies.

jollyreaper

Technical User
Jul 25, 2005
105
US
Crystal XI. I am printing a report for a construction schedule. The report is supposed to be laid out in rows by customer. It will look something like this:

Cust Stage1 Stage2 Stage3
Joe 5-5-05 5-6-05 5-7-05
Bob 5-1-05 5-2-05

The stages are specific tasks in the order of construction. These stages are used for estimating completion times on the projects. By stage 1, the house is 90 days out. By stage 2, 60 days out, stage 3, 30 days out, etc. The date is taken from the database entry for the task showing completion date.

I am reading all of these tasks off a big task table. The task table is laid out like this:

TaskID ClientID Stardate Enddate
1 1 5-5-05 5-6-05
2 1 5-6-05 5-7-05
3 1 5-8-05 5-20-05

So, here's my problem. If I wanted to display this stuff vertically, I know how to do that. Select on the task table by clientID, do an order by specified and only specify the ID's pertaining to the tasks I want. Then they would display grouped vertically. The only problem, of course, is that would create a lot of blank paper. I'd like to set this stuff up in neat columns like I outlined above.

What's the smartest solution for this? Thanks!
 
Try inserting a cross-tab, with ClientID as the Row, Task ID as the column, and the maximum(date) as the details.

Should give you something similar.

Otherwise you'd need to code out formulas, with a grouping by the ClientID and displaying fields in the group footer, you'd have something like:

Group header formula:

datevar task1:=cdate(1970,1,1);
datevar task2:=cdate(1970,1,1);
datevar task3:=cdate(1970,1,1);

Details formula:
datevar task1;
datevar task2;
datevar task3;
if {table.taskid} = 1 then
task1 := {table.start.date};
if {table.taskid} = 2 then
task2 := {table.start.date};
if {table.taskid} = 3 then
task3 := {table.start.date};

Group Footer formula:
datevar task1;
if task1 <> cdate(1970,1,1) then
task1
else
cdate(0,0,0)

Note that this will result in a lot of formulas.

-k
 
Yeef. I'll certainly try the Cross-tab approach first. :)
 
Looks like the simplest way to get it out the door right now is via sub-reports. The only problem, of course, is that this can lead to long execute times. I think that will get the job done for now and I can research doing things a better way when I have some down time. Fortunately, this is a report we're schedueling to run only twice a week so I can have it start in the early AM and all is good.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top