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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User search function

Status
Not open for further replies.

mistermusic

Programmer
Jun 10, 2009
9
0
0
US
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
 
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...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top