Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello people

I have a problem, I would like to calculate an expression and it is not allowed in RDLC I would like to know if there is another way.

I have a table with two columns, where [Coluna1] = 17 is from database, Coluna2 = Coluna1 * 25000, I would like to get the total of Coluna2, but it is giving the following error: Aggregate functions can be used only on report items contained in page headers and footers : Using Aggregate on Aggregate function in Expression

Thank you


What I have tried:

=Sum(reportitems!coluna2)
Posted
Updated 13-Jan-21 8:40am
Comments
Maciej Los 13-Jan-21 2:20am    
If Coluna2 = Coluna1 * 25000 then =SUM(Coluna1 * 25000).
Member 14669973 13-Jan-21 4:02am    
hey morning!

I'm using reportview (Rdlc) on VB.net, where am I supposed Apply this code?

I have been tried this:

Public Total_lookup_Sum As Integer = 0

Public Function Lookup_Sum(ByVal value As Integer) As Integer

Total_lookup_Sum = Total_lookup_Sum + value

Return value

End Function

=Code.Lookup_Sum(Fields!Divida.Value*Fields!Taxa.Value) in page property

and this: =Code.Total_lookup_Sum in TotalTextBox

But i di


You can write custom function for that. Below one has sample code with screenshots which's simple. You need to customize code based on your requirement
Aggregate functions can be used only on report items contained in page headers and footers : Using Aggregate on Aggregate function in Expression | Ashwani.Ashwin[^]
 
Share this answer
 
Comments
Maciej Los 13-Jan-21 4:09am    
5ed!
first of all thanks for everything,

I couldn't use this code but, I managed to find another way to get around and give the right result

what i did is opening a new column and that stayed like

Column1=17(Result From Database)

column2=25000(Result From Database)(Hided)

Column3(Total)=Fields!Column1.Value*Fields!column2.Value

Column4(Total)=Sum(Fields!Column1.Value)*(Fields!column2.Value)

and i Hide the Column2
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900