Solved

Concatinating old value and new value for modified columns.

Posted on 2006-06-15
2
368 Views
Last Modified: 2013-12-26
We have 10 detail rows in detail window. If the user double clicks one particular row then it opens the response window with all the 15 columns. So he can modify any values of 15 columns. Once he finished that then he press ok button. So the response window is automatically closed and the modified column/s value/s displayed on the detail window.
Right now the existing program is doing as
Suppose he double clicks on one row and does some modifications out of 15 columns and press ok button, it automatically closed and modified that particular row.
Let’s say he did modifications on two rows out of 10 rows. The existing program is passing 2 rows { ls_uc_row [1]  , ls_uc_row [2] } to update procedure, the remaining values {{ ls_uc_row [3]  , ls_uc_row [4]…ls_uc_row [10]  }are spaces.
Each row like ls_uc_row [1]  { ls_field[1] + ls_field[2] + …. + ls_field[15] }

I need to do find the old value and new value for modified values as well as description of that particular column out of 15 columns. So each modified row I need to add modified fields as [column_desc(char20)+old_value(char10)+new_value(char10)]. If he modified 4 columns out of 15, I need to add 4 more fields for the particular row like the above format.

Thanks for your advance help.
0
Comment
Question by:venkat4sv
2 Comments
 
LVL 6

Accepted Solution

by:
tr1l0b1t earned 125 total points
Comment Utility
Hi,

Assuming you'd like to fill 'ls_uc_row' array with dw_1 changes ...

String ls_uc_row[]
Long ll_idx = 1

String ls_format, ls_old, ls_new, ls_colname
Long ll_col, ll_cols, ll_row, ll_rows

ll_rows = dw_1.RowCount()      // Nº of rows should be always 1
ll_cols = Long(dw_1.Describe("DataWindow.Column.Count"))

For ll_row = 1 To ll_rows
     For ll_col = 1 to ll_cols
          If dw_1.GetItemStatus(ll_row, ll_col, Primary!) = DataModified! Then
               ls_colname = dw_1.Describe("#" + String(ll_col) + ".name")
               // We'll get the data in same format as defined in dw
               ls_format = dw_1.GetFormat(ll_col)
               // Get old and new values
               ls_old = String(dw_1.Object.Data.Primary.Original[ll_row, ll_col], ls_format)
               ls_new = String(dw_1.Object.Data.Primary.Current[ll_row, ll_col], ls_format)
               // Fill in the array and right pad values with spaces
               ls_uc_row[ll_idx] = ls_colname + Fill(" ", 20 - Len(ls_colname)) + &
                                            ls_old + Fill(" ", 10 - Len(ls_old)) + &
                                            ls_new + Fill(" ", 10 - Len(ls_new))
               ll_idx ++
          End If
     Next
Next

Hope it helps
Regards
0
 

Author Comment

by:venkat4sv
Comment Utility
But I’m not getting proper values.
We have One window(w_master) and two datawindows (dw_1 & dw_2) with in the window. The second dw has detail rows. The maximum detail rows are 10 and each one has 15 columns. If we click one particular row it will open one response window with previous values. Here we are changing the value/s and click ok then it closes automatically and goes to our first window(w_master) with modified value/s in detail row. When we hit save button on first window they are passing only changed rows (15columns) as an array type to update procedure. I need to add modified columns at the end of each modified row like desc+prev_value+new_value.
Thanks for your help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
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 use and create keystrokes in Netbeans IDE 8.0 for Windows.

744 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

15 Experts available now in Live!

Get 1:1 Help Now