Solved

Datawindow Query

Posted on 2008-10-07
3
498 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
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.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

830 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