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!

Repeating page if page# < parametervalue

Status
Not open for further replies.

ikidd

Programmer
Jul 11, 2002
23
CA
I'm printing waybills from code and just passing in parameters. One parameter is piececount. How can I get CR to repeat the page up to the total piececount. I would figure a New Page After with formula [if pagenumber < tonumber({?piececount}) then true] would work but the New Page after is grayed out on the page footer. Any ideas?
 
it all depends on how complicated the report is.

You cannot get Crystal to repeat a page as such....Crystal is linear as it passes through the data...ie. it doesn't back up

Now you can store values in an array and repeat them later and that may be one approach

Another approach might be to have another identical section like the main one that prints the waybills..This section would be normally suppressed, but can be unsupressed via a formula result after a &quot;new Page After&quot; puts you onto a new page.

Describe your report with a simple example if possible... Jim Broadbent
 
I'm not sure what you want to do.

Does this:

&quot;How can I get CR to repeat the page up to the total piececount.&quot;

Mean:

I want multiple copies of pages?

A New Page After formula will just begin a new page if a condition is met.

Please elaborate on your requirements.

-k kai@informeddatadecisions.com
 
Sorry about the vagueness guys.

Essentially, I'm creating a waybill set for Purolator. I send in only parameters since it's a one off report and I have the data in fields on my asp page. I pass in address fields and a piececount. I need to reprint the pages up to the total piececount for the shipment so there's one for each box. They'd be the same except for 1/4, 2/4, 3/4, 4/4 on the waybill if piececount = 4.

Now I'm doing this with a COM object using the craxdrt.dll library since I have to export it to a PDF file upon call from an ASP page. I recall seeing a reference that I can't use multi-value parameters in this dll which rules out arrays as far as I can see. I could get around all this by writing a database reference that pulls a recordset that numbers up to the piececount but that seems silly and unnecessary.

If I could use the statement [if pagenumber < piececount then newpageafter = true] I'd be laughing but it's not available in the page footer section (newpageafter grayed out). That idea isn't out to lunch is it? Why would that be grayed out?

Does that make sense?
 
New Page After is grayed out in the Page Footer section because the Page Footer is always the last thing printed on a page; there will always be a new page after the page footer prints.
 
I still am not certan how you present the data to the report....is it in the form of a record set from the ASP page + parameters?

There doesn't sound like there is much data or grouping involved.

So if the report is basically the detail section...then just break the report detail section into 4 subsections that are identical...or as many as you need.

In each subsection put a conditional &quot;new Page after&quot;

ie. in the section DetailA the formula would be

whilePrintingrecords;
{piececount} > 1;

in the conditional suppress for each subsection put a formula like the following:

ie. in the section DetailB the formula would be

whilePrintingrecords;
{piececount} < 2;


or does this make sense to you? Jim Broadbent
 
Ah, that would work. Is there a limit to the number of detail sections I can have? I'm thinking up to 100. Otherwise I make a database call to a bs text table numbered 1 to 100 and pull a rs up to my number. It just seems like a kludge method.

Just to make it clear, I didn't want any db calls in it, it wasn't necessary for this app. It just seems you should be able to repeat a page based only on code in the pageafter conditional and reuse parameters, not only on a recordset.

Thanks very much for the help, Jim and everyone else.
 
I am not sure if there is a limit to the number of Subsections...100 seems like a lot....I have personally done about 20 once with no trouble Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top