Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Duplicate Pages Needed Post Reply Post New Topic
Author Message
jakek
Newbie
Newbie


Joined: 16 Feb 2010
Location: United States
Online Status: Offline
Posts: 2
Quote jakek Replybullet Topic: Duplicate Pages Needed
     Posted: 16 Feb 2010 at 8:29am
I am looking to generate a report that is used as a packing label through our MIS system.  I can pull data out of our MIS system that tells me how many boxes i have and how much is in each box and how many partial boxes i have and how many in each partial box (for partial boxes it will always be 1 box at xx quantity).  What i would like to do is have the report recognize that i have 10 boxes at whatever quantity and 1 box at whatever quantity and then spit out 11 pages to the report.  Thus duplicating the label 10 times for the 10 constant labels and then the 11 page would be the odd partial label.  any suggestions?  i am a beginner to medium level Crystal Reports user if that helps the tech lingo.  using crystal reports 9.  Thanks in advance.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Feb 2010 at 6:35am
I would use a stored procedure to fetch the data.  In the stored proc, you could create duplicate records, which CR will read and create duplicate labels.
 
I don't know of any other way of creating variable multiple outputs.  Joining directly to the tables will give you 1 record, unless the tables you are using and the join condition creates duplication.
 
The simple answer, in a round about way, is that CR will not create records, it will print the rows that it finds.  If it only finds 1 row, it will only print 1, but if it finds 100, it will print the 100. So you need to create the correct number of rows and CR will print them.
 
HTH
IP IP Logged
jakek
Newbie
Newbie


Joined: 16 Feb 2010
Location: United States
Online Status: Offline
Posts: 2
Quote jakek Replybullet Posted: 18 Feb 2010 at 7:03am
i was hoping to utilize some sort of formula that would be something like:

while {quantity} - page number > 0 or something like that.  but didnt know if i could do a repeat display?  it sounds like from the previous reply i cant. 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Feb 2010 at 11:36am
Nope...You might try calling a subreport repeatedly, but a) I don't like subreports as they degrade performance, b) I have never thought to try this, so it may not be possible either.
 
In general, CR only prints what it sees...so the simpler solution is to increase the number of rows that CR sees.
 
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 18 Feb 2010 at 12:15pm
Okay I am venturing into new territory for me.  I have been giving some thought to using arrays in a CR project I have.  I have not done this but believe it could work, at least in theory.
 
Would it be possible to create an array using the Crystal  - Make Array syntax , populate the array with the full box/partial box values and then use the array values to create the pages. I am thinking using a counter and a For-Next statement in a formula to move (iterate) through the values.
 
It would seem that a person could using logic to create any missing values that might be needed to load the array. 
 
Anyway,  its just a thought but perhaps someone can build off it or knows it will not work will tell us.
 
Regards,
 
John W.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Feb 2010 at 1:14pm
I'm guessing that arrays could work.  I haven't used arrays as I have a hard time 'seeing' where the data is, and CR only allows for 1 dimensional arrays, so any complex data would, I think, need multiple arrays to track what is where.
 
For this instance, I would still think that a stored proc is simplest...but arrays could work.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum