Odd form puzzle.
The task to allocate the correct amount of sheet stock to be used on a printing press run based on the number up on a sheet including overs for waste.
Example:
We have 3,500 sheets of paper 23×35 which will allow 8- 8 ½ x 11 to be printed on them
When completed we need 500 each of 17 sheets 8 1/2×11
Form 1 is 1 up each of 8 sheets
Form 1 can start with 1,400 sheets to produce 700 when printed ( 500 + 200 overs for later operations
Form 2 is 1 up each of 8 sheets
Form 2 can start with 1,400 sheets to produce 700 when printed ( 500 + 200 overs for later operations
Form 3 is 8 up each of 1 sheet
Form 3 can start with 700 sheets to produce 200 when printed a total of 1,600 pieces. Much more than needed but OK
Here is the current formula in Crystal.
// create Do While loop ‘Form ‘+ counter then line repeat
WhilePrintingRecords;
NumberVar FormNumber;
Local StringVar str := "";
Local NumberVar i:=0;
Local NumberVar StockPerForm:=IIF({sp_JobTicket.ComponentType}<>"COPYING",{@StockToPressShow}/IIF({sp_JobTicket.ParentOuts}<>0,{sp_JobTicket.ParentOuts},1),{@StockToPressShow});
Local NumberVar TotalForms:=Ceiling({sp_JobTicket.Lots}/IIF({sp_JobTicket.PressOuts}<>0,{sp_JobTicket.PressOuts},1));
Local NumberVar REMAIN:=REMAINDER({sp_JobTicket.Lots},{sp_JobTicket.PressOuts});
Local NumberVar Full_Forms:=IF ({sp_JobTicket.Lots}<={sp_JobTicket.PressOuts}) THEN 1 ELSE ({sp_JobTicket.Lots}-REMAIN)/{sp_JobTicket.PressOuts};
Local NumberVar Fractional_Form:=IF ({sp_JobTicket.Lots}<={sp_JobTicket.PressOuts}) THEN 0 ELSE REMAIN/{sp_JobTicket.PressOuts};
For i := 1 To Full_Forms Do
(
NumberVar FormNumber;
Str:=Str+'Form '+ToText(FormNumber+i,0)+' A Side ______________'+CHR(13)
+' ('
+ ToText(({@StockToPressShow}-
(({@StockToPressShow}/(Full_Forms+Ceiling(Fractional_Form,1)))*Fractional_Form))/Full_Forms,0)
+')'// + " " + ToText(i,0)
+CHR(13);
);
IF Fractional_Form > 0
THEN
For i := (Full_Forms + Ceiling(Fractional_Form,1)) To (Full_Forms + Ceiling(Fractional_Form,1)) Do
(
NumberVar FormNumber;
Str:=Str+'Form '+ToText(FormNumber+i,0)+' A Side ______________'+CHR(13)
+' ('
+ ToText({@StockToPressShow}/(Full_Forms+Ceiling(Fractional_Form,1))*Fractional_Form,0)
+')'// + " " + ToText(Ceiling(Fractional_Form,1),0) + " " + ToText(i,0)
+CHR(13);
) ;
str
This is what it produces.
It uses too much for forms 1 & 2 not leaving enough for form #3
Note: it works perfectly when there is not an odd form like #3
I am trying to find a way to consistently have enough stock for odd forms like #3.
Suggestions to edit the formula to get correct results
RuthlessRoth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.