Solved

Dynamically create datawindow columns (not from database)

Posted on 2006-06-17
3
2,767 Views
Last Modified: 2013-12-26
Hi everyone,

I know this has been done before, but I can't seem to get the syntax right.

I have a datawindow grid that I created.  I had to pick at least one column to create the datawindow.  I then deleted the first column.  Basically, I want a blank DW in order to dynamically create my new columns.

I keep running the code below.  NO ERRORS. But no data showing up either.

Please help!!  PEM

Here is some of the code that I have been trying:

//dw_1.Modify("create column(1)")
dw_1.Modify("create column(band=detail id=1 name=1)")
//dw_original.modify('create column(name=new_column visible="1" band=detail id=' + s_id + ' x=.........')
dw_1.modify('create column(name=1 visible="1" band=detail')


dw_1.Modify("create column(2)")
dw_1.Modify("create column(3)")
dw_1.Modify("create column(4)")
dw_1.Modify("create column(5)")
dw_1.Modify("create column(6)")

newrow = dw_1.insertrow(0)

dw_1.setitem(newrow,1,5)

dw_1.Modify("t1.text="+"BERGEN")
//dw_1.Modify("object.t1.Name="+"MORRIS")

0
Comment
Question by:pemurray
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
diasroshan earned 500 total points
ID: 16957381
Hi,

i dont think u can add columns using modify... there are various ways to achieve what u want... i mean, i need to know exactly what u want to do... what i understand is u want to create a dynamic DW...

just check this PB example from the Help...

string error_syntaxfromSQL, error_create
string new_sql, new_syntax

new_sql = 'SELECT emp_data.emp_id, ' &
        + 'emp_data.emp_name ' &
        + 'from emp_data ' &
        + 'WHERE emp_data.emp_salary>45000'

new_syntax = SQLCA.SyntaxFromSQL(new_sql, &
        'Style(Type=Grid)', error_syntaxfromSQL)

IF Len(error_syntaxfromSQL) > 0 THEN
        // Display errors
        mle_sfs.Text = error_syntaxfromSQL
ELSE
        // Generate new DataWindow
        dw_new.Create(new_syntax, error_create)
        IF Len(error_create) > 0 THEN
            mle_create.Text = error_create
        END IF
END IF

dw_new.SetTransObject(SQLCA)
dw_new.Retrieve()

//Check the above example and tell me what u want exactly... will help u achieve what u want...

Cheers,
Rosh
0
 

Author Comment

by:pemurray
ID: 16960667
*********HELLO ALL************

SOMEHOW I ENDED UP WITH TWO QUESTIONS

THE TITLE IS DUPLICATED FROM ONE QUESTION AND THE CONTENT IS DUPLICATED FROM A DIFFERENT QUESTION.

Diasroshan already responded to the correct question and I am working that thread.

This can be closed.

Thank you,

Paul
0
 

Author Comment

by:pemurray
ID: 17063378
Hi Rosh,

I closed this question and you received the points.  Sorry, I clicked on B instead of A.  Your answer was perfect outside of the context.  Can you get an adminstrator to give you the right grade.

My apologies!!

Paul
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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: …
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.

757 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

23 Experts available now in Live!

Get 1:1 Help Now