I don't have that set up in the report, my ranges specify dimension[5] == x
on custtable, transdate == y on custtrans and amountmst < 0 on custtrans.
the amountmst != settleamountmst actually takes part in my fetch method as
below, it is not a range, so much as an implicit condition to the algorithm
resulting in a changed total
public boolean fetch()
{
QueryRun qryRun;
CustTable custTableRec;
CustTrans custTransRec;
;
//Create query run
qryRun = new QueryRun(this);
//Prompt for params
if(!qryRun.prompt())
{
return false;
}
upToRange =
qryRun.query().dataSourceTable(tablenum(CustTrans)).findRange(fieldnum(CustT
rans, LastSettleDate));
//Header
element.execute(1);
//Cycle through the query
while(qryRun.next())
{
//Obtain query results
custTableRec = qryRun.get(tablenum(CustTable));
custTransRec = qryRun.get(tablenum(CustTrans));
//Handle customer totals
if(qryRun.changed(tablenum(CustTable)))
{
if(unsettledAmt != 0.0)
{
this.send(custTableRec);
this.send(custTransRec);
}
unsettledAmt = 0.0;
custAccount = custTableRec.accountNum;
custName = custTableRec.Name;
}
unsettledAmt -= (custTransRec.AmountMST -
custTransRec.SettleAmountMST);
}
return true;
}
custName, custAccount and unsettledAmount are instance variables accessed by
means of display methods.
Regards,
Matt Benic
Axapta Developer
UTi Sun Couriers Division
"The universal aptitude for ineptitude
makes any human accomplishment an incredible miracle."
- Col. John P. Stapp
-----Original Message-----
From: bmp_thydatacenter_dk [mailto:[EMAIL PROTECTED]
Sent: 22 September 2004 07:31 AM
To: [EMAIL PROTECTED]
Subject: [development-axapta] Re: SQL vs Query engine
You can set up this range in a query.
The rule is that if a range value start with a "(" the contents of
the range is an _expression_ in X++ syntax. You can make a range on
the custTrans datasource on a random field and set the value to:
(AmountMST != SettleAmountMST)
Best regards,
Bj�rn M�ller Pedersen
Thy Data Center Development A/S
--- In [EMAIL PROTECTED], "Don Price"
<[EMAIL PROTECTED]> wrote:
> >.custTrans.AmountMst != custTrans.SettleAmountMST)
> Are you sure you have this set via a range in the report?
>
> The rest of those ranges you could setup in the query without
code, but
> Not this one.
>
> Don
>
> -----Original Message-----
> From: bmp_thydatacenter_dk [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 21, 2004 2:23 PM
> To: [EMAIL PROTECTED]
> Subject: [development-axapta] Re: SQL vs Query engine
>
> I can't figure out why your approach is not working from you
> description.
>
> But an approach I have used many times is to use a temporary table
> as a middle tier between feching the data from the database and
> sending the data to the design. This gives the oppertunity to
focus
> on the database communication regardless of the wanted sequence of
> data in the design of the report.
>
> Best regards,
> Bj�rn M�ller Pedersen
> Thy Data Center Development A/S
>
> --- In [EMAIL PROTECTED], "Matt Benic"
> <[EMAIL PROTECTED]> wrote:
> > Hi all,
> > I'm going nuts trying to get a report to work. My requirement is
> to return a
> > summary of all unsettled credit notes and payments per customer,
> grouped by
> > credit controller (dimension[5]).
> >
> > Seems easy enough, set up a report using custtable and custtrans
> joined on
> > the customer number, use a variable to sum up the total
> outstanding amount,
> > and use a programmable section to display it all. Except it
doesnt.
> > I have set up such a report, using ranges on the amountMST,
> transdate and
> > dimension[5], but when I compare the values with those obtained
by
> using the
> > SQL below in the table browser, the totals of the resulting
> transactions
> > dont even come close to matching. Any suggestions?
> >
> > SELECT * FROM CustTrans
> > where (custtrans.accountnum == "003556") &&
> > (custtrans.amountMst < 0) &&
> > (custTrans.AmountMst != custTrans.SettleAmountMST) &&
> > (custtrans.transdate < 31\10\2004)
> >
> > (I have omitted the dimension[5] part of the where clause since
it
> does not
> > affect the returned values.. each customer is managed by a
single
> credit
> > controller)
> >
> > Regards,
> >
> > Matt Benic
> > Axapta Developer
> > UTi Sun Couriers Division
> >
> > "The universal aptitude for ineptitude
> > makes any human accomplishment an incredible miracle."
> > - Col. John P. Stapp
>
>
>
>
>
> Yahoo! Groups Links
Yahoo! Groups Links
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

