Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Selection Post Reply Post New Topic
Author Message
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 76
Quote brockloch Replybullet Topic: Selection
    Posted: 16 Jan 2022 at 9:49am
Hi

I have a report that shows the total requirement of a product. Which can be selected from numerous batches.

Is there any way in crystal to show the required batches.

So if I have a total of 10 and 3 batches with totals stored in the database of:

BTC 1 = 5
BTC 2 = 3
BTC 3 = 10

The report would return
BTC 1 = 5
BTC 2 = 3
BTC 3 = 2

Or if I had:
BTC 1 = 500
BTC 2 = 3
BTC 3 = 10

The report would return
BTC 1 = 10

Thanks for any help.

Ed


brockloch
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 17 Jan 2022 at 12:33pm
I am double checking that I understand the question and the examples. 1) you have a total 10 items that can be distributed among the 3 batches, and there is some logic that distributes the 10 items to the batches.

The examples listed show the requested amounts per batch and the report is returning which batch(es) should get which amount(s).

Hopefully, I got that correct.

I want to say that Crystal can do it, and I have a path to follow. I not sure how well I can explain it.

Here is the outline, and you will have to fill in a bit.
You will have a formula that calculates the number of items to assign to a batch (following the logic above). It will have to compare it's logic to how many items you actually have on hand, decreasing this amount as it assigns an amount to a batch. When there are no more items, I would have the formula assign 0. Hopefully, this makes it easier to code as it consistent.

Then in the display section, I would put in a suppression formula that looks something like: AssignedUnits = 0

The AssignedUnits would be a variable (either global or shared depending on if subreports are involved) and is the set in the formula.

This is all thinking off the top of my head as there is not much to go on in the post.

HTH

IP IP Logged
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 76
Quote brockloch Replybullet Posted: 18 Jan 2022 at 9:40am
Yes that's it - I'll work through your explanation and let you know how it goes, thanks for your help
Ed
brockloch
IP IP Logged
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 76
Quote brockloch Replybullet Posted: 04 Feb 2022 at 12:16am
Couldn't get it working but I'll keep trying!
brockloch
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.