BAQ Report Fails on Auto Print


I created a very simple BAQ that only calls 3 fields from the Job Head Table with a filter on Job Number.

Whenever I run this report normally it outputs with no error.

I’m trying to have it Autoprint with a Data Directive but I keep getting a “Bad SQL Statement” error.

Is there a parameter I’m missing for Autoprint to work properly? There’s an option to put a parameter for nearly all the fields that are related to a BAQ, but does anyone know which are necessary?


1 Like

Does Your BAQ have any parameters defined?
(the BAQ itself, not the BAQ Report)

If you change that Action to The specified constant and enter a known good JobNum, does it work?

Hi Calvin,

The BAQ does not have any parameters defined.

I did try that with a few different JobNums and still got the same error.

I also tried deleting the whole report and BAQ then recreated them but still coming across this issue…

I figured out the issue. On the report creation I used a filter instead of an option field, the filter wants an array of data instead of a single input value causing a mismatch of data types.


How did you end up having to format the filter array? I am trying to print a BAQ Report from a button in a customization and I am trying to populate the filter list and I can’t get it. It’s as though I’m not passing any value at all.

I ran into this same situation and really didn’t like the idea of using an option. In my instance, I am filtering on CustNum. No one knows the CustNum off the top of their head. You need the search button, which a filter automatically provides but the option does not. If you find that you want to use the filter instead of an option, here is what you need to do.

Select “the specified expression” from the Action drop down.

new[] {ttLaborDtl.JobNum}
1 Like