all groups > sql server reporting services > december 2005 >
You're in the

sql server reporting services

group:

Referencing textbox values in expressions


Referencing textbox values in expressions Kursplat
12/7/2005 10:08:22 AM
sql server reporting services:
I have a table displaying output from a query. I have cells "a" and "b"
that contain expressions performing calculations on fields in the query. I
would like to create an expression in cell "c" that performs a calculation
on the values in cells "a" and "b".

I can't seem to figure out how to reference the values of the textboxes in
the table. Even putting something as simple as "=a.text" or "=a.value"
returns an error that "a" is not declared ("a" being the name of the
textbox control).

Considering you need "Fields!" for referencing fields and "Parameters!" for
referencing parameters, I suspect that there is something comparable for
referencing the report controls, but I can't find any references to it in
the Books Online.

Does anyone know if this is possible, and if so how?

Re: Referencing textbox values in expressions Bruce L-C [MVP]
12/7/2005 12:51:34 PM
One thing you might want to consider is adding a field to your dataset. When
you have the list of fields that you would drag and drop from when in the
layout tab, do a right mouse click, add. Pick calculated field. Add the
expressions for cell a and cell b. Now these are considered a field like
anything else. You can now create an expression in c that refers to field a
and field b. I find things more understandable and cleaner. Plus, let's say
you want to do a sum or something else on a grouping. No problem, it is just
a field like any other.

This is not real discoverable but in some situations it really makes things
simplier.

HTH,


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Referencing textbox values in expressions Kursplat
12/8/2005 8:08:22 AM
I would do that if I could (I've tried), but the expression in the
source textboxes are calling functions in an Assembly, which I've
learned the hard way can't be called from the query (it crashes Visual
Studio every time I try).

So, I'm still looking for a way to have the expression of one textbox in
a table reference the value of another textbox in that table.

Thanks for the suggestion, though.

"Bruce L-C [MVP]" <bruce_lcNOSPAM@hotmail.com> wrote in
news:e$iAA91#FHA.952@TK2MSFTNGP10.phx.gbl:

[quoted text, click to view]
Re: Referencing textbox values in expressions Kursplat
12/8/2005 12:42:19 PM
I found it in another post. You use "ReportItems!" to reference the
controls on the report.

Kursplat <newsgroup-spam@microsoft.com> wrote in news:eHD9dGB$FHA.1028
@TK2MSFTNGP11.phx.gbl:

[quoted text, click to view]
Re: Referencing textbox values in expressions daniel_xi
12/8/2005 12:47:21 PM
Hi Kursplat,

For a workaround, in your query, you can set up the calculations there,
then refer to them in cells a and b in your table. From there, you can add
another cell c, and use the Fields! method to call the values in cells a and
b and manipulate those values as you wish in an expression.
Does that make sense?

Cheers,

Daniel.


[quoted text, click to view]
AddThis Social Bookmark Button