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!

Merge Detail Lines in CR Report

Status
Not open for further replies.

crdamsel

Programmer
Aug 7, 2013
33
US
How can I get the data to come in on the same line and not each record from the database be its own Detail (Footer?) line as shown below?

This:
GH (suppressed)
(Column1)(Column2)(Column3)(Column4)(Column5)
D XX:123
D ...... ZZ:345
D ............. YY:567
D .................... WW:789
D ........................... VV:456
GF

To This:
(Column1)(Column2)(Column3)(Column4)(Column5)
XX:123 ZZ:345 YY:567 WW:789 VV:456

Any helpful suggestions would be appreciated.
 
It may take a little trial and error, but I believe you could underlay the following section option (section expert, Underlay Following Sections).
 
Thanks so much for responding. This is a great idea but what formula would i use to underlay following sections that have blank columns without suppressing the columns that are not blank?
 
I believe I am confused. The details should underlayed whether or not there is data. I hope this helps.
 
Your help is very much appreciated however when i checked Underlay Following Sections in Section Expert for the Detail line, it had no affect at all in the report so the records still printed one line at a time.
 
Did you make multiple detail lines with each field in separate detail line (of course now that I think of it, that may not work either). But there is another solution, but much more tedious. It would require a number of formulas. You would have a formula for the GH that would initialize some shared variables to a initial value (ex. shared numbervar xx := 0). Then in the detail line (which would be suppressed) you would have another formula that would check to see if there was a value (ex. Shared numbervar xx; if {col1} <> 0 (or null, "", etc. depending on the data type) then xx := {col1} and so forth for each of the columns. Then in the GF you would have another formula, something like this Shared numbervar xx;

If I had the actual column names and their data types, it would be a little easier giving you a proper solution. I hope this helps.
 
Just had a chance to look at this. Appreciate it. Think i know what you mean. Will get it a try.
 
Still no luck with this so if anyone can help me, i'd really appreciate. The fields can be referenced as {col1}, {col2}, {col3}, etc. and they are all VarChar.
 

Does the data always look like that? Does every group value have only one each of columm1, column2, etc.?

Even if it doesn't, I think you'll end up with a variation of this:

//Create this formula, put in detail section, and suppress it:
whileprintingrecords;
stringvar v_text;
v_text := v_text + " " +
{column1} + " " +
{column2}+ " " +
{column3}+ " " +
{column4}+ " " +
{column5};

//Then create this formula and put in the group footer
whileprintingrecords;
stringvar v_text;
v_text

//You'll need a reset formula in the group header:
whileprintingrecords;
stringvar v_text := ""

 
Appreciate your help but think i didn't make myself clear. I need the records in the report to all be in the same line but in their own columns:

From This:
GH (suppressed)
(Column1)(Column2)(Column3)(Column4)(Column5)
D XX:123
D ........ ZZ:345
D ................. YY:567
D .......................... WW:789
D ................................... VV:456
GF

To This:
GH (suppressed)
(Column1)(Column2)(Column3)(Column4)(Column5)
D XX:123___ZZ:345__YY:567__WW:789__VV:456
GF

Hard to show exactly what i need in this post since i can't tab the fields to move them over so i had to use dots and underscores to space them.
 
Not sure why my solution did not work. Just remember you are displaying the 'details' in the Group Footer (the details line would be suppressed). It just requires a lot of shared variables and formulas.
 
If only one line exists for each column, create a Maximum of each field at the Group level and suppress the details section. If you have other data you want to display in the GF, split it into multiple sections (GFa and GFb).

Pete
 
kray4660, the only reason your formula didn't work was because I'm now using the GF for yearly calculations so I need the Detail to show all the records which some columns have more than one record. Should have said that each column is really a monthly column so I have 12 columns for each month of the year.

pmax9999, your suggestion worked but unfortunately, it showed only the max record which I need all of them to display but please know, I really appreciate all these suggestions from everyone of you guys.
 
That's why I started my post with "If only one line exists for each column ..."

You should still be able to use variables to accumulate all of the data and display it in the GF. Just split the GF into 2 sections.

Pete
 
This thread is closed. Have over 1M records so solved this with a Cross-Tab report. Thanks again for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top