Home » Developer & Programmer » Forms » How to create a search screen and display results (forms 6i)
How to create a search screen and display results [message #420192] Thu, 27 August 2009 09:12 Go to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Hi all,

I need some guidelines on this task. I created a form that is considered to be a search screen. It has multiple fields that have lovs, and radio buttons. The object is to have the user select the fields that they want to query from the table. (Selected fields should be part of the where clause). How can I display the results of the query? Should I use another form or generate a report? I was thinking of a report but how? The fields the user can choose from are optional, so all fields on the search screen may be null and don't need to me seen.

[Updated on: Thu, 27 August 2009 09:16]

Report message to a moderator

Re: How to create a search screen and display results [message #420205 is a reply to message #420192] Thu, 27 August 2009 09:40 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
How to display the results is really a question for the users rather than us.

Do you just want to know how to modify the your where clauses or is the data to be displayed changeable as well?

It's difficult to help without more precise requirements.
Re: How to create a search screen and display results [message #420217 is a reply to message #420205] Thu, 27 August 2009 10:11 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Thanks for the reply,

This one is difficult to explain, the data only changes based on the where clause, so I believe my first step is how to modify the where clause, step 2 is to display the results from the query.

For example;

Lets say I have 3 lovs:
lov1        lov2          lov3
a1           b1            c1
a2           b2            c2
a3           b3            a4

The user selects lov1.a3 and lov3.c1 (did not select lov2)

Query should say:
Select * from table where col1 = lov1.a3 and col3= lov3.a4;

Instead of:
Select * from table where col1 = lov1.a3 and col2 is null and col3= lov3.a4;

This would be fine but I have over 20 lovs and 7 radio buttons so far, this would be alot of null values.
Re: How to create a search screen and display results [message #420219 is a reply to message #420192] Thu, 27 August 2009 10:17 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you want to use reports look up lexical parameters.

If you're using forms then you'll want to set the default where clause programatically, or possibly just use the pre-query trigger.
Re: How to create a search screen and display results [message #420221 is a reply to message #420219] Thu, 27 August 2009 10:44 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Is there a way I can show the results of the query in the form without creating a bunch of text fields, or can I create one large text field to display the results of the query: I am really trying to use the same functionality of SQL or Toad where I can execute a query and not create a bunch of columns the data just displays.
Re: How to create a search screen and display results [message #420225 is a reply to message #420192] Thu, 27 August 2009 10:47 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you're using forms I'd just use a standard datablock to display the data - anything else is going to be messy.
Re: How to create a search screen and display results [message #420229 is a reply to message #420225] Thu, 27 August 2009 10:53 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

I think I have an idea but don't know how to start.....
How can I take the results from the query and dump it into a textfile where I can export to Excel?
Re: How to create a search screen and display results [message #420231 is a reply to message #420192] Thu, 27 August 2009 11:00 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
There are tools in forms to export data straight to excel. I don't know how they work myself but if you search this forum you should find examples.
Previous Topic: Validations before commiting to database
Next Topic: when- validate-item codes
Goto Forum:
  


Current Time: Fri Sep 20 11:29:09 CDT 2024