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.

Crosstab datawindow

4 posts in DataWindow Last posting was on 2010-01-07 09:03:16.0Z
Murat Yelkovan Posted on 2010-01-05 22:26:13.0Z
From: "Murat Yelkovan" <muratyelkovan@yahoo.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Crosstab datawindow
Lines: 28
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-9"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6002.18005
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b43bc85@forums-1-dub>
Date: 5 Jan 2010 14:26:13 -0800
X-Trace: forums-1-dub 1262730373 10.22.241.152 (5 Jan 2010 14:26:13 -0800)
X-Original-Trace: 5 Jan 2010 14:26:13 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90534
Article PK: 410139

Hi everybody

Please look at following script.
Everyting seems to be ok. But after changing width of the column, all data,
what I changed with setitem will be lost.


//retrieve data (CROSSTAB datawindow)
dw_1.settransobject(sqlca)
dw_1.retrieve()

//change data
dw_1.setitem(1,"val_1","L")
dw_1.setitem(2,"val_2","L")
dw_1.setitem(3,"val_1","L")
dw_1.setitem(4,"val_4","L")
dw_1.accepttext() //actually no need but to be sure

// user resized window, so resize colums
this.object.val.width=string(100)

There are no more L on datawindow.. ?????


Ivaylo Ivanov Posted on 2010-01-06 16:04:30.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b43bc85@forums-1-dub>
Subject: Re: Crosstab datawindow
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b44b48e$1@forums-1-dub>
Date: 6 Jan 2010 08:04:30 -0800
X-Trace: forums-1-dub 1262793870 10.22.241.152 (6 Jan 2010 08:04:30 -0800)
X-Original-Trace: 6 Jan 2010 08:04:30 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90537
Article PK: 410142

What's your current crosstab mode? Static or dynamic one? (the crosstab
option "Rebuild columns at runtime")
Try to stay in static mode to preserve your changes, but before next
retrieval switch temporarily to dynamic mode.

Switching between the modes can be done with
Modify("Datawindow.Crosstab.StaticMode='yes'") or 'no'.

If "val" is your dynamic crosstab column, consider that its first instance
name is "val". I notice that in your script you are referencing the next
instances "val_1", "val_2" etc, but not this first column.

Accepttext() is useless for crosstabs

Regards,
Ivaylo

"Murat Yelkovan" <muratyelkovan@yahoo.com> wrote in message
news:4b43bc85@forums-1-dub...
> Hi everybody
>
> Please look at following script.
> Everyting seems to be ok. But after changing width of the column, all
> data, what I changed with setitem will be lost.
>
>
> //retrieve data (CROSSTAB datawindow)
> dw_1.settransobject(sqlca)
> dw_1.retrieve()
>
> //change data
> dw_1.setitem(1,"val_1","L")
> dw_1.setitem(2,"val_2","L")
> dw_1.setitem(3,"val_1","L")
> dw_1.setitem(4,"val_4","L")
> dw_1.accepttext() //actually no need but to be sure
>
> // user resized window, so resize colums
> this.object.val.width=string(100)
>
> There are no more L on datawindow.. ?????
>
>
>
>
>
>


Murat Yelkovan Posted on 2010-01-06 20:32:00.0Z
From: "Murat Yelkovan" <muratyelkovan@yahoo.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b43bc85@forums-1-dub> <4b44b48e$1@forums-1-dub>
In-Reply-To: <4b44b48e$1@forums-1-dub>
Subject: Re: Crosstab datawindow
Lines: 95
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-9"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6002.18005
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b44f340@forums-1-dub>
Date: 6 Jan 2010 12:32:00 -0800
X-Trace: forums-1-dub 1262809920 10.22.241.152 (6 Jan 2010 12:32:00 -0800)
X-Original-Trace: 6 Jan 2010 12:32:00 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90539
Article PK: 410144

Hi Ivaylo

You are right, your answer is excellent.
Staying in static mode solved the problem
Now I have to resize all columns but it is not so big problem.
Thanks



dw_1.setredraw( false)
ls_modify=" val.width = " + ls_size +&
" val_1.width = " + ls_size +&
" val_2.width = " + ls_size +&
" val_3.width = " + ls_size +&
" val_4.width = " + ls_size +&
" val_5.width = " + ls_size +&
" val_6.width = " + ls_size +&
" val_7.width = " + ls_size +&
" val_8.width = " + ls_size +&
" val_9.width = " + ls_size +&
" val_10.width = " + ls_size +&
" val_11.width = " + ls_size +&
" val_12.width = " + ls_size +&
" val_13.width = " + ls_size +&
" val_14.width = " + ls_size +&
" val_15.width = " + ls_size +&
" val_16.width = " + ls_size +&
" val_17.width = " + ls_size +&
" val_18.width = " + ls_size +&
" val_19.width = " + ls_size +&
" val_20.width = " + ls_size +&
" val_21.width = " + ls_size +&
" val_22.width = " + ls_size +&
" val_23.width = " + ls_size +&
" val_24.width = " + ls_size +&
" val_25.width = " + ls_size +&
" val_26.width = " + ls_size +&
" val_27.width = " + ls_size +&
" val_28.width = " + ls_size
dw_1.modify(ls_modify)
dw_1.setredraw( true)

"Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com> wrote in message
news:4b44b48e$1@forums-1-dub...
> What's your current crosstab mode? Static or dynamic one? (the crosstab
> option "Rebuild columns at runtime")
> Try to stay in static mode to preserve your changes, but before next
> retrieval switch temporarily to dynamic mode.
>
> Switching between the modes can be done with
> Modify("Datawindow.Crosstab.StaticMode='yes'") or 'no'.
>
> If "val" is your dynamic crosstab column, consider that its first instance
> name is "val". I notice that in your script you are referencing the next
> instances "val_1", "val_2" etc, but not this first column.
>
> Accepttext() is useless for crosstabs
>
> Regards,
> Ivaylo
>
> "Murat Yelkovan" <muratyelkovan@yahoo.com> wrote in message
> news:4b43bc85@forums-1-dub...
>> Hi everybody
>>
>> Please look at following script.
>> Everyting seems to be ok. But after changing width of the column, all
>> data, what I changed with setitem will be lost.
>>
>>
>> //retrieve data (CROSSTAB datawindow)
>> dw_1.settransobject(sqlca)
>> dw_1.retrieve()
>>
>> //change data
>> dw_1.setitem(1,"val_1","L")
>> dw_1.setitem(2,"val_2","L")
>> dw_1.setitem(3,"val_1","L")
>> dw_1.setitem(4,"val_4","L")
>> dw_1.accepttext() //actually no need but to be sure
>>
>> // user resized window, so resize colums
>> this.object.val.width=string(100)
>>
>> There are no more L on datawindow.. ?????
>>
>>
>>
>>
>>
>>
>
>


Ivaylo Ivanov Posted on 2010-01-07 09:03:16.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b43bc85@forums-1-dub> <4b44b48e$1@forums-1-dub> <4b44f340@forums-1-dub>
Subject: Re: Crosstab datawindow
Lines: 124
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b45a354$1@forums-1-dub>
Date: 7 Jan 2010 01:03:16 -0800
X-Trace: forums-1-dub 1262854996 10.22.241.152 (7 Jan 2010 01:03:16 -0800)
X-Original-Trace: 7 Jan 2010 01:03:16 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90543
Article PK: 410149

That's fine!
Your script seems ok for me with just one little optimization to make it
more general:

string ls_objects[]
long i

// Parse <Tab>-separated string containing all object names within the DW
into a string array
f_string_parse_into_array(dw_1.Describe("Datawindow.Objects"), ls_objects)

dw_1.setredraw(false)

for i = 1 to UpperBound(ls_objects)
if Left(ls_objects[i], len("val")) <> "val" then continue
if dw_1.Describe(ls_objects[i] + ".Band") <> "detail" then continue
ls_modify = ls_modify + " " + ls_objects[i] + ".Width=" + ls_size
next

dw_1.modify(ls_modify)
dw_1.setredraw(true)

Best regards,
Ivaylo

"Murat Yelkovan" <muratyelkovan@yahoo.com> wrote in message
news:4b44f340@forums-1-dub...
> Hi Ivaylo
>
> You are right, your answer is excellent.
> Staying in static mode solved the problem
> Now I have to resize all columns but it is not so big problem.
> Thanks
>
>
>
> dw_1.setredraw( false)
> ls_modify=" val.width = " + ls_size +&
> " val_1.width = " + ls_size +&
> " val_2.width = " + ls_size +&
> " val_3.width = " + ls_size +&
> " val_4.width = " + ls_size +&
> " val_5.width = " + ls_size +&
> " val_6.width = " + ls_size +&
> " val_7.width = " + ls_size +&
> " val_8.width = " + ls_size +&
> " val_9.width = " + ls_size +&
> " val_10.width = " + ls_size +&
> " val_11.width = " + ls_size +&
> " val_12.width = " + ls_size +&
> " val_13.width = " + ls_size +&
> " val_14.width = " + ls_size +&
> " val_15.width = " + ls_size +&
> " val_16.width = " + ls_size +&
> " val_17.width = " + ls_size +&
> " val_18.width = " + ls_size +&
> " val_19.width = " + ls_size +&
> " val_20.width = " + ls_size +&
> " val_21.width = " + ls_size +&
> " val_22.width = " + ls_size +&
> " val_23.width = " + ls_size +&
> " val_24.width = " + ls_size +&
> " val_25.width = " + ls_size +&
> " val_26.width = " + ls_size +&
> " val_27.width = " + ls_size +&
> " val_28.width = " + ls_size
> dw_1.modify(ls_modify)
> dw_1.setredraw( true)
>
>
> "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com> wrote in message
> news:4b44b48e$1@forums-1-dub...
>> What's your current crosstab mode? Static or dynamic one? (the crosstab
>> option "Rebuild columns at runtime")
>> Try to stay in static mode to preserve your changes, but before next
>> retrieval switch temporarily to dynamic mode.
>>
>> Switching between the modes can be done with
>> Modify("Datawindow.Crosstab.StaticMode='yes'") or 'no'.
>>
>> If "val" is your dynamic crosstab column, consider that its first
>> instance name is "val". I notice that in your script you are referencing
>> the next instances "val_1", "val_2" etc, but not this first column.
>>
>> Accepttext() is useless for crosstabs
>>
>> Regards,
>> Ivaylo
>>
>> "Murat Yelkovan" <muratyelkovan@yahoo.com> wrote in message
>> news:4b43bc85@forums-1-dub...
>>> Hi everybody
>>>
>>> Please look at following script.
>>> Everyting seems to be ok. But after changing width of the column, all
>>> data, what I changed with setitem will be lost.
>>>
>>>
>>> //retrieve data (CROSSTAB datawindow)
>>> dw_1.settransobject(sqlca)
>>> dw_1.retrieve()
>>>
>>> //change data
>>> dw_1.setitem(1,"val_1","L")
>>> dw_1.setitem(2,"val_2","L")
>>> dw_1.setitem(3,"val_1","L")
>>> dw_1.setitem(4,"val_4","L")
>>> dw_1.accepttext() //actually no need but to be sure
>>>
>>> // user resized window, so resize colums
>>> this.object.val.width=string(100)
>>>
>>> There are no more L on datawindow.. ?????
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>