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.

using evaluate in header and footer band

12 posts in DataWindow Last posting was on 2008-05-30 10:50:38.0Z
Chris Werner Posted on 2008-05-28 09:23:03.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: using evaluate in header and footer band
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483d2477$1@forums-1-dub>
Date: 28 May 2008 02:23:03 -0700
X-Trace: forums-1-dub 1211966583 10.22.241.152 (28 May 2008 02:23:03 -0700)
X-Original-Trace: 28 May 2008 02:23:03 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86976
Article PK: 416232

Hi,

the evaluate datawindow function takes the row
number as second argument:

"evaluate('expression', rownumber)"

for example:

dw_1.describe("evaluate('if(salary>90000,255,0)',3)")

Is it possible to evaluate expressions in bands other
than the detail band? Which row number tu use?

TIA

Chris Werner
f+s software gmbh


Jeremy Lakeman Posted on 2008-05-28 12:37:28.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: using evaluate in header and footer band
References: <483d2477$1@forums-1-dub>
In-Reply-To: <483d2477$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483d5208@forums-1-dub>
Date: 28 May 2008 05:37:28 -0700
X-Trace: forums-1-dub 1211978248 10.22.241.152 (28 May 2008 05:37:28 -0700)
X-Original-Trace: 28 May 2008 05:37:28 -0700, vip152.sybase.com
Lines: 35
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86978
Article PK: 416235


Chris Werner wrote:
> Hi,
>
> the evaluate datawindow function takes the row
> number as second argument:
>
> "evaluate('expression', rownumber)"
>
> for example:
>
> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>
> Is it possible to evaluate expressions in bands other
> than the detail band? Which row number tu use?
>
> TIA
>
> Chris Werner
> f+s software gmbh
>
>

There are no other bands than detail rows. At least as far as the data
is concerned.

Let me qualify that statement a little. The only difference between a
computed field in the detail row and one in a header or summary band is
how it is displayed. The computed field has a value that can be
evaluated or extracted in every detail row. The value that is shown in
the header or summary band for a column or computed field, is the same
value that would be displayed on the closest detail row.

However there is nothing stopping you from evaluating an expression that
includes aggregate functions;

dw_1.describe("evaluate('avg(salary for group 1)',3)")


Chris Werner Posted on 2008-05-28 13:51:43.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483d636f@forums-1-dub>
Date: 28 May 2008 06:51:43 -0700
X-Trace: forums-1-dub 1211982703 10.22.241.152 (28 May 2008 06:51:43 -0700)
X-Original-Trace: 28 May 2008 06:51:43 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86979
Article PK: 416236

Hi Jeremy,

thanks for the help. My example was not good to
explayn what I'm after. I have objects (columns or
computed expressions) in the footer band and need
the result from the lookupdisplay() datawindow
function for this objects. I'm using this expression:

evaluate('lookupdisplay(avisnr_f1)', 1)

as argument for the dw.describe() function. That
raises a box saying "Invalid argument to function"
Have also tried the actual rowcount instead of the
1 above which results in the same error.

I need the actual displayed content of the objects
to make a grid dw autowidth service aware of
the cumulated fields which are mostly wider than
the values in the detail row.

Best regards

Chris Werner
f+s software gmbh

"Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
news:483d5208@forums-1-dub...

> Chris Werner wrote:
>> Hi,
>>
>> the evaluate datawindow function takes the row
>> number as second argument:
>>
>> "evaluate('expression', rownumber)"
>>
>> for example:
>>
>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>
>> Is it possible to evaluate expressions in bands other
>> than the detail band? Which row number tu use?
>>
>> TIA
>>
>> Chris Werner
>> f+s software gmbh
> There are no other bands than detail rows. At least as far as the data is
> concerned.
>
> Let me qualify that statement a little. The only difference between a
> computed field in the detail row and one in a header or summary band is
> how it is displayed. The computed field has a value that can be evaluated
> or extracted in every detail row. The value that is shown in the header or
> summary band for a column or computed field, is the same value that would
> be displayed on the closest detail row.
>
> However there is nothing stopping you from evaluating an expression that
> includes aggregate functions;
>
> dw_1.describe("evaluate('avg(salary for group 1)',3)")


Philip Salgannik Posted on 2008-05-28 16:15:53.0Z
Reply-To: "Philip Salgannik" <PhilipSalgannik@work.com>
From: "Philip Salgannik" <PhilipSalgannik@work.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 71
Organization: ATWORK
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483d8539$1@forums-1-dub>
Date: 28 May 2008 09:15:53 -0700
X-Trace: forums-1-dub 1211991353 10.22.241.152 (28 May 2008 09:15:53 -0700)
X-Original-Trace: 28 May 2008 09:15:53 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86980
Article PK: 416237

Not sure what are you hoping to achieve with an expression based on
lookupdisplay if the goal is to calculate the biggest width.
You need to do this in code, looping thru the rows and figuring out the
longest string returned by lookupdisplay...

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
news:483d636f@forums-1-dub...
> Hi Jeremy,
>
> thanks for the help. My example was not good to
> explayn what I'm after. I have objects (columns or
> computed expressions) in the footer band and need
> the result from the lookupdisplay() datawindow
> function for this objects. I'm using this expression:
>
> evaluate('lookupdisplay(avisnr_f1)', 1)
>
> as argument for the dw.describe() function. That
> raises a box saying "Invalid argument to function"
> Have also tried the actual rowcount instead of the
> 1 above which results in the same error.
>
> I need the actual displayed content of the objects
> to make a grid dw autowidth service aware of
> the cumulated fields which are mostly wider than
> the values in the detail row.
>
> Best regards
>
> Chris Werner
> f+s software gmbh
>
> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
> news:483d5208@forums-1-dub...
>> Chris Werner wrote:
>>> Hi,
>>>
>>> the evaluate datawindow function takes the row
>>> number as second argument:
>>>
>>> "evaluate('expression', rownumber)"
>>>
>>> for example:
>>>
>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>
>>> Is it possible to evaluate expressions in bands other
>>> than the detail band? Which row number tu use?
>>>
>>> TIA
>>>
>>> Chris Werner
>>> f+s software gmbh
>> There are no other bands than detail rows. At least as far as the data is
>> concerned.
>>
>> Let me qualify that statement a little. The only difference between a
>> computed field in the detail row and one in a header or summary band is
>> how it is displayed. The computed field has a value that can be evaluated
>> or extracted in every detail row. The value that is shown in the header
>> or summary band for a column or computed field, is the same value that
>> would be displayed on the closest detail row.
>>
>> However there is nothing stopping you from evaluating an expression that
>> includes aggregate functions;
>>
>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>
>


Chris Werner Posted on 2008-05-29 09:22:10.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub> <483d8539$1@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 99
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483e75c2@forums-1-dub>
Date: 29 May 2008 02:22:10 -0700
X-Trace: forums-1-dub 1212052930 10.22.241.152 (29 May 2008 02:22:10 -0700)
X-Original-Trace: 29 May 2008 02:22:10 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86988
Article PK: 416246

Hi Philip,

> Not sure what are you hoping to achieve with an expression based on
> lookupdisplay if the goal is to calculate the biggest width.

Why? I don' understand your scepticism here. Using lookupdisplay
I get the string displayed and can calculate the needed width. Looping
through the rows I get the maximum width needed for all values in
the detail band. Comparing that to the needed width for the headline
of the column (describe('avisnr_t.text')) and choosing the maximum
I'm almost fine. Only that damn totals in the summary or footer band
appear crappy if they are wider than the detail values and the headline.
If possible I'd factor them into the calculation. Therefore I use a standard
naming convention similar to the _t for headline texts. I use _f1, ... _f5
for fields in the footer and _s1, ..., _s5 for fields in the summary band.
If evaluate('lookupdisplay(avisnr_f1)', 1) would give me the displayed
text for the field avisnr_f1 which is placed in the footer band I'd be
fine and ready. But it doesn't ... :-(


Chris Werner
f+s software gmbh


"Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
news:483d8539$1@forums-1-dub...
> Not sure what are you hoping to achieve with an expression based on
> lookupdisplay if the goal is to calculate the biggest width.
> You need to do this in code, looping thru the rows and figuring out the
> longest string returned by lookupdisplay...
>
> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
> news:483d636f@forums-1-dub...
>> Hi Jeremy,
>>
>> thanks for the help. My example was not good to
>> explayn what I'm after. I have objects (columns or
>> computed expressions) in the footer band and need
>> the result from the lookupdisplay() datawindow
>> function for this objects. I'm using this expression:
>>
>> evaluate('lookupdisplay(avisnr_f1)', 1)
>>
>> as argument for the dw.describe() function. That
>> raises a box saying "Invalid argument to function"
>> Have also tried the actual rowcount instead of the
>> 1 above which results in the same error.
>>
>> I need the actual displayed content of the objects
>> to make a grid dw autowidth service aware of
>> the cumulated fields which are mostly wider than
>> the values in the detail row.
>>
>> Best regards
>>
>> Chris Werner
>> f+s software gmbh
>>
>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
>> news:483d5208@forums-1-dub...
>>> Chris Werner wrote:
>>>> Hi,
>>>>
>>>> the evaluate datawindow function takes the row
>>>> number as second argument:
>>>>
>>>> "evaluate('expression', rownumber)"
>>>>
>>>> for example:
>>>>
>>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>>
>>>> Is it possible to evaluate expressions in bands other
>>>> than the detail band? Which row number tu use?
>>>>
>>>> TIA
>>>>
>>>> Chris Werner
>>>> f+s software gmbh
>>> There are no other bands than detail rows. At least as far as the data
>>> is concerned.
>>>
>>> Let me qualify that statement a little. The only difference between a
>>> computed field in the detail row and one in a header or summary band is
>>> how it is displayed. The computed field has a value that can be
>>> evaluated or extracted in every detail row. The value that is shown in
>>> the header or summary band for a column or computed field, is the same
>>> value that would be displayed on the closest detail row.
>>>
>>> However there is nothing stopping you from evaluating an expression that
>>> includes aggregate functions;
>>>
>>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>>
>>
>
>


Jeremy Lakeman Posted on 2008-05-29 12:20:25.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: using evaluate in header and footer band
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub> <483d8539$1@forums-1-dub> <483e75c2@forums-1-dub>
In-Reply-To: <483e75c2@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483e9f89$1@forums-1-dub>
Date: 29 May 2008 05:20:25 -0700
X-Trace: forums-1-dub 1212063625 10.22.241.152 (29 May 2008 05:20:25 -0700)
X-Original-Trace: 29 May 2008 05:20:25 -0700, vip152.sybase.com
Lines: 100
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86989
Article PK: 416245


Chris Werner wrote:
> Hi Philip,
>
>> Not sure what are you hoping to achieve with an expression based on
>> lookupdisplay if the goal is to calculate the biggest width.
>
> Why? I don' understand your scepticism here. Using lookupdisplay
> I get the string displayed and can calculate the needed width. Looping
> through the rows I get the maximum width needed for all values in
> the detail band. Comparing that to the needed width for the headline
> of the column (describe('avisnr_t.text')) and choosing the maximum
> I'm almost fine. Only that damn totals in the summary or footer band
> appear crappy if they are wider than the detail values and the headline.
> If possible I'd factor them into the calculation. Therefore I use a standard
> naming convention similar to the _t for headline texts. I use _f1, ... _f5
> for fields in the footer and _s1, ..., _s5 for fields in the summary band.
> If evaluate('lookupdisplay(avisnr_f1)', 1) would give me the displayed
> text for the field avisnr_f1 which is placed in the footer band I'd be
> fine and ready. But it doesn't ... :-(
>
>
> Chris Werner
> f+s software gmbh
>
>
> "Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
> news:483d8539$1@forums-1-dub...
>> Not sure what are you hoping to achieve with an expression based on
>> lookupdisplay if the goal is to calculate the biggest width.
>> You need to do this in code, looping thru the rows and figuring out the
>> longest string returned by lookupdisplay...
>>
>> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
>> news:483d636f@forums-1-dub...
>>> Hi Jeremy,
>>>
>>> thanks for the help. My example was not good to
>>> explayn what I'm after. I have objects (columns or
>>> computed expressions) in the footer band and need
>>> the result from the lookupdisplay() datawindow
>>> function for this objects. I'm using this expression:
>>>
>>> evaluate('lookupdisplay(avisnr_f1)', 1)
>>>
>>> as argument for the dw.describe() function. That
>>> raises a box saying "Invalid argument to function"
>>> Have also tried the actual rowcount instead of the
>>> 1 above which results in the same error.
>>>
>>> I need the actual displayed content of the objects
>>> to make a grid dw autowidth service aware of
>>> the cumulated fields which are mostly wider than
>>> the values in the detail row.
>>>
>>> Best regards
>>>
>>> Chris Werner
>>> f+s software gmbh
>>>
>>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
>>> news:483d5208@forums-1-dub...
>>>> Chris Werner wrote:
>>>>> Hi,
>>>>>
>>>>> the evaluate datawindow function takes the row
>>>>> number as second argument:
>>>>>
>>>>> "evaluate('expression', rownumber)"
>>>>>
>>>>> for example:
>>>>>
>>>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>>>
>>>>> Is it possible to evaluate expressions in bands other
>>>>> than the detail band? Which row number tu use?
>>>>>
>>>>> TIA
>>>>>
>>>>> Chris Werner
>>>>> f+s software gmbh
>>>> There are no other bands than detail rows. At least as far as the data
>>>> is concerned.
>>>>
>>>> Let me qualify that statement a little. The only difference between a
>>>> computed field in the detail row and one in a header or summary band is
>>>> how it is displayed. The computed field has a value that can be
>>>> evaluated or extracted in every detail row. The value that is shown in
>>>> the header or summary band for a column or computed field, is the same
>>>> value that would be displayed on the closest detail row.
>>>>
>>>> However there is nothing stopping you from evaluating an expression that
>>>> includes aggregate functions;
>>>>
>>>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>>>
>>
>
>

Why loop when you can do it all in an expression;
describe("evaluate('max(len(lookupdisplay(...)))',1)")


Chris Werner Posted on 2008-05-29 13:17:07.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub> <483d8539$1@forums-1-dub> <483e75c2@forums-1-dub> <483e9f89$1@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 120
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483eacd3@forums-1-dub>
Date: 29 May 2008 06:17:07 -0700
X-Trace: forums-1-dub 1212067027 10.22.241.152 (29 May 2008 06:17:07 -0700)
X-Original-Trace: 29 May 2008 06:17:07 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86991
Article PK: 416247


> Why loop when you can do it all in an expression;
> describe("evaluate('max(len(lookupdisplay(...)))',1)")

Because I'M not looking for the longest string regards
charakter count but regards screen pixels (or points or
whatever). For numbers you may be right but for text
displayed in proportional fonts not. I take the string and
pass it through the Windows API function
GetTextExtentPoint32 (all that is "borrowed" from someone).

Chris Werner
f+s software gmbh

"Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
news:483e9f89$1@forums-1-dub...
> Chris Werner wrote:
>> Hi Philip,
>>
>>> Not sure what are you hoping to achieve with an expression based on
>>> lookupdisplay if the goal is to calculate the biggest width.
>>
>> Why? I don' understand your scepticism here. Using lookupdisplay
>> I get the string displayed and can calculate the needed width. Looping
>> through the rows I get the maximum width needed for all values in
>> the detail band. Comparing that to the needed width for the headline
>> of the column (describe('avisnr_t.text')) and choosing the maximum
>> I'm almost fine. Only that damn totals in the summary or footer band
>> appear crappy if they are wider than the detail values and the headline.
>> If possible I'd factor them into the calculation. Therefore I use a
>> standard
>> naming convention similar to the _t for headline texts. I use _f1, ...
>> _f5
>> for fields in the footer and _s1, ..., _s5 for fields in the summary
>> band.
>> If evaluate('lookupdisplay(avisnr_f1)', 1) would give me the displayed
>> text for the field avisnr_f1 which is placed in the footer band I'd be
>> fine and ready. But it doesn't ... :-(
>>
>>
>> Chris Werner
>> f+s software gmbh
>>
>>
>> "Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
>> news:483d8539$1@forums-1-dub...
>>> Not sure what are you hoping to achieve with an expression based on
>>> lookupdisplay if the goal is to calculate the biggest width.
>>> You need to do this in code, looping thru the rows and figuring out the
>>> longest string returned by lookupdisplay...
>>>
>>> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
>>> news:483d636f@forums-1-dub...
>>>> Hi Jeremy,
>>>>
>>>> thanks for the help. My example was not good to
>>>> explayn what I'm after. I have objects (columns or
>>>> computed expressions) in the footer band and need
>>>> the result from the lookupdisplay() datawindow
>>>> function for this objects. I'm using this expression:
>>>>
>>>> evaluate('lookupdisplay(avisnr_f1)', 1)
>>>>
>>>> as argument for the dw.describe() function. That
>>>> raises a box saying "Invalid argument to function"
>>>> Have also tried the actual rowcount instead of the
>>>> 1 above which results in the same error.
>>>>
>>>> I need the actual displayed content of the objects
>>>> to make a grid dw autowidth service aware of
>>>> the cumulated fields which are mostly wider than
>>>> the values in the detail row.
>>>>
>>>> Best regards
>>>>
>>>> Chris Werner
>>>> f+s software gmbh
>>>>
>>>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
>>>> news:483d5208@forums-1-dub...
>>>>> Chris Werner wrote:
>>>>>> Hi,
>>>>>>
>>>>>> the evaluate datawindow function takes the row
>>>>>> number as second argument:
>>>>>>
>>>>>> "evaluate('expression', rownumber)"
>>>>>>
>>>>>> for example:
>>>>>>
>>>>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>>>>
>>>>>> Is it possible to evaluate expressions in bands other
>>>>>> than the detail band? Which row number tu use?
>>>>>>
>>>>>> TIA
>>>>>>
>>>>>> Chris Werner
>>>>>> f+s software gmbh
>>>>> There are no other bands than detail rows. At least as far as the data
>>>>> is concerned.
>>>>>
>>>>> Let me qualify that statement a little. The only difference between a
>>>>> computed field in the detail row and one in a header or summary band
>>>>> is how it is displayed. The computed field has a value that can be
>>>>> evaluated or extracted in every detail row. The value that is shown in
>>>>> the header or summary band for a column or computed field, is the same
>>>>> value that would be displayed on the closest detail row.
>>>>>
>>>>> However there is nothing stopping you from evaluating an expression
>>>>> that includes aggregate functions;
>>>>>
>>>>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>>>>
>>>
>>
>>
> Why loop when you can do it all in an expression;
> describe("evaluate('max(len(lookupdisplay(...)))',1)")


Philip Salgannik Posted on 2008-05-29 15:44:22.0Z
Reply-To: "Philip Salgannik" <PhilipSalgannik@work.com>
From: "Philip Salgannik" <PhilipSalgannik@work.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub> <483d8539$1@forums-1-dub> <483e75c2@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 110
Organization: ATWORK
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483ecf56$1@forums-1-dub>
Date: 29 May 2008 08:44:22 -0700
X-Trace: forums-1-dub 1212075862 10.22.241.152 (29 May 2008 08:44:22 -0700)
X-Original-Trace: 29 May 2008 08:44:22 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86993
Article PK: 416250

You are essentially misusing lookupdisplay, take a look at how autowidth is
done here:
http://www.topwizprogramming.com/freecode/dwgridxp.zip
The only thing that you need to add if you want to take into account
footers/summary, is actual evaluation of EXPRESSION that is on the "object"
which is the base for your width, NOT evaluation of lookup display.

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
news:483e75c2@forums-1-dub...
> Hi Philip,
>
>> Not sure what are you hoping to achieve with an expression based on
>> lookupdisplay if the goal is to calculate the biggest width.
>
> Why? I don' understand your scepticism here. Using lookupdisplay
> I get the string displayed and can calculate the needed width. Looping
> through the rows I get the maximum width needed for all values in
> the detail band. Comparing that to the needed width for the headline
> of the column (describe('avisnr_t.text')) and choosing the maximum
> I'm almost fine. Only that damn totals in the summary or footer band
> appear crappy if they are wider than the detail values and the headline.
> If possible I'd factor them into the calculation. Therefore I use a
> standard
> naming convention similar to the _t for headline texts. I use _f1, ... _f5
> for fields in the footer and _s1, ..., _s5 for fields in the summary band.
> If evaluate('lookupdisplay(avisnr_f1)', 1) would give me the displayed
> text for the field avisnr_f1 which is placed in the footer band I'd be
> fine and ready. But it doesn't ... :-(
>
>
> Chris Werner
> f+s software gmbh
>
>
> "Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
> news:483d8539$1@forums-1-dub...
>> Not sure what are you hoping to achieve with an expression based on
>> lookupdisplay if the goal is to calculate the biggest width.
>> You need to do this in code, looping thru the rows and figuring out the
>> longest string returned by lookupdisplay...
>>
>> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
>> news:483d636f@forums-1-dub...
>>> Hi Jeremy,
>>>
>>> thanks for the help. My example was not good to
>>> explayn what I'm after. I have objects (columns or
>>> computed expressions) in the footer band and need
>>> the result from the lookupdisplay() datawindow
>>> function for this objects. I'm using this expression:
>>>
>>> evaluate('lookupdisplay(avisnr_f1)', 1)
>>>
>>> as argument for the dw.describe() function. That
>>> raises a box saying "Invalid argument to function"
>>> Have also tried the actual rowcount instead of the
>>> 1 above which results in the same error.
>>>
>>> I need the actual displayed content of the objects
>>> to make a grid dw autowidth service aware of
>>> the cumulated fields which are mostly wider than
>>> the values in the detail row.
>>>
>>> Best regards
>>>
>>> Chris Werner
>>> f+s software gmbh
>>>
>>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
>>> news:483d5208@forums-1-dub...
>>>> Chris Werner wrote:
>>>>> Hi,
>>>>>
>>>>> the evaluate datawindow function takes the row
>>>>> number as second argument:
>>>>>
>>>>> "evaluate('expression', rownumber)"
>>>>>
>>>>> for example:
>>>>>
>>>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>>>
>>>>> Is it possible to evaluate expressions in bands other
>>>>> than the detail band? Which row number tu use?
>>>>>
>>>>> TIA
>>>>>
>>>>> Chris Werner
>>>>> f+s software gmbh
>>>> There are no other bands than detail rows. At least as far as the data
>>>> is concerned.
>>>>
>>>> Let me qualify that statement a little. The only difference between a
>>>> computed field in the detail row and one in a header or summary band is
>>>> how it is displayed. The computed field has a value that can be
>>>> evaluated or extracted in every detail row. The value that is shown in
>>>> the header or summary band for a column or computed field, is the same
>>>> value that would be displayed on the closest detail row.
>>>>
>>>> However there is nothing stopping you from evaluating an expression
>>>> that includes aggregate functions;
>>>>
>>>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>>>
>>>
>>
>>
>
>


Chris Werner Posted on 2008-05-30 09:54:28.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub> <483d8539$1@forums-1-dub> <483e75c2@forums-1-dub> <483ecf56$1@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 148
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483fced4$1@forums-1-dub>
Date: 30 May 2008 02:54:28 -0700
X-Trace: forums-1-dub 1212141268 10.22.241.152 (30 May 2008 02:54:28 -0700)
X-Original-Trace: 30 May 2008 02:54:28 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87006
Article PK: 416266

Hi Philip,

thanks for your answer.

> You are essentially misusing lookupdisplay

you are right, my usage of looupdisplay isn't documented but
works pretty good at least since PB 6.5. For columns in the
detail band it results equal to

RightTrim(String(idw_client.object.data[ll_row, li_colnbr], ls_format))

(btw, what for is the RightTrim?) But that's not the problem, I
can change that if it stops working.

> The only thing that you need to add if you want to take into account
> footers/summary, is actual evaluation of EXPRESSION that is on the
> "object"

How? I know how to get the expression via describe and how to
get the format. Lets assume I have that in ls_expr and ls_frmt
respectively. What now? Evaluating it needs a row number too and
I'm where I started.

Best regards

Chris Werner
f+s software gmbh



"Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
news:483ecf56$1@forums-1-dub...
> You are essentially misusing lookupdisplay, take a look at how autowidth
> is done here:
> http://www.topwizprogramming.com/freecode/dwgridxp.zip
> The only thing that you need to add if you want to take into account
> footers/summary, is actual evaluation of EXPRESSION that is on the
> "object" which is the base for your width, NOT evaluation of lookup
> display.
> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
> news:483e75c2@forums-1-dub...
>> Hi Philip,
>>
>>> Not sure what are you hoping to achieve with an expression based on
>>> lookupdisplay if the goal is to calculate the biggest width.
>>
>> Why? I don' understand your scepticism here. Using lookupdisplay
>> I get the string displayed and can calculate the needed width. Looping
>> through the rows I get the maximum width needed for all values in
>> the detail band. Comparing that to the needed width for the headline
>> of the column (describe('avisnr_t.text')) and choosing the maximum
>> I'm almost fine. Only that damn totals in the summary or footer band
>> appear crappy if they are wider than the detail values and the headline.
>> If possible I'd factor them into the calculation. Therefore I use a
>> standard
>> naming convention similar to the _t for headline texts. I use _f1, ...
>> _f5
>> for fields in the footer and _s1, ..., _s5 for fields in the summary
>> band.
>> If evaluate('lookupdisplay(avisnr_f1)', 1) would give me the displayed
>> text for the field avisnr_f1 which is placed in the footer band I'd be
>> fine and ready. But it doesn't ... :-(
>>
>>
>> Chris Werner
>> f+s software gmbh
>>
>>
>> "Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
>> news:483d8539$1@forums-1-dub...
>>> Not sure what are you hoping to achieve with an expression based on
>>> lookupdisplay if the goal is to calculate the biggest width.
>>> You need to do this in code, looping thru the rows and figuring out the
>>> longest string returned by lookupdisplay...
>>>
>>> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
>>> news:483d636f@forums-1-dub...
>>>> Hi Jeremy,
>>>>
>>>> thanks for the help. My example was not good to
>>>> explayn what I'm after. I have objects (columns or
>>>> computed expressions) in the footer band and need
>>>> the result from the lookupdisplay() datawindow
>>>> function for this objects. I'm using this expression:
>>>>
>>>> evaluate('lookupdisplay(avisnr_f1)', 1)
>>>>
>>>> as argument for the dw.describe() function. That
>>>> raises a box saying "Invalid argument to function"
>>>> Have also tried the actual rowcount instead of the
>>>> 1 above which results in the same error.
>>>>
>>>> I need the actual displayed content of the objects
>>>> to make a grid dw autowidth service aware of
>>>> the cumulated fields which are mostly wider than
>>>> the values in the detail row.
>>>>
>>>> Best regards
>>>>
>>>> Chris Werner
>>>> f+s software gmbh
>>>>
>>>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
>>>> news:483d5208@forums-1-dub...
>>>>> Chris Werner wrote:
>>>>>> Hi,
>>>>>>
>>>>>> the evaluate datawindow function takes the row
>>>>>> number as second argument:
>>>>>>
>>>>>> "evaluate('expression', rownumber)"
>>>>>>
>>>>>> for example:
>>>>>>
>>>>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>>>>
>>>>>> Is it possible to evaluate expressions in bands other
>>>>>> than the detail band? Which row number tu use?
>>>>>>
>>>>>> TIA
>>>>>>
>>>>>> Chris Werner
>>>>>> f+s software gmbh
>>>>> There are no other bands than detail rows. At least as far as the data
>>>>> is concerned.
>>>>>
>>>>> Let me qualify that statement a little. The only difference between a
>>>>> computed field in the detail row and one in a header or summary band
>>>>> is how it is displayed. The computed field has a value that can be
>>>>> evaluated or extracted in every detail row. The value that is shown in
>>>>> the header or summary band for a column or computed field, is the same
>>>>> value that would be displayed on the closest detail row.
>>>>>
>>>>> However there is nothing stopping you from evaluating an expression
>>>>> that includes aggregate functions;
>>>>>
>>>>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Chris Werner Posted on 2008-05-30 10:50:38.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub> <483d8539$1@forums-1-dub> <483e75c2@forums-1-dub> <483ecf56$1@forums-1-dub> <483fced4$1@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 211
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483fdbfe@forums-1-dub>
Date: 30 May 2008 03:50:38 -0700
X-Trace: forums-1-dub 1212144638 10.22.241.152 (30 May 2008 03:50:38 -0700)
X-Original-Trace: 30 May 2008 03:50:38 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87007
Article PK: 416263

Okay, with all that help I was able to achieve what
I want finally. In case somebody is interested that's
the code:

as_hname is the name of an object in the header,
summary or footer band.
The code for text objects is obvious and not shown
below.
Not sure if that makes any difference but al_row is
1 for header objects, rowcount for objects in the
summary band and lastRowOnPage for footer
objects.

ls_expr = as_hname + ".expression"
ls_e = this.idw_data.describe(ls_expr)

// prefix quotes with tildes:
map.strings.uf_replace(ls_e, "'", "~~'", false, true, true, ls_e)

if ls_e <> '!' then

ls_expr = as_hname + ".format"
ls_f = this.idw_data.describe(ls_expr)

ls_expr = as_hname + ".coltype"
ls_t = this.idw_data.describe(ls_expr)

ls_expr = "evaluate('" + ls_e + "', " + string(al_row) + ")"
ls_value = this.idw_data.describe(ls_expr)

if left(ls_t, 4) = 'char' then
// ok
elseif ls_t = 'date' then
ls_value = string(date(ls_value), ls_f)
elseif ls_t = 'datetime' then
ls_value = string(datetime(ls_value), ls_f)
elseif left(ls_t, 4) = 'deci' then
ls_value = string(dec(ls_value), ls_f)
elseif ls_t = 'int' then
ls_value = string(long(ls_value), ls_f)
elseif ls_t = 'long' then
ls_value = string(long(ls_value), ls_f)
elseif ls_t = 'number' then
ls_value = string(double(ls_value), ls_f)
elseif ls_t = 'real' then
ls_value = string(double(ls_value), ls_f)
elseif ls_t = 'time' then
ls_value = string(time(ls_value), ls_f)
elseif ls_t = 'timestamp' then
ls_value = string(time(ls_value), ls_f)
end if

end if

Thank you all,

Chris Werner
f+s software gmbh

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> schrieb im Newsbeitrag
news:483fced4$1@forums-1-dub...

> Hi Philip,
>
> thanks for your answer.
>
>> You are essentially misusing lookupdisplay
>
> you are right, my usage of looupdisplay isn't documented but
> works pretty good at least since PB 6.5. For columns in the
> detail band it results equal to
>
> RightTrim(String(idw_client.object.data[ll_row, li_colnbr], ls_format))
>
> (btw, what for is the RightTrim?) But that's not the problem, I
> can change that if it stops working.
>
>> The only thing that you need to add if you want to take into account
>> footers/summary, is actual evaluation of EXPRESSION that is on the
>> "object"
>
> How? I know how to get the expression via describe and how to
> get the format. Lets assume I have that in ls_expr and ls_frmt
> respectively. What now? Evaluating it needs a row number too and
> I'm where I started.
>
> Best regards
>
> Chris Werner
> f+s software gmbh
>
>
>
> "Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
> news:483ecf56$1@forums-1-dub...
>> You are essentially misusing lookupdisplay, take a look at how autowidth
>> is done here:
>> http://www.topwizprogramming.com/freecode/dwgridxp.zip
>> The only thing that you need to add if you want to take into account
>> footers/summary, is actual evaluation of EXPRESSION that is on the
>> "object" which is the base for your width, NOT evaluation of lookup
>> display.
>> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
>> news:483e75c2@forums-1-dub...
>>> Hi Philip,
>>>
>>>> Not sure what are you hoping to achieve with an expression based on
>>>> lookupdisplay if the goal is to calculate the biggest width.
>>>
>>> Why? I don' understand your scepticism here. Using lookupdisplay
>>> I get the string displayed and can calculate the needed width. Looping
>>> through the rows I get the maximum width needed for all values in
>>> the detail band. Comparing that to the needed width for the headline
>>> of the column (describe('avisnr_t.text')) and choosing the maximum
>>> I'm almost fine. Only that damn totals in the summary or footer band
>>> appear crappy if they are wider than the detail values and the headline.
>>> If possible I'd factor them into the calculation. Therefore I use a
>>> standard
>>> naming convention similar to the _t for headline texts. I use _f1, ...
>>> _f5
>>> for fields in the footer and _s1, ..., _s5 for fields in the summary
>>> band.
>>> If evaluate('lookupdisplay(avisnr_f1)', 1) would give me the displayed
>>> text for the field avisnr_f1 which is placed in the footer band I'd be
>>> fine and ready. But it doesn't ... :-(
>>>
>>>
>>> Chris Werner
>>> f+s software gmbh
>>>
>>>
>>> "Philip Salgannik" <PhilipSalgannik@work.com> schrieb im Newsbeitrag
>>> news:483d8539$1@forums-1-dub...
>>>> Not sure what are you hoping to achieve with an expression based on
>>>> lookupdisplay if the goal is to calculate the biggest width.
>>>> You need to do this in code, looping thru the rows and figuring out the
>>>> longest string returned by lookupdisplay...
>>>>
>>>> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
>>>> news:483d636f@forums-1-dub...
>>>>> Hi Jeremy,
>>>>>
>>>>> thanks for the help. My example was not good to
>>>>> explayn what I'm after. I have objects (columns or
>>>>> computed expressions) in the footer band and need
>>>>> the result from the lookupdisplay() datawindow
>>>>> function for this objects. I'm using this expression:
>>>>>
>>>>> evaluate('lookupdisplay(avisnr_f1)', 1)
>>>>>
>>>>> as argument for the dw.describe() function. That
>>>>> raises a box saying "Invalid argument to function"
>>>>> Have also tried the actual rowcount instead of the
>>>>> 1 above which results in the same error.
>>>>>
>>>>> I need the actual displayed content of the objects
>>>>> to make a grid dw autowidth service aware of
>>>>> the cumulated fields which are mostly wider than
>>>>> the values in the detail row.
>>>>>
>>>>> Best regards
>>>>>
>>>>> Chris Werner
>>>>> f+s software gmbh
>>>>>
>>>>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
>>>>> news:483d5208@forums-1-dub...
>>>>>> Chris Werner wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> the evaluate datawindow function takes the row
>>>>>>> number as second argument:
>>>>>>>
>>>>>>> "evaluate('expression', rownumber)"
>>>>>>>
>>>>>>> for example:
>>>>>>>
>>>>>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>>>>>
>>>>>>> Is it possible to evaluate expressions in bands other
>>>>>>> than the detail band? Which row number tu use?
>>>>>>>
>>>>>>> TIA
>>>>>>>
>>>>>>> Chris Werner
>>>>>>> f+s software gmbh
>>>>>> There are no other bands than detail rows. At least as far as the
>>>>>> data is concerned.
>>>>>>
>>>>>> Let me qualify that statement a little. The only difference between a
>>>>>> computed field in the detail row and one in a header or summary band
>>>>>> is how it is displayed. The computed field has a value that can be
>>>>>> evaluated or extracted in every detail row. The value that is shown
>>>>>> in the header or summary band for a column or computed field, is the
>>>>>> same value that would be displayed on the closest detail row.
>>>>>>
>>>>>> However there is nothing stopping you from evaluating an expression
>>>>>> that includes aggregate functions;
>>>>>>
>>>>>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Arthur Hefti Posted on 2008-05-28 17:39:56.0Z
From: "Arthur Hefti" <arthur@catsoft.ch>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483d98ec$1@forums-1-dub>
Date: 28 May 2008 10:39:56 -0700
X-Trace: forums-1-dub 1211996396 10.22.241.152 (28 May 2008 10:39:56 -0700)
X-Original-Trace: 28 May 2008 10:39:56 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86981
Article PK: 416239

Chris

Lookupdisplay is used for columns with code tables only. You can get value
of a computed field by Describe( "Evaluate( 'compute_1',<row>)").
If the value of the compute is depending on the row use the row close to the
header/footer eg. FirstRowOnPage.

HTH
Arthur

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
news:483d636f@forums-1-dub...
> Hi Jeremy,
>
> thanks for the help. My example was not good to
> explayn what I'm after. I have objects (columns or
> computed expressions) in the footer band and need
> the result from the lookupdisplay() datawindow
> function for this objects. I'm using this expression:
>
> evaluate('lookupdisplay(avisnr_f1)', 1)
>
> as argument for the dw.describe() function. That
> raises a box saying "Invalid argument to function"
> Have also tried the actual rowcount instead of the
> 1 above which results in the same error.
>
> I need the actual displayed content of the objects
> to make a grid dw autowidth service aware of
> the cumulated fields which are mostly wider than
> the values in the detail row.
>
> Best regards
>
> Chris Werner
> f+s software gmbh
>
> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
> news:483d5208@forums-1-dub...
>> Chris Werner wrote:
>>> Hi,
>>>
>>> the evaluate datawindow function takes the row
>>> number as second argument:
>>>
>>> "evaluate('expression', rownumber)"
>>>
>>> for example:
>>>
>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>
>>> Is it possible to evaluate expressions in bands other
>>> than the detail band? Which row number tu use?
>>>
>>> TIA
>>>
>>> Chris Werner
>>> f+s software gmbh
>> There are no other bands than detail rows. At least as far as the data is
>> concerned.
>>
>> Let me qualify that statement a little. The only difference between a
>> computed field in the detail row and one in a header or summary band is
>> how it is displayed. The computed field has a value that can be evaluated
>> or extracted in every detail row. The value that is shown in the header
>> or summary band for a column or computed field, is the same value that
>> would be displayed on the closest detail row.
>>
>> However there is nothing stopping you from evaluating an expression that
>> includes aggregate functions;
>>
>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>
>


Chris Werner Posted on 2008-05-29 09:02:45.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <483d2477$1@forums-1-dub> <483d5208@forums-1-dub> <483d636f@forums-1-dub> <483d98ec$1@forums-1-dub>
Subject: Re: using evaluate in header and footer band
Lines: 92
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <483e7135@forums-1-dub>
Date: 29 May 2008 02:02:45 -0700
X-Trace: forums-1-dub 1212051765 10.22.241.152 (29 May 2008 02:02:45 -0700)
X-Original-Trace: 29 May 2008 02:02:45 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86986
Article PK: 416243

Hi Arthur,

no, lookupdisplay works great for other columns too. For instance
for a numerical column with a display format of "#,##0.00" and a
value of 1192 lookupdisplay delivers "1.192,00" (depending on the
localization). I need this to compute the width of the column. Works
great for the detail rows but fails if there are summary field in the
summary or footer band.

Chris Werner
f+s software gmbh

"Arthur Hefti" <arthur@catsoft.ch> schrieb im Newsbeitrag
news:483d98ec$1@forums-1-dub...

> Chris
>
> Lookupdisplay is used for columns with code tables only. You can get value
> of a computed field by Describe( "Evaluate( 'compute_1',<row>)").
> If the value of the compute is depending on the row use the row close to
> the header/footer eg. FirstRowOnPage.
>
> HTH
> Arthur
>
> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
> news:483d636f@forums-1-dub...
>> Hi Jeremy,
>>
>> thanks for the help. My example was not good to
>> explayn what I'm after. I have objects (columns or
>> computed expressions) in the footer band and need
>> the result from the lookupdisplay() datawindow
>> function for this objects. I'm using this expression:
>>
>> evaluate('lookupdisplay(avisnr_f1)', 1)
>>
>> as argument for the dw.describe() function. That
>> raises a box saying "Invalid argument to function"
>> Have also tried the actual rowcount instead of the
>> 1 above which results in the same error.
>>
>> I need the actual displayed content of the objects
>> to make a grid dw autowidth service aware of
>> the cumulated fields which are mostly wider than
>> the values in the detail row.
>>
>> Best regards
>>
>> Chris Werner
>> f+s software gmbh
>>
>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> schrieb im Newsbeitrag
>> news:483d5208@forums-1-dub...
>>> Chris Werner wrote:
>>>> Hi,
>>>>
>>>> the evaluate datawindow function takes the row
>>>> number as second argument:
>>>>
>>>> "evaluate('expression', rownumber)"
>>>>
>>>> for example:
>>>>
>>>> dw_1.describe("evaluate('if(salary>90000,255,0)',3)")
>>>>
>>>> Is it possible to evaluate expressions in bands other
>>>> than the detail band? Which row number tu use?
>>>>
>>>> TIA
>>>>
>>>> Chris Werner
>>>> f+s software gmbh
>>> There are no other bands than detail rows. At least as far as the data
>>> is concerned.
>>>
>>> Let me qualify that statement a little. The only difference between a
>>> computed field in the detail row and one in a header or summary band is
>>> how it is displayed. The computed field has a value that can be
>>> evaluated or extracted in every detail row. The value that is shown in
>>> the header or summary band for a column or computed field, is the same
>>> value that would be displayed on the closest detail row.
>>>
>>> However there is nothing stopping you from evaluating an expression that
>>> includes aggregate functions;
>>>
>>> dw_1.describe("evaluate('avg(salary for group 1)',3)")
>>
>>
>
>