?
Solved

Dynamically create datawindow columns (not from database)

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
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 NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 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