[quote=253186:@Russ Lunn]I wasn’t making a report, i was trying to design a query. I thought i would be able to add a parameter to it. it seems this is not possible?
I know that sometimes i work in odd ways! my idea was this
- Design Query that has parameters for where clause
- Design Report that uses the Query.
Maybe this is not the way it works?[/quote]
Hi Russ,
You will use that report later in Xojo app?
From app code you will use MakeNewReport() method
MakeNewReport(
inIndex as integer,
inDatasource as string,
inQuery as String = NULL,
inBinds() as StringOrVariant ) as VReport
i.e. you can define here the whole SQL query with WHERE part as you want.
Yes, in most case-sensitive this query will be similar in SELECT … FROM part, and differ in WHERE to select records you want to report.
You can ask, why I should do this query again? – Because this gives more power and flexibility.
-
You can design report against some test mySQL db on your computer, but LATER this report can be used against any other DB.
-
You can use query, which in fact differ a lots from original in Report Designer. It is important only to have the same list of fields in the SELECT. All rest can be different - tables, joins, views, where.
P.S. Report Parameters – should be considered as global variables of a Report, which you can modify from app code before produce report. For example - name of report.