Solved

Datawindow Query

Posted on 2008-10-07
3
500 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
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 column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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…

696 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