[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Dynamically create datawindow columns (not from database)

Posted on 2006-06-17
3
Medium Priority
?
2,837 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
[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 18

Accepted Solution

by:
diasroshan earned 1500 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

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

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. …
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 use and create new code templates in NetBeans IDE 8.0 for Windows.

649 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