jwray100
16th November 2004, 21:32
I have written a report that displays each delivery for a customer with the order date, planned delivery date, and actual ship date. I am trying to add a column that would show status for each delivery, i.e. Late or On-Time, based on the difference between the planned delivery date and the actual ship date.

I have created a report field with the print expression:
(tdsls041.ddta - tdsls045.ddat) > 0 ? dsta.o : dsta.l

All four variables are defined as input variables to the report. dsta.o and dsta.l are delared extern and defined as "On-Time" and "Late", respectively, in the session script.

When I run the report I get blank output in this column for all records.

Anyone have an idea on how to fix this?

I would also like to have a "sub total" by customer and "grand total" for the report which would be the on-time order percentage (on-time shipments/total shipments) for each customer's shipments and all shipments, respectively, in the report.

Any ideas on how to go about doing this?

Thanks,

Joel

mark_h
16th November 2004, 22:16
What domain did you use on the report for dsta.o and dsta.l? Is this the same domain as the field you put on the report?

Without really knowing the report, I would have to recommend using the report script to do the counters for the precentages and the totals. Then use the after customer and after report sections to print these values. For example in the detail layout just increase a counter by 1 for this customer and if on-time increase the on-time counter by one. Also create other counters for the grand total to be printed in the after report section. Then in the after each customer section just 0 out the counter at the customer level. You could do the same for the total values you mentioned.


Mark

jwray100
16th November 2004, 22:47
Mark,

I used domain tc.refa which is Multi Byte and I did not link it so I could use a shorter length. This may be incorrect. I have to confess that I am new at this and I don't completely understand how to choose a domain when there is not one defined as for a table field. I usually just try to find one that is the type I am looking for.

I'll give your suggestions on the on-time percentages a shot. If I understand you correctly you're suggesting I write the code to handle the counters into the script associated with the report not the session script, correct?

Thanks,
Joel

mark_h
16th November 2004, 23:55
That is correct. That is where I do my totals and percentages when I have to do something like you mentioned.

Mark

smanohar
17th November 2004, 00:11
If you are comfortable with debugging, then compile the report in debugger. When the condition is executed, check the value of all the four variables and see what is happening.

jwray100
18th November 2004, 15:47
Thanks for the help folks. The counters did the trick. The report works beautifully!!