mibuso.com

Microsoft Business Solutions online community
It is currently Thu May 23, 2013 7:00 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: How to determine new report page in RTC?
PostPosted: Wed Jul 25, 2012 9:57 am 
Offline

Joined: Wed Jul 18, 2012 11:41 am
Posts: 40
Location: Kyiv
Country: Ukraine (ua)
I named my total fields like "LastPPQ", "FirstPPQ" and "FirstIPQ" accordingly.
After that I insert one more column next to last field and put there:
Code: Select all
=Code.SetData(Fields!LastPPQ.Value + chr(177) + Fields!FirstPPQ.Value + chr(177) + Fields!FirstIPQ.Value)

Then i put textbox to header and insert:
Code: Select all
=Cdbl(Code.GetData(1) - Cdbl(Code.GetData(2) + Cdbl(Code.GetData(3)

But error occurs when i try to save it. :|


Attachments:
error2.png
error2.png [ 8.22 KiB | Viewed 389 times ]

_________________
MB7-840
Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 10:38 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
What about passing to SetData...
Code: Select all
=Code.SetData(
  cstr(Last(Code.PagePhysQty(Fields!Item_Document_Line__Qty___Phys__Inventory__.Value))) + chr(177) +
  cstr(First(Code.PagePhysQty(Fields!Item_Document_Line__Qty___Phys__Inventory__.Value))) + chr(177) +
  cstr(First(Fields!Item_Document_Line__Qty___Phys__Inventory__.Value))

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 10:58 am 
Offline

Joined: Wed Jul 18, 2012 11:41 am
Posts: 40
Location: Kyiv
Country: Ukraine (ua)
It is working not correct :(

It find First\Last value in whole report, not in current page. Also it use Code functions two times, and in the end i have double total.

I think Firsl\Last function returns right values only in header or footer

_________________
MB7-840


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 11:00 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
Isaland wrote:
It is working not correct :(

It find First\Last value in whole report, not in current page. Also it use Code functions two times, and in the end i have double total.

I think Firsl\Last function returns right values only in header or footer


Could you provide another screenshot of the layout?

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 11:26 am 
Offline

Joined: Wed Jul 18, 2012 11:41 am
Posts: 40
Location: Kyiv
Country: Ukraine (ua)
I will try to write in this post all information. I change code a little, to make my task clearly :wink:

First is PagePhysQtyFunc. This function will count Sum till current record:
Code: Select all
Dim PhysQtyOnPage As Integer

Public Function PagePhysQtyFunc(ByVal Value As Integer)
     PhysQtyOnPage = PhysQtyOnPage + Value
     Return PhysQtyOnPage
End Function


First Red Field is field where i want to find last result from PagePhysQtyFunc on page (not from all report):
Code: Select all
=Last(Code.PagePhysQtyFunc(Fields!Item_Document_Line__Qty___Phys__Inventory__.Value))


Second Red Field is field where i want to find first result from PagePhysQtyFunc on page (not from all report):
Code: Select all
=First(Code.PagePhysQtyFunc(Fields!Item_Document_Line__Qty___Phys__Inventory__.Value))


Third Red Field is field where i want to find first value of 4 column on page (not from all report):
Code: Select all
=First(Fields!Item_Document_Line__Qty___Phys__Inventory__.Value)


Fourth Red Field is field where i use SetData to transfer values in header. It works correct.

Screenshoots:
http://isaland.net/Screen-1.png
http://isaland.net/Screen-2.png

_________________
MB7-840


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 11:33 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
Isaland wrote:
Fourth Red Field is field where i use SetData to transfer values in header. It works correct.

Does it work now?

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 11:36 am 
Offline

Joined: Wed Jul 18, 2012 11:41 am
Posts: 40
Location: Kyiv
Country: Ukraine (ua)
Troubles In Paradise wrote:
Does it work now?

Yes. As you see at header - 120 is resul of calculating (120 - 1 + 1)
Code: Select all
=cdbl(Code.GetData(1)) - cdbl(Code.GetData(2)) + cdbl(Code.GetData(3))

_________________
MB7-840


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 11:41 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
Isaland wrote:
Troubles In Paradise wrote:
Does it work now?

Yes. As you see at header - 120 is resul of calculating (120 - 1 + 1)
Code: Select all
=cdbl(Code.GetData(1)) - cdbl(Code.GetData(2)) + cdbl(Code.GetData(3))


Does it miss something or your issue is solved?

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 12:56 pm 
Offline

Joined: Wed Jul 18, 2012 11:41 am
Posts: 40
Location: Kyiv
Country: Ukraine (ua)
Troubles In Paradise wrote:
Does it miss something or your issue is solved?

It is not solved, because it is not correct values that i need.
Yes, SetData works, but the values that pass in it are totals on report, not on page.
:(

_________________
MB7-840


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 2:46 pm 
Offline

Joined: Wed Jul 18, 2012 11:41 am
Posts: 40
Location: Kyiv
Country: Ukraine (ua)
Okey, it`s bad idea to use real task for question :mrgreen:
I will try to show you more simple example.

I use 21 Table for report and take field "Amount" for calculating.

Field "Total till record" is value which returns function "TotalFunc":

Code: Select all
Dim Total As Decimal

Public Function TotalFunc(ByVal Value As Decimal)
    Total = Total + Value
    Return Total
End Function

Code: Select all
=Code.TotalFunc(Fields!Cust__Ledger_Entry_Amount.Value)


As you see on screenshot - http://isaland.net/scrsht1.png - the green column is Sum of all previous "Amount"s include current-record amount.

It simple to calculate total on page - (Last!Green - First!Green + First!Amount)

But every time RDLC occurs error when I try to calculate 3 fields :(

_________________
MB7-840


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Wed Jul 25, 2012 3:33 pm 
Offline

Joined: Wed Jul 18, 2012 11:41 am
Posts: 40
Location: Kyiv
Country: Ukraine (ua)
I finaly found what i need:
Code: Select all
=SUM(ReportItems!Amount.Value)

And put it at header or footer in text box.

Thanks to all for help, especially for Troubles In Paradise =D>

_________________
MB7-840


Top
 Profile E-mail  
 
 Post subject: Re: How to calculate totals on page (not till page) in RDLC?
PostPosted: Thu Jul 26, 2012 8:37 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
Glad to see you found a solution :) .

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: