Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overiding ObtainSelectStatement to Add a Report Parameter

Status
Not open for further replies.

carlos2

ISP
Sep 5, 2009
2
US
I removed the parameter (itemnum = :itemnu) from the sql statement where clause in my datasource code because I want the report to select and return all the item numbers from the called table (ASD_D_INVTRANS)if the user does not select one or more.

Here's my ObtainSelectStatement code in my datasource method

Function ObtainSelectStatement( ) As String

If Not (itemnu = "") then
where = where & " AND " &
parseParam2(itemnu, "ASD_D_INVTRANS.itemnum")

End If

Where = Where & "AND 1=1"
ObtainSelectStatement = Super::ObtainSelectStatement( )
SelectStatement = StrSubst (SelectStatement, "1=1", where)
End Function

I also added the parameter as a global parameter under tools parameters. (Added as a global string parameter)

When I compile and run the report I can enter any single item number in the report parameter field and the report returns all the item numbers. What am I missing? What can I try to make this work the way I want it to. If I put one or more item numbers in the submit report field I want only those returned on the report. If I leave it blank or null I want all item numbers returned.

 
I am using Maximo 6.2.2 and Actuate Reports developed with erdpro v8 on a sql db. Note: Others have suggested that I edit the sql statement and leave the Function ObtainSelectStatement alone; however, after attempting this serveral times, I have returned back to the idea of overriding the ObtainSelectStatement method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top