Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Dynamically Creating Detail Sections Post Reply Post New Topic
Author Message
dallan
Newbie
Newbie


Joined: 17 Nov 2010
Online Status: Offline
Posts: 1
Quote dallan Replybullet Topic: Dynamically Creating Detail Sections
     Posted: 17 Nov 2010 at 6:23am
Hi there,
 
first I'd like to thank everyone in advance for reading and responding.. Any help is very much appreciated..
 
Second, I'm sorry but my question has to do with Crystal 8.5 (forum is for 9 +).
 
I'm the IT manager for a distribution company and I've discovered a major inefficiency in our receiving department that I hope Crystal can help with. We receive tons of goods in our warehouse. Each pallet requires a tag. the receiving department has been creating these tags one by one in Word. Why not create them in Crystal. All we need to do is grab the info from the PO in our ERP and spit out tags. That is mostly right except for this:
 
There needs to be a tag for each pallet. If there only needed to be one tag for every item on the PO, this would be easy. In fact, I already got this far. I see all the pertinent info: Item number, qty received, UOM, bin location, etc...
 
But if item "ABCD" has a known qty per pallet of 56, if I receive 128 on a PO, then I need 3 tags. The first two tags will say: "ABCD", 58 cases. The last tag needs to show "ABCD", 12 cases. (58 + 58 + 12 = 128 cases).
 
I've worked out the pseudo code as follows:
 
int remaider = qty received
 
while remainder != 0
{
     if remainder > qty per pallet then
         {
              displayTag(qty per pallet)
              remainder = remainder - qty per pallet
         else
              displayTag(remainder)
              remainder = 0
         }
}
 
Now the big question is: How can I achieve this in Crystal. Right now, I have one detail section per item on the PO showing me the total qty received. I would like to create additional detail sections based on the logic in the pseudo code. Essectially creating a tag for each pallet of each item using known values qty received and qty per pallet.
 
Thank you thank you thank you!!!!!
 
PS: I would do this in visual studio, but I am using a really old dos-based ERP and the OBDC driver used to connect to the database (which are flat files... yuck) that is available does not work well at all.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Nov 2010 at 3:21am
best solution that i've seen was posted here a while back, and since you have an app to drive it...
 
what you need it to join the number of pallets with the item and qty received and qty/pallet.
 
all you need is something that 'looks' like a table.  I don't know if CR 8.5 handles XML (XSD) files, but if you can set the dataSource, then you can probably do this in VS, and have it create your datatable and then apply it to the CR and have format/print it.
 
If it was a purely database, the path would be to have a numbers table and then join the item to the numbers table based on some value...
select item
from itemTable as it
  join order as o on o.itemID = it.itemID
  join numberTable as nt on nt.value <= o.palletNumber
 
this will give you as many lines as there are pallets
 
Hopefully, one of these will lead to a solution.
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