Solved

Dynamically create datawindow columns (not from database)

Posted on 2006-06-17
3
2,783 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
populate value from mongo db in java 98 340
selectallvieditor 6 115
How to find missing packages when using Netbeans IDE 8.1 ? 19 54
PHPStorm debugging issues 1 46
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 use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

803 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