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

Two blocks of detail 2

Status
Not open for further replies.

pmgatwork

Programmer
May 7, 2004
83
GB
Hi all
I need to produce a report which has upto 5 lines of detail printed followed by anoth 5 lines of detail with info for the same first lines. eg
Report header
Page header
detail lines
Product code 1 Code 1 description
Product code 2 Code 2 description
Product code 3 Code 3 description
Product code 4 Code 4 description
Product code 5 code 5 description

Code 1 price
Code 2 price
code 3 price
code 4 price
code 5 price

Is this possible?

Thanks CR 11
 
Add a subreport in the report footer for the second set of detail lines.

-LB
 
If they are different field, insert a second detail section and place the second set of details there
 
Thanks
problem is that there could be twenty line os detail in the database table and the report can only display 5 lines at a time. how would I link the sub report

Peter
 
Peter, Please state your full requirements in your initial post. You have now added new information--that you need to limit the details to 5, but you haven't explained whether you want to see the remaining details (e.g., with 5 lines of description then price, another 5 lines with description followed by price, etc.), or whether you only want to see the initial five rows. You should also indicate whether there will be any groups, and how this relates to your requirements.

-LB
 
What I want is a report which prints out by group the details below. I want this report to throw a page every 5 detail records as it will print onto preprinted documents and that is all the space allowed however, there may be many pages to each group. I need the first detail block to contain some of the fields from the detail record followed bu a second detail block with different field data from the same 5 records above. Is this possible

Report header
Page header
detail lines
Product code 1 Code 1 description
Product code 2 Code 2 description
Product code 3 Code 3 description
Product code 4 Code 4 description
Product code 5 code 5 description

Code 1 price
Code 2 price
code 3 price
code 4 price
code 5 price
 
In the main report, create this formula {@cnt}:

whilereadingrecords;
numbervar cnt := cnt + 1;
numbervar i;
numbervar j;

for i := 1 to 3000 do(
if cnt in (i*5)-4 to (5*i) then
j := i
);
j

Replace "3000" with some number larger than the total number of records in your report. Insert a group#2 on this formula (assuming you already have a group#1.

Insert a subreport in GF#2. In the subreport, create the same formula {@cnt}, and insert your Group #1 and again your group #2 on {@cnt}. Then link the subreport to the main report on both the group #1 field and on the formula {@cnt}. Make sure both main and subreport have the same sort order.

-LB
 
LB
The main report is working but I do not get anything in the subreport at all. Not even headers. Should I reset the cnt variables before calling the subreport

Thanks
 
No, no reset. Did you set up the groups and record sort the exact same way in the subreport? And link on both group fields? I tested this and it worked here.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top