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

Group columns 2

Status
Not open for further replies.

papalpha

Programmer
Jul 31, 2002
26
US
Is there a way in Crystal Reports 9, to make multiple Groups to list horizontally across the page instead of vertically? I have checked the ‘Format with Multiple Columns’ and the ‘Format Groups with multiple columns’, but this still list the groups down the first column before moving to the second column. What I need is:
Group 1 Group 2 Group3 Group4
Detail1 detail2 detail3 detail4
Detail1 detail2 detail3 detail4
Detail1 detail2 detail3 detail4

 
Are there always the same number of fields per column? One way of handling this is to create the columns in a subreport, and uncheck "can grow" (format subreport->common). Then resize the subreport to force the columns into the configuration you want. This is one way to address the issue of "down then across" formats where the page bottom otherwise forms the bottom boundary, but it works best if you have the same number of items per column.

-LB
 
No the number of detail records per column are not always the same. I am experimenting with using a cross-tab (after creating a view in Oracle that had just the columns that I need). Is there a way to suppress (not print) cross-tab cells where the value is zero (0)?
 
If what you mean is you have data which has 4 sets of groupings, and need the outmerost grouping to show up at the same level as an inner grouping, than you misunderstand how databases and queries work. Perhaps you're using the term group inappropriately, or perhaps more likely I misunderstand ;)

You might want to approach this by using a Union query to pivot the data all into one row using an Add Command.

I'd need some technical information to assist you further:

Database/connectivity used
Example data
Expected output

-k
 
There are several methods to do this. For your needs you might try the following, which assumes that you have one group with multiple instances. First create three formulas:

//{@reset} to be placed in the group header and suppressed:
whileprintingrecords;
stringvar x := "";

//{@accum} to be placed in the detail section and suppressed:
whileprintingrecords;
stringvar x;

if instr(x,{table.field}) = 0 then
x := x + {table.field} + chr(13);
//where {table.field} is the field you want to display under
//each group name and assuming you only want unique values displayed

//{@display} to be placed in Group Footer #1b:
whileprintingrecords;
stringvar x;

Right click on {@display}->format field->common->check "Can grow". Drag your group name into GH#1a, and insert a GH#1c to allow for spacing between sections. Suppress the details section.

Next go to the section expert->details->check "Format with Multiple Columns"->layout tab->set a width and gap->check "Across then Down" (this will only affect the display of the group names)->check "Format Groups with multiple columns".

This will give you a display of group "headers" (in the footer section) with a list under each. If you only want to display one "row" of groups per page, then stretch GF#1c until the next group is forced onto the next page.

-LB
 
I may have a simpler method. Format with multiple columns set to go down then across. Then add an extra empty group footer subsection (GF1b) and set that section to "print at bottom of page". This pushes the next group to the top of the next page.

While CR has a "New Page After" setting it does not have a "New Column After" setting, so the method above is a rough workaround.


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- TEK2(AT)kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top