PDA

View Full Version : report query


ABC123

Troy Zoschke
12-06-2001, 04:33 AM
I need to run 9 different reports with the same user entered date range. So I tried to write xbasic and attach it to a button. I am using 2 ask variables for beginning and ending dates. I don't want it to ask the date ranges on every report it prints. I wrote the query in xbasic and then used the print_report function.

The script asks for the dates in the beginning, and then asks for them when it prints the report which I don't want to have to double enter.

I have tried unchecking the further filter at print on the report and then it just prints the entire database. I also tried playing around with range stuff but cannot get it to work.

This is the script:

flt_expr = "ITEMDATE>=VAR->askd_date1.AND.ITEMDATEaskd_date2.AND.PART_NO="p3100".AND.QTY>=0.AND.TOTAL>0"
query.description = "voices sold"
query.order = ""
query.filter = flt_expr
query.options = "I"
query_create(db_current(1))
print_report("M voices sold")

What am I doing wrong?

Troy

Troy Zoschke
12-13-2001, 08:08 AM
I didn't realize that this board was rarely answered.

Troy

Thomas Henkel
12-13-2001, 09:42 AM
Troy,

This board is not viewed as often as the version 4 board, but some of us still do check. I would suggest thatyou try to simplify you life a bit. We do this type of thing often. What I have set up is that in x-basic, I declare two variables (one for each date), use a ui_get date for each, then pass those dates to a card_run("Print_report") This can be obtained bvery easily by dragging and dropping the report onto your menu or form. In the report, declare two variables (one for each date) and set up a detail filter for what you need based on the variables. The questions are asked once, and the variables stay until the script is done. I have enclosed a sample.

Hope this helps, If you have other questions, e-mail me.

Tom Henkel