tlascek
tlascek

Reputation: 63

Crystal Reports 11 - How to print different data on multiple pages

I have a shipping label that needs to print on a Dymo Label printer with slightly different data on each of 3 pages. Can this be done with just one .rpt so the users only need to print one report, rather than three?

http://imgur.com/5UUl4

Upvotes: 6

Views: 42373

Answers (3)

beach
beach

Reputation: 8640

It's been a while since I've used Crystal Reports, but you can setup your .RPT to have three detail sections (A/B/C) and have B and C "print new page before". That way each detail will be on three separate sections.

You shouldn't need to do anything crazy with custom formulas. All you need to do is display each piece of data three times, one on each page, with each page being slightly different.

(Of course you could use a header and just put the changing data in the details section... but that will take more time to get right then just repeating the required data in each data section.)

Confirmed

  1. Open your report
  2. Right-Click on the Details secton
  3. Select "Insert Section Below"
  4. Repeat steps 2 & 3 twice
  5. Confirm that you see three Detail Sections
  6. Use "Section Expert" (or Visual Studio Properties) for sections A & B and select "New Page After". (If using Section Expert, be sure you are on the Paging tab.)
  7. Create the desired content in each Detail Section.
  8. You probably want to Suppress all other sections, including Report/Page Headers & Footers.

.RPT Detail Section Setup

Report Setup

Section Expert

Section Expert

Upvotes: 4

Dog Ears
Dog Ears

Reputation: 10035

If you can get your data to repeat three times, so each 'record' for your report is duplicated you could do something with multiple details sections (from the section expert create three details sections)

And then use the 'Supress (No Drill-Down)' with a formula to show each version of the label in turn, depending on the record number. alt text

For each details section add the formula (using Basic Syntax)

  1. formula = (Remainder(RecordNumber,3) <> 1)
  2. formula = (Remainder(RecordNumber,3) <> 2)
  3. formula = (Remainder(RecordNumber,3) <> 0)

Then create each slightly different label on each of the thee details sections.

I managed to get the three data rows by doing a cross join like so (in SQL Server) assuming a table with the data called ReportData

;with cte as 
(
select 1 as ver
union
select 2 as ver
union
select 3 as ver
) 
select * from 
cte cross join ReportData
order by OrderNumber, ver;

Upvotes: 0

Mark SQLDev
Mark SQLDev

Reputation: 539

You have two basic methods.
You can use groups and use the option to start a new page for the group when it changes. The other option is to use subreports, but I would avoid this option. If you want me to elaborate, please let me know.

Upvotes: 0

Related Questions