Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Limited Item Description Line per Page Post Reply Post New Topic
Author Message
Elisha83
Groupie
Groupie


Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
Quote Elisha83 Replybullet Topic: Limited Item Description Line per Page
     Posted: 02 Jan 2009 at 2:19am
Hi there~
 
Im facing problem on how to limit item description line plus additional info line per page. Im using pre-printed form to print out the PO. Below are my report design sketch and the output sample.
 
Report Design sketch:
 
Item Code             Description                Qty           U.price         Amount
                              -  Additional Info
 
 
 
 
Output Sample:
 
123              welded steel pipe               4                 4000           16000
                   - 750 x  25mm thk x
                     5000mm
                   - Send to B warehouse
 
456               welded steel pipe              6                  5000          30000   
                    - 900 x 35mm thk x
                      6000mm
                    - Send to A warehouse
                    - Deliver before 30/01/09
 
 
The preprinted form only can fit 25 line per page, which means Description + Additional info = 25 line only.
 
Can anyone guide me on how to solve this problem?
 
 
Thanks in advance~
 
 
Have a nice day & Happy New Year~ Wink
 
 
 
Regards,
Elisha Sleepy
3Lish@
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 Jan 2009 at 6:16am
OK, here is what I have done in the past. I am guessing that there is a grouping on item code...this will come into play later. 
 
You will need to keep track of the number of lines that you have printed per page.  I would do this by shared variables and updating the variable everytime a line is printed for the item code and resetting the variable every time a new page is displayed.  Modify the formula for a 'New Page Before' in the Item Code group if this variable exceeds a set value (whatever the 25 lines work out to).  
 
This would keep  the number of lines displayed on a page to a set limit and keep all of an item code together (which is what I would want to do).
 
Hope this helps.
IP IP Logged
Elisha83
Groupie
Groupie


Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
Quote Elisha83 Replybullet Posted: 04 Jan 2009 at 6:14pm
Sorry, I don't really understand what you mean. You are saying using shared variables, is it means that I have to use subreport and put all the information inside the subreport and shared out?
 
Actually the field for Description & Additional Info, my users sometimes will type very long until few lines per item. Therefore, I dont really know how to do the counting of lines.
 
Can you explain in more details?
 
 
 
Thanks in advance~
 
 
Regards,
Elisha
3Lish@
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 05 Jan 2009 at 6:09am
hmmm...I don't how it will work with very long lines, but here's the scoop on shared variables.  You use them in formulae.  Assignments are := while equality tests are = (kinda like C).  All you need to do to start using one is to declare in a formula like:
Shared Numbervar GrossAmount; (you can initialize as well, but I only do that in a formula to reset the amounts.)  They are case sensitive.
 
Back to your case:
In the page header the formula would look something like:
Shared numbervar Lines := 0;
""   //I put this in the formula so nothing will display
 
In the detail section:
Shared numbervar Lines := Lines + 1;
""
 
In the group header section under new page before
shared numbervar Lines;
Lines > 20  //the number is not specific, you would want to experiment to see what gives you the best results
 
Hope this helps
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