Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Help to create correct systax for mofiy function...

2 posts in DataWindow .NET Last posting was on 2004-09-17 03:04:48.0Z
MDesai Posted on 2004-09-17 02:12:40.0Z
Sender: 79a9.414a4479.1804289383@sybase.com
From: Mdesai
Newsgroups: sybase.public.datawindow.net
Subject: Help to create correct systax for mofiy function...
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <414a49d7.79eb.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 16 Sep 2004 19:20:07 -0700, 10.22.241.42
Lines: 38
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 16 Sep 2004 19:00:25 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 16 Sep 2004 19:12:40 -0700
X-Trace: forums-1-dub 1095387160 10.22.108.75 (16 Sep 2004 19:12:40 -0700)
X-Original-Trace: 16 Sep 2004 19:12:40 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:389
Article PK: 124820

I am using datawindow that require dynamically generated
computed fields. This is common in our business, I believe
this should work in DW.NET too

Syntax(C#)
--------------
ls_str="create compute(band=detail alignment=\"0\"
expression=\""+ls_resp+"\" border=\"5\" color=\"0\"
x=\"686\" y=\""+ll_y+"\" height=\"76\" width=\"1371\"
format=\"\" name="+ls_field+" visible=\"1\"
font.face=\"Arial\" font.height=\"-10\" font.weight=\"700\"
font.family=\"2\" font.pitch=\"2\" font.charset=\"0\"
background.mode=\"2\" background.color=\"12632256\" )";

try
{
idsAssnt.Modify( ls_str );
ll_y += 100;
}
catch (Sybase.DataWindow.MethodFailureException ex)
{
this.isLastError=ex.Message;
return false;
}


Syntax in (PowerBuilder 10.0)
----------------------------------
ls_str = "create compute(band=detail alignment=~"0~"
border=~"0~" color=~"0~" " + &
"x=~"18100~" y=~"" + String(ll_y) + "~" height=~"76~"
width=~"256~" format=~"~" font.face=~"Arial~" " + &
"font.height=~"-12~" font.weight=~"400~" font.family=~"2~"
font.pitch=~"2~" font.charset=~"0~" " + &
"background.mode=~"2~" background.color=~"15793151~"
expression=" + ls_resp + " name=" + ls_field + ")"

ls_str = dw_assnt.Modify( ls_str )


dfish Posted on 2004-09-17 03:04:48.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: Help to create correct systax for mofiy function...
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <414a4fb6.94839361@forums.sybase.com>
References: <414a49d7.79eb.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vpn-dub-022.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-022.sybase.com
Date: 16 Sep 2004 20:04:48 -0700
X-Trace: forums-1-dub 1095390288 10.22.120.22 (16 Sep 2004 20:04:48 -0700)
X-Original-Trace: 16 Sep 2004 20:04:48 -0700, vpn-dub-022.sybase.com
Lines: 90
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:390
Article PK: 124819

Did you use the DataWindow Syntax tool in DataWindow Designer? Here is
what it generates for a computed field:

<DW Control Name>.Modify(
"create compute(band=<Detail, Footer, Header, Header.<group #>,
Summary, Trailer.<group #>, Background, Foreground>" +
" color='<a long>' alignment='<0 - Left, 1 - Right, 2 - Center>'
border='<0 - None, 1- Shadow, 2 - Box, 3 - Resize, 4 - Underline, 5 -
3D Lowered, 6 - 3D Raised>'" +
" height.autosize=<Yes or No> pointer='<Arrow!, Cross!, HourGlass!,
IBeam!, Icon!, Size!, SizeNESW!, SizeNS!, SizeNWSE!, SizeWE!,
UpArrow!, or cursor filename (with path)>' moveable=<0 - False, 1 -
True> resizeable=<0 - False, 1 - True> x='<an integer>' y='<an
integer>' height='<an integer>' width='<an integer>' format='<constant
string containing display format (i.e., [general]) for col (can also
be an expression)>'" +
" name=<string> tag='<string>' expression='<expression>'
font.face='<name of type face (i.e., SYSTEM, COURIER)>'
font.height='<negative number for points, positive number for PBUs
(i.e., -10 = 10 points, 10 = 10 PBUs>' font.weight='<400 - Normal, 700
- Bold>' font.family='<0 - AnyFont, 1 - Roman, 2 - Swiss, 3 - Modern,
4 - Script, 5 - Decorative>' font.pitch='<0 - default, 1 - Fixed, 2 -
Variable>' font.charset='<0 - Ansi, 1 - default, 2 - Symbol, 128 -
Shift JIS, 255 - OEM>' font.italic='<0 - False, 1 - True>'
font.strikethrough='<0 - False, 1 - True>' font.underline='<0 - False,
1 - True>' background.mode='<0 - Opaque, 1 - Transparent>'
background.color='<a long>')")

Another option is to create the computed field in the DataWindow
painter, export the object, and copy the code from the exported
syntax:

<DW Control Name>.Modify( band=detail alignment="1" expression="avg(
salary for all )"border="0" color="33554432" x="2789" y="4"
height="60" width="334" format="[currency]" html.valueishtml="0"
name=example visible="1" font.face="MS Sans Serif" font.height="-8"
font.weight="400" font.family="2" font.pitch="2" font.charset="0"
background.mode="2" background.color="1073741824")

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 16 Sep 2004 19:12:40 -0700, Mdesai wrote:

>I am using datawindow that require dynamically generated
>computed fields. This is common in our business, I believe
>this should work in DW.NET too
>
>Syntax(C#)
>--------------
>ls_str="create compute(band=detail alignment=\"0\"
>expression=\""+ls_resp+"\" border=\"5\" color=\"0\"
>x=\"686\" y=\""+ll_y+"\" height=\"76\" width=\"1371\"
>format=\"\" name="+ls_field+" visible=\"1\"
>font.face=\"Arial\" font.height=\"-10\" font.weight=\"700\"
>font.family=\"2\" font.pitch=\"2\" font.charset=\"0\"
>background.mode=\"2\" background.color=\"12632256\" )";
>
>try
>{
> idsAssnt.Modify( ls_str );
> ll_y += 100;
>}
>catch (Sybase.DataWindow.MethodFailureException ex)
>{
> this.isLastError=ex.Message;
> return false;
>}
>
>
>Syntax in (PowerBuilder 10.0)
>----------------------------------
>ls_str = "create compute(band=detail alignment=~"0~"
>border=~"0~" color=~"0~" " + &
>"x=~"18100~" y=~"" + String(ll_y) + "~" height=~"76~"
>width=~"256~" format=~"~" font.face=~"Arial~" " + &
>"font.height=~"-12~" font.weight=~"400~" font.family=~"2~"
>font.pitch=~"2~" font.charset=~"0~" " + &
>"background.mode=~"2~" background.color=~"15793151~"
>expression=" + ls_resp + " name=" + ls_field + ")"
>
>ls_str = dw_assnt.Modify( ls_str )