INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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.

Jobs

User search function

User search function

(OP)
Hi

I would like to implement a function that allows the user to search within a powerbuilder report. It should work just like the search function of a PDF-reader (user enters a search criteria and presses enter --> the first match is being highlighted with the option to jump to the next match). The "find" function does not really work because I want to search in every column and computed field, every band (including header, footer) and so on...

Your inputs are very much appreciated!

Thanks,
Tom

RE: User search function

It would require a custom function. You would need to loop through the objects in the DataWindow, and then review their text/values based on the object type.

To get the objects in a DataWindow, use something like ls_YourVariable = dw_YourDW.Object.DataWindow.Objects This will give you a tab-delimited list of objects in the DataWindow.

From there, you will need to parse out each object.

Look at the object type and get its value based on the type. You can use the DataWindow's describe function to get the object type. Something like ls_ObjectType = dw_YourDW.Describe( ls_ObjectName + '.Type' ).

Now you'll want to get the value. For items like columns, you'll need to also loop through the rows, as the value can change from row to row. Something like:

ls_ColumnType = dw_YourDW.Describe( ls_ColumnName + '.ColType' )

FOR ll_row = 1 TO dw_YourDW.RowCount( )
CHOOSE CASE Left( Lower( ls_ColumnType ), 4 )
CASE 'long', 'deci'
ls_Value = String( dw_YourDW.GetItemNumber( ll_row, ls_ColumnName ) )

CASE 'char'
ls_Value = dw_YourDW.GetItemString( ll_row, ls_ColumnName )

END CHOOSE
NEXT


That's just what comes to mind off the top of my head...

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!

Resources

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