Solved

Datawindow Query

Posted on 2008-10-07
3
496 Views
Last Modified: 2013-12-26
Hi,

I have a datawindow control which i am using to assign different datawindow objects based on the selection of certain conditions. We have a AFC layer that contains objects specfic to our application which is basically inherited from the PFC layer. I have a function in one of the user objects defined in the AFC layer to format the sql's for all the datawindows dynamically based on the search condition selected by the users for each and every screen/report.
I want to perform an action based on the tag value of a column from a particular datawindow.  For ex.
lets assume we have datawindow  dw_1 which contains column1, colum2, column3.
I want to perform the following logic
If dw_1.object.column1.tag = 'OK' then
   <perform your check>
else if
   <do not perform your check>
End If.

this is a straight away method if i have only one datawindow control/object. In my case i need to get the column name of the appropriate datawindow object that is assigned to the datawindow control for a specific screen and then assign that column/control name to the command line 'dw_1.object.column1.tag ' to perfom the action i need. Can anybody shed me some light on how to go about this..

Please let me know if you need some more clarifications on my request.

Cheers
0
Comment
Question by:senmaddy
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 125 total points
ID: 22663061
you can use getcolumn() and gecolumnname() function to get the column no/name from a datawindow and then use Describe function to get the property value instead of '.object 'notation.

See code snippet for example

Regards
Sandeep

e.g.

string ls_colname,ls_val

ls_colname = dw_1.GetColumnName()

ls_val = dw_1.Describ(ls_colname+".tag")

If ls_val = 'OK' Then

<process1>

Else

<process2>

End If
 

OR

string ls_colno,ls_val
 

ls_colno = string(dw_1.GetColumn())

ls_val = dw_1.Describ("#"+ls_colno+".tag")

If ls_val = 'OK' Then

<process1>

Else

<process2>

End If

Open in new window

0
 

Author Comment

by:senmaddy
ID: 22667352
Hi Sandeep,

thanks for your hint. I could not get the column name in the user object function since only the base sql of the datawindow is passed to function as an string argument.  
Neverthless, i used describe method to satisfy my need as described below.

   ll_Poscolumn = Pos(ls_BeforeLike,".",1)
   ls_column_name = Trim(Mid(ls_BeforeLike,ll_Poscolumn+1))
//            ls_check_upper = idw_requestor.object.productcode.tag
   ls_check_upper = idw_requestor.Describe(ls_column_name+".tag")
   Messagebox('ls_check_upper',ls_check_upper)
      IF ls_check_upper <> 'NU' then
            <process1>
      ELSE
            <process2>
      END IF

Many thanks once again for your time on this issue.
0
 

Author Closing Comment

by:senmaddy
ID: 31503913
Many Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now