Print Page | Close Window

Selection

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22993
Printed Date: 19 Apr 2024 at 7:12am


Topic: Selection
Posted By: brockloch
Subject: Selection
Date 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



Replies:
Posted By: lockwelle
Date 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



Posted By: brockloch
Date 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


Posted By: brockloch
Date Posted: 04 Feb 2022 at 12:16am
Couldn't get it working but I'll keep trying!

-------------
brockloch



Print Page | Close Window