Modify compute expression

Hi there,

i have a problem regarding a computed field that has to reference a field
dynamically at runtime. This computed field also has a group on it which
forces a pagebreak.

Now the problem is that i set the value on the computed field to 0 in the
painter, so that no pagebreak occurs. When i wan't to have the pagebreak i
try to modify the compute expression field, but nothing happens. The way i
do it is as follows:

dw_okorapport.Modify("sideskift.Expression=' sortniveau '")

or

dw_okorapport.Object.sideskift.Expression = " sortniveau "


Thanks.


0
SBN
5/14/2002 7:35:39 AM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

4 Replies
373 Views

Similar Articles

[PageSpeed] 33

On Tue, 14 May 2002 09:35:39 +0200, "SBN" <sbn@edbgruppen.dk> wrote:

>Hi there,
>
>i have a problem regarding a computed field that has to reference a field
>dynamically at runtime. This computed field also has a group on it which
>forces a pagebreak.
>
>Now the problem is that i set the value on the computed field to 0 in the
>painter, so that no pagebreak occurs. When i wan't to have the pagebreak i
>try to modify the compute expression field, but nothing happens. The way i
>do it is as follows:
>
>dw_okorapport.Modify("sideskift.Expression=' sortniveau '")
>
>or
>
>dw_okorapport.Object.sideskift.Expression = " sortniveau "
>
>
>Thanks.
>

You need to call GroupCalc() after the Modify().  This will make the
dw re-evaluate all computed expressions and group breaks.
You may also need to call Sort() if this effects the grouping.

HTH

Simon

0
Simon
5/14/2002 7:40:54 AM
Well i have tried that as well but no result. The solution that i am trying
to build is the same that others have discussed in this newsgroup regarding
dynamic pagebreak.


"Simon Caldwell (TeamSybase)" <simon.caldwell@bigfoot.com> wrote in message
news:bqf1eukad0ghnlun36vptf96dv8tbvgloq@4ax.com...
> On Tue, 14 May 2002 09:35:39 +0200, "SBN" <sbn@edbgruppen.dk> wrote:
>
> >Hi there,
> >
> >i have a problem regarding a computed field that has to reference a field
> >dynamically at runtime. This computed field also has a group on it which
> >forces a pagebreak.
> >
> >Now the problem is that i set the value on the computed field to 0 in the
> >painter, so that no pagebreak occurs. When i wan't to have the pagebreak
i
> >try to modify the compute expression field, but nothing happens. The way
i
> >do it is as follows:
> >
> >dw_okorapport.Modify("sideskift.Expression=' sortniveau '")
> >
> >or
> >
> >dw_okorapport.Object.sideskift.Expression = " sortniveau "
> >
> >
> >Thanks.
> >
>
> You need to call GroupCalc() after the Modify().  This will make the
> dw re-evaluate all computed expressions and group breaks.
> You may also need to call Sort() if this effects the grouping.
>
> HTH
>
> Simon
>


0
SBN
5/14/2002 8:12:19 AM
Is it because of the way i am executing the commands? do i have to execute
some before the retrieve, and/or some after the retrieve.

Thanks.

"Simon Caldwell (TeamSybase)" <simon.caldwell@bigfoot.com> wrote in message
news:bqf1eukad0ghnlun36vptf96dv8tbvgloq@4ax.com...
> On Tue, 14 May 2002 09:35:39 +0200, "SBN" <sbn@edbgruppen.dk> wrote:
>
> >Hi there,
> >
> >i have a problem regarding a computed field that has to reference a field
> >dynamically at runtime. This computed field also has a group on it which
> >forces a pagebreak.
> >
> >Now the problem is that i set the value on the computed field to 0 in the
> >painter, so that no pagebreak occurs. When i wan't to have the pagebreak
i
> >try to modify the compute expression field, but nothing happens. The way
i
> >do it is as follows:
> >
> >dw_okorapport.Modify("sideskift.Expression=' sortniveau '")
> >
> >or
> >
> >dw_okorapport.Object.sideskift.Expression = " sortniveau "
> >
> >
> >Thanks.
> >
>
> You need to call GroupCalc() after the Modify().  This will make the
> dw re-evaluate all computed expressions and group breaks.
> You may also need to call Sort() if this effects the grouping.
>
> HTH
>
> Simon
>


0
SBN
5/14/2002 8:40:31 AM
It should definitely work, so there's possibly something wrong with your
code.  Try something like:

dw_okorapport.Modify("sideskift.Expression=' sortniveau '")
dw_okorapport.SetSort("sortniveau")
dw_okorapport.Sort()
dw_okorapport.GroupCalc()

and check the return code from each of the statements to make sure they are
all successful.

Simon
--
All views expressed in this message are my own and not necessarily those of
my employer


"SBN" <sbn@edbgruppen.dk> wrote in message
news:5Q2m#Ay#BHA.232@forums.sybase.com...
> Well i have tried that as well but no result. The solution that i am
trying
> to build is the same that others have discussed in this newsgroup
regarding
> dynamic pagebreak.
>
>
> "Simon Caldwell (TeamSybase)" <simon.caldwell@bigfoot.com> wrote in
message
> news:bqf1eukad0ghnlun36vptf96dv8tbvgloq@4ax.com...
> > On Tue, 14 May 2002 09:35:39 +0200, "SBN" <sbn@edbgruppen.dk> wrote:
> >
> > >Hi there,
> > >
> > >i have a problem regarding a computed field that has to reference a
field
> > >dynamically at runtime. This computed field also has a group on it
which
> > >forces a pagebreak.
> > >
> > >Now the problem is that i set the value on the computed field to 0 in
the
> > >painter, so that no pagebreak occurs. When i wan't to have the
pagebreak
> i
> > >try to modify the compute expression field, but nothing happens. The
way
> i
> > >do it is as follows:
> > >
> > >dw_okorapport.Modify("sideskift.Expression=' sortniveau '")
> > >
> > >or
> > >
> > >dw_okorapport.Object.sideskift.Expression = " sortniveau "
> > >
> > >
> > >Thanks.
> > >
> >
> > You need to call GroupCalc() after the Modify().  This will make the
> > dw re-evaluate all computed expressions and group breaks.
> > You may also need to call Sort() if this effects the grouping.
> >
> > HTH
> >
> > Simon
> >
>
>


0
Simon
5/14/2002 8:48:04 AM
Reply: