Home » Developer & Programmer » Reports & Discoverer » Report with variable query
Report with variable query [message #157714] Sat, 04 February 2006 08:42 Go to next message
orate
Messages: 16
Registered: September 2005
Junior Member
Please excuse my English, it is not my first language.

I have a form for querying a table (query only).
The user can include in the query four items (he can include only one or several of them).
The form has a button to print the result of the query.
This button calls a report.
How can this report execute the same query as the form?
(The query can vary depending on the items entered by the user).
Re: Report with variable query [message #158466 is a reply to message #157714] Sat, 11 February 2006 11:00 Go to previous message
orate
Messages: 16
Registered: September 2005
Junior Member
This is what I did:

In the form I get the last query executed using :system.last_query.
Then I get the substring after 'WHERE', that is, the where clause of the query, and I pass this string to the report as a parameter named P_WHERE.
The query in the report is:
select *
from table
where &P_WHERE.


Previous Topic: How to delete orphaned folders
Next Topic: How to create new item?
Goto Forum:
  


Current Time: Fri Jun 28 15:37:05 CDT 2024