Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collecting different Numbers works in 2 groups, but not in the 3rd^

Status
Not open for further replies.

erathosthenes

Programmer
May 9, 2005
11
DE
Hi everybody,
as time goes by I found another big issue in my reports I can't work around, and I don't know what the problem is.

I only want to show on screen a single database view,
this view has a Cust.No., a delivery date, how much pieces per Cust.No, what kind of piece, and also a price per delivered piece.

This means the view could look like this:

Cust.No. | Date | Count | Type | Price
10001 X 1 1 2,50
10001 X 2 2 3,00
10001 Z 1 3 3,50
10002 X 5 1 2,50
10002 Y 3 3 2,85
10003 Z 1 6 4,00
10004 Z 4 4 3,50
... ... ... ... ...

So in words... the view shows me the 'customer'
that has 'X' pieces of kind 'Y' on date 'Z', that cost the corresponding price.

What works is: my report remembers all different counts of the amount, how much the customer gets. He also remembers of what type the amount is. But he can go to hell, because he doesn't remembers, what the price of each type is.

I have four pictures for your service, there you can see, that the logic of the reports is correct. It works like in the other reports I build and in this report also, but not with the price and this makes me jumping around for anger.

The two important formulas are these:

formula @ShowActPrice

WhilePrintingRecords;
{VRPT_LIEFERSCHEIN.PREIS}

formula @RemPreis

WhilePrintingRecords;
EvaluateAfter ({@ShowActPrice});
stringvar menunum := menunum + totext({VRPT_LIEFERSCHEIN.MENUNUMMER},0) + ","; // Menü Nummer
stringvar rempreise := rempreise + totext({@ShowActPrice},0) + ",";
" MenuNum: "+ menunum +"; Preise: "+ rempreise;

You can see that the 'MenuNum' is collected right like it should, and it is the same logic I use with the price :mad:.

You can find the pics under:


Any help or advice would be thankfully accepted.

Regards,
Frank
 
Hello,

First - reports dont "remember" anything. They only represent the data in the underlying database.

It would be helpful to post the layout of the tables for this report before we can really see what you are needing.

Thanks


Andy Baldwin

"Testing is the most overlooked programming language on the books!
 
Hi,
I excuse for wrong vocabulary, of course not the report, but the stringvar in my formula is that what remembers.
I'am very sorry, but I don't know what you mean with 'layout of the tables for this report' :(.
If you want to see the underlying data the report should show,
then this is the databaseview, I have descripted up there.

thx for taking time,
Frank
 
I wonder whether this is just a result of rounding. Try changing your formula to:

WhilePrintingRecords;
EvaluateAfter ({@ShowActPrice});
stringvar menunum := menunum + totext({VRPT_LIEFERSCHEIN.MENUNUMMER},0) + ","; // Menü Nummer
stringvar rempreise := rempreise + totext({@ShowActPrice},2) + ",";//two decimals
" MenuNum: "+ menunum +"; Preise: "+ rempreise;

On a different note, although you are not showing the details in your report, by placing the price in the group #3 footer, you are ensuring that the last detail level price will be used in your formula. Is that what you intended?

-LB
 
hi lbass,

this seems to be the point! I could not test it now, but I think this is the solution, cause I don't thought about the 0 in the totext method/function.
Your other point with the group #3 footer is also right, but this works fine, like I want it to.

I'll try, for now big thx! :)
 
tested your post, and must say I'am a fool!
everything runs fine now, thx again! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top