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!

Duplicate the report on the same sheet

Status
Not open for further replies.

crisedefoie

Programmer
Feb 19, 2003
39
CA
Hi,

I have to print the same report on the same sheet (two parts invoice separated by a dotted line). Each part has its own header, detail and footer.

I first put on the part 'one' in a sub report in the header and the second in the detail section.

But I have to change page at the same record number and reinitialise the page number (if it has 16 records in the second part, it has to have 16 records in the first one).

Did someone already met this problem ????

Thanks
 
No idea what "But I have to change page at the same record number and reinitialise the page number" means.

Are you stating that you're printing more than one invoice at a time, and so you'll want to reset the page number to 1?

If every invoice is page 1, why use a page number and not just hardcode the number 1?

Anyway, I think that you want a group by the invoice, and in the Group Header place the subreport.

Hard to say though, try posting specifics:

Crystal version
Database used
Example data
Expected output

-k
 
Yeah, I wasn't clear enough sorry .... my english isn't so good neither ;-(

I mean that if I have so much details in my invoice, I had to change page (so my invoice will have 2 pages or more...)
and both part 1 et 2 have to break page at the same number of record.

I use Crystal 9 (with VB.NET)
Database is SQL Server

For a quick exemple :

(Factory part)
Custumer : xyz #invoice : 9999 Date : 01-01-2004 Page 1 of 2
Product 1 2 12.00 24.00
Product 2 5 10.00 50.00

Sub total : 74.00
Taxes : 8.00
Total : 82.00

------------------------------------------------------------
(Custumer part)
Custumer : xyz #invoice : 9999 Date : 01-01-2004 Page 1 of 2
Product 1 2 12.00 24.00
Product 2 5 10.00 50.00

Sub total : 74.00
Taxes : 8.00
Total : 82.00

I hope I'm more clear like that ... Thank you
 
That's an interesting one.

I'll have to thunk on it, the initial thought would be to use 2 subreports of a fixed height, and let the main report demonstrate the header/footer info.

The main report could just query one row, and not use the data, the diea being to just use it as the container.

<muttering to myself as I ponder...>

-k
 
I was thinking the same thing, k, but wasn't going to post anything until I'd had some time to think about it some more.

I've done something like this before. I was passing the page number of the main report as a parameter to the subreport. If the main report was on page one, I would only show the first n records of the subreport. If it was on page two, I would show the records > n.

I'll try to find it, and maybe I can give you a better idea of how I did it.

-dave
 
I can't let the main report demonstrate the header/footer info because (another thing I forgot to write) the product informations are in a detail table and other infos (custumer, date, invoice number etc...) are in a master table.

we'll continue to search for by ourself for a while
thanks
 
You could do this with four subreports, with the factory and customer subreports in group header_a and group header_b, and with factory2 in group footer_a and customer_2 in group footer_b. Each would be linked to the main report on the customer ID field. In the group header subreports, you would suppress records (as suggested by Vidru) by using the section expert to suppress details using:

recordnumber > 26 //substitute the number that allows both subreports to appear on one page

In the group footer subreports, you would use a suppression formula of:

recordnumber < 26

Then in the group header subreports, place a formula like:

if recordnumber = count({table.Customer ID}, {table.Customer ID}) then
replicatestring(chr(13), 26-count({table.Customer ID},{table.Customer ID}))

For the group footer subreports, use the same formula, but change the number to 52 (twice the number of records on the first page)

Each of these formulas must then be formatted to "Can Grow." This allows the subreports to grow and hold their space if there are fewer records than the maximum allowed by the space, but to contract to a small space if there are no records on the second page.

Format the group footer_a in the main report to "New Page Before" to force the page break.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top