OnBeforePrint script Question

I’m attaching a report that I built, as well as a sample that shows the problem.I read through the forum about onbeforeprint script issues. I modified on to work with my report, however, it still prints one blank parts area and then stops.

I added a script for the workorderitem_travel area and that works well, but the script for the workorderitem_parts doesn’t.

Can you look at my script and give me some suggestions on how to fix this issue?

To see the error please look at page 5 (fyi: it shows a 240 gallon tank as the unit)



Hi Jeff
Thank you VERY much for sending the report template file, as well as a report of what you see as well - as that made it very understandable for me to help identify what the issue is and get back to you right away. That was awesome.

What is happening is, if there are no parts selected for a workorder item, you do have the OnBeforeScript in the Detail2 band so that does not show. BUT the GroupHeader2 and GroupFooter1 band still displays because they too would need an OnBeforeScript to tell them not to display if no parts.

Just do the following and than the GroupHeader2 and GroupFooter1 bands for parts won’t display if there are no parts:

Click on the Detail2 band where you presently have your script to not show if no parts, and open the OnBeforePrint script for it
Copy all of the text
Exit out of that OnBeforePrint script
Click on the GroupHeader2 band and select its Properties tab, and open its OnBeforePrint script
Paste that into an OnBeforePrint script for the GroupHeader2 band.
Do the same for the GroupFooter1 band - paste in the same script into its OnBeforePrint script
I made a copy of your report template, did the steps above and saved, and have attached if you want to take a look.

  • Joyce

Thanks Joyce,

I don’t know why I didn’t think of that.