1

I have the following:

=Round(ReportItems!Textbox47.Value
+ CDbl(ReportItems!Textbox218.Value)
+ CDbl(ReportItems!Textbox222.Value)
+ CDbl(ReportItems!Textbox226.Value)
+ CDbl(ReportItems!Textbox230.Value)
+ CDbl(ReportItems!Textbox234.Value),2,MidpointRounding.ToEven)

This is saved in the Textbox called ReportItems!TotalSaves.Value

This TextBox is part of DataSet1. What I want to do is call that TextBox in another DataSet.

I tried a Lookup and it does not work. I tried to save the value of that TextBox in a global variable but it does not take Items in the report collection.

EDIT1:

I tried to do the following:

Public Function GetValue(Byval value  as Double) 
prueba = value
End Function

Public Function Value() As Double
Return prueba
End Function

I called the function GetValue inside the Dataset1 where ReportItems!TotalSaves.Value exists in an expression:

Code.GetValue(ReportItems!TotalSaves.Value)

And then call the Value function in the Dataset2

Code.Value()

But it returns 0 so there is no value saved, maybe it is saved but for some reason Value does not get the value that it is saved in the GetValue function, even if it is the same variable.

EDIT2:

I tried to do the changes Alejandro told me: enter image description here

But: enter image description here

In English: "The expression value for the TextBox50 make a reference to an element "TotalFrecPromVentas" (This is the textbox that exists in Tablix1/dataset1 that does not exists in Tablix2/Dataset2),the element expressions of the report can only reference to another elements of the same group.

Pedram
  • 6,256
  • 10
  • 65
  • 87
Nickso
  • 785
  • 1
  • 10
  • 32
  • If I am right, that expression is placed in a textbox of a tablix set to DataSet1, what you want to do is take the value of that textbox and place it in a textbox of another dataset tablix. Right? – alejandro zuleta Oct 27 '15 at 14:34
  • Yes, Dataset1 have that expression in a TextBox and the idea is to reference that textbox in another textbox of another Dataset in a separate Tablix – Nickso Oct 27 '15 at 14:36
  • I think is not necessary use a function to return the value cause you are not aggregating anything. Check my answer it works for me. – alejandro zuleta Oct 27 '15 at 15:09

2 Answers2

0

Try change:

Dim public total as Double 

Public Function GetValue(ByVal numero as Double ) AS Double
    total = numero  
    return total
End Function

In the selected textbox named Mytextbox I put manually a double value: =12.456.

The textbox in red rectangle is the textbox where I want to place the referenced Mytextbox value

enter image description here

So in the textbox I put the following expression:

=Code.GetValue(ReportItems!MyTextbox.Value)

You have to put =Code.GetValue(ReportItems!TotalSaves.Value).

Note I am not using Value() function. My function just returns the value of the passed parameter.

enter image description here

Don't use Value() function use my code.

It worked for me. Let me know if it could help you.

alejandro zuleta
  • 13,962
  • 3
  • 28
  • 48
0

You can reference a textbox in another dataset by using the ReportItems!TotalSaves.Value you identified in your question.

For example if I have a text box that sums the values in a column as follows

enter image description here

I can reference this value from another table using a different dataset as follows

enter image description here

This would result in the following output, in this case a very simple definition of the 6 times table

enter image description here

Is this the sort of solution you were looking for? If you need further clarification, or a different approach then let me know.

Jonnus
  • 2,988
  • 2
  • 24
  • 33
  • I'm not sure how the information in Edit2 relates to my proposed answer... This solution does not use any `public function`s – Jonnus Oct 27 '15 at 15:44