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.

CalcuateGroups method using a computed field doesn't work.

2 posts in DataWindow .NET Last posting was on 2004-10-20 21:19:34.0Z
taka Posted on 2004-10-20 21:12:38.0Z
From: "taka" <takashi_shimizu007@cox.net>
Newsgroups: sybase.public.datawindow.net
Subject: CalcuateGroups method using a computed field doesn't work.
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: ip68-5-17-216.oc.oc.cox.net
Message-ID: <4176d4c2$1@forums-2-dub>
X-Original-Trace: 20 Oct 2004 14:12:34 -0700, ip68-5-17-216.oc.oc.cox.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 20 Oct 2004 14:12:35 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 20 Oct 2004 14:12:38 -0700
X-Trace: forums-1-dub 1098306758 10.22.108.75 (20 Oct 2004 14:12:38 -0700)
X-Original-Trace: 20 Oct 2004 14:12:38 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:566
Article PK: 124995

Hi All,

I appreciate if you can give me a solution for the following my problem.

Problem: Can't dynamically create a group using a computed field.

In the datawindow painter, I created a computed field (cf_group_key) with ""
in the compute expression, and created subtotals in a group band.

Int the following code, dwc1.CalculateGroups should recalcuate subtotals
for each group key, but it doesn't, thus showing only one subtotal line on a
screen. I confirmed that FindGroupChange was executed only once, suggesting
the subtotals were not calculated correctly. However, if I directly assign
the group key column (row_disp_priority_no) to the compute expression in the
datawindow painter, CalcuateGroups method works fine. Do you think this is a
Datawindow .Net bug or a mistake in my code?


dwc1.Modify("cf_group_key.expression='row_disp_priority_no'")
dwc1.SetSort("cf_group_key A")
dwc1.Sort()
dwc1.CalculateGroups()


' debug
Dim nRow As Integer = 1
Do
nRow = dwc1.FindGroupChange(nRow, 1)
If nRow > 0 Then
Dim nValue = dwc1.GetItemDouble(nRow, "cf_group_key")
nRow = nRow + 1
End If
Loop Until nRow = 0
'end debug

Thanks.


taka Posted on 2004-10-20 21:19:34.0Z
From: "taka" <takashi_shimizu007@cox.net>
Newsgroups: sybase.public.datawindow.net
References: <4176d4c2$1@forums-2-dub>
Subject: Re: CalcuateGroups method using a computed field doesn't work.
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: ip68-5-17-216.oc.oc.cox.net
Message-ID: <4176d663$1@forums-2-dub>
X-Original-Trace: 20 Oct 2004 14:19:31 -0700, ip68-5-17-216.oc.oc.cox.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 20 Oct 2004 14:19:32 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 20 Oct 2004 14:19:34 -0700
X-Trace: forums-1-dub 1098307174 10.22.108.75 (20 Oct 2004 14:19:34 -0700)
X-Original-Trace: 20 Oct 2004 14:19:34 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:567
Article PK: 124994

I forgot to specify the current versions that I use.
Datawindow .NET & Datawindow Designer 1.0, Build 5032
VS .NET 2003

"taka" <takashi_shimizu007@cox.net> wrote in message
news:4176d4c2$1@forums-2-dub...
> Hi All,
>
> I appreciate if you can give me a solution for the following my problem.
>
> Problem: Can't dynamically create a group using a computed field.
>
> In the datawindow painter, I created a computed field (cf_group_key) with
> "" in the compute expression, and created subtotals in a group band.
>
> Int the following code, dwc1.CalculateGroups should recalcuate subtotals
> for each group key, but it doesn't, thus showing only one subtotal line on
> a screen. I confirmed that FindGroupChange was executed only once,
> suggesting the subtotals were not calculated correctly. However, if I
> directly assign the group key column (row_disp_priority_no) to the compute
> expression in the datawindow painter, CalcuateGroups method works fine. Do
> you think this is a Datawindow .Net bug or a mistake in my code?
>
>
> dwc1.Modify("cf_group_key.expression='row_disp_priority_no'")
> dwc1.SetSort("cf_group_key A")
> dwc1.Sort()
> dwc1.CalculateGroups()
>
>
> ' debug
> Dim nRow As Integer = 1
> Do
> nRow = dwc1.FindGroupChange(nRow, 1)
> If nRow > 0 Then
> Dim nValue = dwc1.GetItemDouble(nRow, "cf_group_key")
> nRow = nRow + 1
> End If
> Loop Until nRow = 0
> 'end debug
>
> Thanks.
>
>