Re: Passing Parameters to Reports from Forms

From: Joseph Strano <stranoj.dulcian_at_postoffice.worldnet.att.net>
Date: 1997/03/15
Message-ID: <332B1269.557_at_postoffice.worldnet.att.net>#1/1


First create a parameter list (CREATE_PARAMETER_LIST).

Next, I would suggest having the form build a valid where clause. Add this where clause as a parameter in your new parameter list: ADD_PARAMETER('PL_NAME','WHERE_CLAUSE',TEXT_PARAMETER,VARIABLE); Then, when you call the report, pass the parameter list (RUN_PRODUCT).

In the report, create a user parameter that has the same name as the parameter you created in the parameter list(our example WHERE_CLAUSE). Place this parameter into the where clause of the report's main query: (&WHERE_CLAUSE). Two tips:

1st- If there is a static where clause, place the lexical parameter after everything:

Where Emp.Empno=Dept.Deptno
&WHERE_CLAUSE

  • Ensure there is a space before the and in the where clause you are passing.

2nd - If there is no static where clause, ensure you start your where clause with WHERE.

Any questions, feel free to ask.

Joe Strano
Dulcian, Inc.


Chad Edwards wrote:
>
> Can someone please explain how I pass a parameter to reports from forms?
>
> What I want to do, is this:
>
> User is presented a form with a print all, print one set, and print one
> button. I want, if the user clicks on print all to print all of the
> "documents". If the user clicks on print one set, it will print all
> documents with and id equal to some number provided by the user after he
> or she clicks the print one set button. Finally, if the user clicks print
> one, it will ask him or her to enter the name of the "document" they wish
> to print and pass that.
>
> My question is how do I set up my form to correctly do this, and how do I
> modify my report as to handle this?
>
> Thanks
>
> --
>
> ______________________________________________________________________________
> http://www.infinet.com/~cedwards
>
> Home of:
>
> **** **** * *
> * * * * * *
> * * * * * * *
> **** **** * * *****
> Columbus Ohio APBA League
>
> NEW! Official home of RMBL! http://www.infinet.com/~cedwards/rmbl.html
> We are now full! E-mail dferry_at_flash.net to be put on the waiting list.
> Owner/GM/Manager of the Columbus Capitals
> _______________________________________________________________________________
Received on Sat Mar 15 1997 - 00:00:00 CET

Original text of this message