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!

Copy information form detail section to Group header

Status
Not open for further replies.

FrankInBerlin

IS-IT--Management
Mar 6, 2002
28
US
Hi everybody!

I have no idea if this is possible at all!

I have a database field in the details section of my report and would like to connect the values of this field in a formula and put this formula in the Group header.

So what I have is:
GH:
DS: data1
data2
data3

and would like to have:
GH: data1, data2, data3....
DS:


I tryed to make a single formula for each value and connect those, but that didn't work.
The single formulas for each value work perfectly in the details section but they are empty when placed in the group header.
Is there a way to accomplish this?

Regards,

Frank
 
I think it's possible - just not using formulas. As far as I know, you can't get details into the GroupHeader, but you can get the GroupHeader into the details section. I'm not sure what version you're using, but I am able to accomplish this by formatting the details section to use columns. You can specify the column width and both vertical and horizontal spacing.

I then placed the database field corresponding to the group header into the details secion and supressed if duplicated.

~Deej
 
You can use variables to string the data elements together in the detail section, and another to initialize the stringvar in the group header, and still another to display the data in the header.

By default, if you place a detail record in a group header it will return the first record in the group, so you will need to evaluate the display formula after the formula that has concatenated all the values together.

Bewarned that the maximum length of a string is 254 characters, so if your formula to concatenate all those dat aelements together exceeds that length, it will generate an error.
Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Thanks for the relpys...

I will try the from Deej and see if this is a workaround for me.

Dear dgillz, can you be a bit more elaborate on how to setup those three variables/formulas? Few few lines of code would be great (because I don't see the light yet:)).

Regards,

Frank
 
In the Group Header:
WhilePrintingRecords;
Stringvar Frank:=""

In the Details Section:
WhilePrintingRecords;
If {stringfield}<>previous({stringfiled}) the
StringVar Frank:=Frank+{stringfield}

In the Group Footer:
WhilePrintingRecords;
Stringvar Frank;

To display the same in the group header, I have done this but I cannot recall the formula at the moment. When I get back in the office I will look this up. In the meantime maybe another expert can get this last piece for you.
Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Dear dgills,

thanks a lot, that was real quick!

Regards, Frank
 
faq149-243 has an example of this formula that makes sure that you don't exceed the 254 limit. But this technique has to go in the Group Footer, not the Group Header. Of course, if you aren't seeing the details - it shouldn't matter. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top