I need to calculate them together in one value: TextBox1 + TextBox3 - TextBox2.
The classic client error occurs when i put more than one ReportItem in TextBox
The classic client error occurs when i put more than one ReportItem in TextBox
Couldn't you calculate the total in the body in order to pass only one value to the header?
The other way is to use "SetData" and "GetData" functions.
RDLC allows you to call more than 1 time "GetData" function in one Textbox (remember to convert them to string when passing to SetData and convert them to decimal when summing).
Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
The other way is to use "SetData" and "GetData" functions.
Layout:
Result (Error occurs when SetData run):
Report Code:
Shared HeaderData As Object
Public Function GetData(Num As Integer) As Object
Return Cstr(Choose(Num, Split(Cstr(HeaderData),Chr(177))))
End Function
Public Function SetData(NewData As Object)
If NewData <> “” Then
HeaderData = NewData
End If
End Function
It not exactly what i need. My task is to count totals "on current page", not "till current page".
Thats why i need to calculate those three Values in page header.
Which is the difference? I prefer to format the value in the PagePhysQty textbox, and then simply pass to setdata the value ready to be managed.
Try something like this...
I'm not sure it could work..
try something like this..
Edit:
I'm wrong you can't call many "ReportItems!" on the same textbox.
So calcualte total on the body and then pass one ReportItems to the header.
Is it clear?
I cannot use Last\First (Fields) in body - error occurs. Look at screenshot.
I have been tried all variants in "Body" to calculate these cursed three values ](*,)
:shock: it's impossible...
I attach a screenshot of the standard report "Budget" (ID: 8 ).
You can see "First" function in the body ("Last" works as well).
With this report I'm questioning all my "Report Knowledge"...
I have been tried all variants in "Body" to calculate these cursed three values ](*,)
:shock: it's impossible...
I attach a screenshot of the standard report "Budget" (ID: 8 ).
You can see "First" function in the body ("Last" works as well).
With this report I'm questioning all my "Report Knowledge"...
It seems i did mistake somewhere in my report. I have tried again, and First\Last function works. =D>
Now i have 3 columns with values, that i need to calculate.
They contain next expressions:
I will try to write in this post all information. I change code a little, to make my task clearly
First is PagePhysQtyFunc. This function will count Sum till current record:
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):
Answers
I have three TextBox`es in Page Header:
TextBox1=Last(ReportItems!PagePhysQty.Value)
TextBox2=First(ReportItems!PagePhysQty.Value)
TextBox3=First(ReportItems!ItemPhysQty.Value)
I need to calculate them together in one value: TextBox1 + TextBox3 - TextBox2.
The classic client error occurs when i put more than one ReportItem in TextBox
The other way is to use "SetData" and "GetData" functions.
RDLC allows you to call more than 1 time "GetData" function in one Textbox (remember to convert them to string when passing to SetData and convert them to decimal when summing).
example:
It works as expected... More or Less...
http://blogs.msdn.com/b/nav/archive/2011/06/06/transfooter-and-transheader-functionality-in-rdlc-ssrs-reports-revisited.aspx
/Claus Lundstrøm
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
Layout:
Result (Error occurs when SetData run):
Report Code:
Where i did mistake?
It not exactly what i need. My task is to count totals "on current page", not "till current page".
Thats why i need to calculate those three Values in page header.
I cannot see screenshot could you attach them?
Did you convert decimals into strings in the textbox you pass to SetData function?
It works as expected... More or Less...
The field that has error contains the expression below:
SetData expressions you can find at the top of mvs.png image.
And this just one column. I need to calculate whole eight column totals at each page ](*,)
I'm wondering if it's possible...
I explain better:
I would do as follow: Which is the difference? I prefer to format the value in the PagePhysQty textbox, and then simply pass to setdata the value ready to be managed.
Try something like this...
It works as expected... More or Less...
On screenshot you can see two fields which i marked with colors.
They both are in Body.
My task is to calculate: (Last Green) - (First Green) + (Last Blue) on every page of report, and show this value in header.
PagePhysQty is blue field
ItemPhysQty is green field
I know only one way to take values from that fields: and put them in three different textboxes. But i don`t know what to do next with SetData and GetData functions.
Have you already find a place in the body where you get needed values (maybe in the Table(Group)Footer)? If the BodyLine used to calculate these values is printed on everypage you could call them in the Header with: I'm not sure it could work..
try something like this..
Edit:
I'm wrong you can't call many "ReportItems!" on the same textbox.
So calcualte total on the body and then pass one ReportItems to the header.
Is it clear?
It works as expected... More or Less...
I have been tried all variants in "Body" to calculate these cursed three values ](*,)
I attach a screenshot of the standard report "Budget" (ID: 8 ).
You can see "First" function in the body ("Last" works as well).
With this report I'm questioning all my "Report Knowledge"...
Ps: sorry my VS is in Italian.
It works as expected... More or Less...
Now i have 3 columns with values, that i need to calculate.
They contain next expressions: Code function calculate total on each line.
What is the next step? I feel the solution is close
Create a textbox on the same line of those "totals" and then use the SetData function: after that in the header: Something like this should work..
It works as expected... More or Less...
After that I insert one more column next to last field and put there: Then i put textbox to header and insert: But error occurs when i try to save it.
It works as expected... More or Less...
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?
It works as expected... More or Less...
First is PagePhysQtyFunc. This function will count Sum till current record:
First Red Field is field where i want to find last result from PagePhysQtyFunc on page (not from all report):
Second Red Field is field where i want to find first result from PagePhysQtyFunc on page (not from all report):
Third Red Field is field where i want to find first value of 4 column on page (not from all report):
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
It works as expected... More or Less...
Does it miss something or your issue is solved?
It works as expected... More or Less...
Yes, SetData works, but the values that pass in it are totals on report, not on page.
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":
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
Thanks to all for help, especially for Troubles In Paradise =D>
It works as expected... More or Less...