BKS Shorts: passing it a query?

Been playing with Shorts today for the first time. I see how to create a report, save it, and run it off a Web page. I also see how to offer the user some choices for the query. I also see how to supply the report with arrays of data instead of having the report query a database. But is there a way to supply the report a database query string when a method calls it? If not, I guess I can have the method supply the data instead of the query string.

Hope that’s clear.

If you are using the Report Designer you have two ways of doing it. You design the database query and parameters into the report and it does all the rest of the work for you, or, you can pass in the data you want.

If you create a report via code (decidedly much more work) then you can do whatever you want but then it’s all on you.

It seems that if I use the Report Designer Filter, I can’t configure the report to something like

"SELECT * FROM Customers WHERE CustomerID = " + Session.SelectedCustomerID

because the Report Designer Filter needs raw SQL values. Right?

However, perhaps I can code things in my app so that the JSON file’s SQL line gets altered to contain the correct raw values each time before running.

You can go into ReportBKS.LoadReportWhereConditions and override values there. It might not be the ideal location but it a place to start.

Right now I’m experimenting with the following :

  1. Created a new button that calls a method that is a copy of the SaveReportAs method. That method works with a copy of BuildReportJSON that blanks out database stuff.

  2. I then create a new No Database Report template constant and copy the contents of the above No Database report into it as its Default value.

So I get to design the No Database report with the Designer, and then use that report for importing data from the app.

Working with the above approach you suggested now, and it seems like a more direct approach, allowing me to send the query to BKS_Shorts and let BKS_Shorts grab the data. Needs only a few lines of code added to ReportBKS.LoadReportWhereConditions. Much easier to deal with than the way I outlined in my post just before this.