Solved

Datawindow modify expression, length property.

Posted on 2004-08-20
7
1,016 Views
Last Modified: 2013-12-26
I have come across a very strange limitation of pb7 (maybe I am wrong).

To be very brief I have a datawindow control dw_1 with external dataobject d_external.
d_external has one column s_column_1 whoose length is 11. I want to change that length to 20 at runtime.

I am successfully doing these:
s_expr_width      =  "s_column_1.width="+string(a_stparm.first_col_width*30)
s_expr_edit_limit =  "s_column_1.edit.limit="+string(a_stparm.first_col_width)   //first_col_width has got value 20
ret_value=dw_1.Modify(s_expr_width)
ret_value=dw_1.Modify(s_expr_edit_limit)

I mean, I am able to modify width and edit limit propery but I don't know what is the name of length propetry.

Dear expert, I would be able to give any feedback tomorrow.(Please forgive)
0
Comment
Question by:Mateen
  • 3
  • 3
7 Comments
 
LVL 8

Accepted Solution

by:
Vikas_Dixit earned 250 total points
ID: 11856524
I guess u r talking abt the type or coltype property. Both the properties are describe only.
so only option is to do the change in dw syntax and re-create dw using the dw.Create() method.

Regards,
VIkas D
0
 

Author Comment

by:Mateen
ID: 11857813

Hi vikas:

If I export d_external then a line from d_external.srd is:

table(column=(type=char(11) updatewhereclause=no name=s_column_1_ddw dbname="s_column_1" )

I want to change char(11) with char(20). I am wondering why this facility is not provided in modify properties.
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 11857861
hi mateen,

type = char(11) as posted by u...

here char(11) is the database column length and datatype....

there is no way by which this can be changed by PB coz this is only the database column specification which the datawindow is showing...

to have a change of length u need to do necessary alteration in ur backend... alter the length of ur column to 20 and then only can the datawindow show the change of length....

do ask for more assistance...

Cheers,
Rosh
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
LVL 18

Expert Comment

by:diasroshan
ID: 11857869
hi,

oops i'm sorry... u are refering to an external dw... well then there's no talk about altering the backend...sorry..

i don't think its possible to change the column length dynamically unless manually doing it in the case of external dw...

Rosh
0
 

Author Comment

by:Mateen
ID: 11857945
Hi vikas:

Agreed that create method is the only option.

In the open event doing this

string ls_syntax
long position,RETVALUE
ls_syntax=dw_1.object.datawindow.syntax
messagebox('ORIGINAL SYNTAX',ls_syntax)
position=pos(ls_syntax,'char(11)')
ls_syntax=replace(ls_syntax,position,8,'char(20)')
messagebox('CHANGED SYNTAX',ls_syntax)
ls_syntax=dw_1.object.datawindow.syntax
RETVALUE=dw_1.create(ls_syntax)
MESSAGEBOX('SUCCESS/FAILURE OF CREATE',STRING(RETVALUE))
dw_1.settransobject(sqlca)
ls_syntax=dw_1.object.datawindow.syntax
messagebox('NEW SYNTAX',ls_syntax)

retvalue shows 1 meaning successful creation. But   ls_syntax=dw_1.object.datawindow.syntax after recreation is showing old values.
0
 
LVL 18

Assisted Solution

by:diasroshan
diasroshan earned 250 total points
ID: 11857969
hi mateen,
i guess i found the error in the code pasted by u...

just remove/comment the line..
'ls_syntax=dw_1.object.datawindow.syntax'
before the line...
'RETVALUE=dw_1.create(ls_syntax)'

u r getting the wrong 'ls_syntax' before dw_1.create


hope that helps...

Cheers,
Rosh
0
 

Author Comment

by:Mateen
ID: 11858005
U r right rosh.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Refresh JTable Content 6 210
eclipse find/step into stored procedure 3 189
Configure a Local PHP Interpreter for Phpstorm 2 332
Online file editor, manager 6 85
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 keystrokes in Netbeans IDE 8.0 for Windows.

809 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