×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Overiding ObtainSelectStatement to Add a Report Parameter

Overiding ObtainSelectStatement to Add a Report Parameter

Overiding ObtainSelectStatement to Add a Report Parameter

(OP)
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.

 

RE: Overiding ObtainSelectStatement to Add a Report Parameter

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close