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!

Gettng Multiple Column Detail Lines on Group Line

Status
Not open for further replies.

dblum51

Technical User
Apr 29, 2009
5
US
I have a report that has three Group Headers. I wanted my Detail lines to display on a single line and was successful doing that with the "Format with Multiple Columns" feature of the Section Expert. But I wanted all the information (three Group Headers and the detail lines) to display on a single line. On the Design tab, I moved the three Group Headers to the Group Header #3 line, but when I move the Detail line to the Group Header #3 line, only the first detail displays.

Does anyone know how to achieve this?

Thanks!
 
You should be moving your group headers into the detail line, although then your group headers will repeat for each detail. Please show us what you want your final report to look like. Be sure to identify group fields vs. detail fields.

-LB
 
Here is a rough view of the original report and a mock up of how we'd like it to look...

Original:
Group Header #1 (Facility)
Group Header #2 (Accession Nbr)
Group Header #3 (Organism Name)
Detail 1 (Antibiotic Name)
Detail 2 (Antibiotic Name)
etc...

Ideal Format:
Fac Acc-Nbr Org-Name Ab1 Ab2 Ab3 Ab4

So far, I have the following:
Fac Acc-Nbr Org-Name
Ab1 Ab2 Ab3 Ab4

The number of antibiotics (details) per grouping is not finite and can range from one to a fifteen or more.
 
I think you should just put your group fields in the Group #3 footer, and then use formulas to accumulate your details into one string in the group footer, as in:

{@reset} for the group #3 header:
whileprintingrecords;
stringvar x;
if not inrpeatedgroupheader then
x := "";

whileprintingrecords;
stringvar x;
if not inrpeatedgroupheader then
x := x + {table.antibiotic} + chr(9);

Then in the group #3 footer use:
whileprintingrecords;
stringvar x;

Then suppress the group headers and detail section.

-LB

 
I'm not an experienced Crystal developer, but I will work on putting that together. I may be able to get some help from others here. Thanks, lbass.
 
lbass...what is inrpeatedgroupheader? Is that a function or something that I need to define? I'm unsure what to substitute there.
 
InRepeatedGroupHeader is a boolean function. It returns true or false. Use it exactly how LB spelled it out in the formula.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
I spelled it incorrectly. Should be: inrepeatedgroupheader.

-LB
 
Sorry, I just noticed also a copying error. The middle formula should have been:

whileprintingrecords;
stringvar x;
x := x + {table.antibiotic} + chr(9);

-LB
 
I was distracted by other priorities. I did (I think) what you suggested, and the end result is that only the first detail line is stringing together and displaying on the Group Footer #3 line with the Group Headers that I moved there.

I created the formula RestGrpHdr3 and put it in the GH#3 line:

whileprintingrecords;
stringvar x;
if not InRepeatedGroupHeader then
x := "";

whileprintingrecords;
stringvar x;
x := x + {CODE_VALUE_1.DISPLAY} + chr(3);

I created the formula StringAB and put it in the Group Footer #3 line with the Group Headers:

whileprintingrecords;
stringvar x;

I then supressed the Group Headers and Details.

The end result:
Fac1 AccNbr1 Organism1 Antibiotic 1
Fac1 AccNbr1 Organism2 Antibiotic 1
Fac2 AccNbr1 Organism1 Antibiotic 1
Fac3 AccNbr1 Organism1 Antibiotic 1
Fac3 AccNbr1 Organism2 Antibiotic 1
Fac3 AccNbr2 Organism1 Antibiotic 1

There should be multiple Antibiotics strung out to the right of each line.
 
Did you actually use chr(13)? Because that is a return, while chr(9) is merely a tab. If you used a return, you would have to format the formula to "an grow" since it would then create multiple lines. I just used the tab to create some space between values.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top