Friday, March 9, 2012

Refer to value of textbox?

Hi all,
How would I go about referring to the value of a TextBox within a report? I
have a TextBox that I named "txtCount", in which I use an IIf expression to
selectively count records when in a group. In the footer of the container
group, I'd like to refer to that TextBox's value. I have no idea how to do
it. I tried Fields!txtCount.Value and that didn't work. I can't even refer
to a TextBox's value in the same detail line, so I must be missing
something. Or is it not possible to refer to another TextBox's value?
Thanks in advance for any help!
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]You can get textbox value by refer to "ReportItems!<textboxname>.Value
I'm not sure it will work in your case: Report item expressions can only
refer to other report items within the same grouping scope or a containing
grouping scope.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jake Marx" <msnews@.longhead.com> wrote in message
news:%23rwU3vHjEHA.2456@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> How would I go about referring to the value of a TextBox within a report?
> I
> have a TextBox that I named "txtCount", in which I use an IIf expression
> to
> selectively count records when in a group. In the footer of the container
> group, I'd like to refer to that TextBox's value. I have no idea how to
> do
> it. I tried Fields!txtCount.Value and that didn't work. I can't even
> refer
> to a TextBox's value in the same detail line, so I must be missing
> something. Or is it not possible to refer to another TextBox's value?
> Thanks in advance for any help!
> --
> Regards,
> Jake Marx
> MS MVP - Excel
> www.longhead.com
> [please keep replies in the newsgroup - email address unmonitored]
>|||Jake Marx wrote:
> Hi all,
> How would I go about referring to the value of a TextBox within a
> report? I have a TextBox that I named "txtCount", in which I use an
> IIf expression to selectively count records when in a group. In the
> footer of the container group, I'd like to refer to that TextBox's
> value. I have no idea how to do it. I tried Fields!txtCount.Value
> and that didn't work. I can't even refer to a TextBox's value in the
> same detail line, so I must be missing something. Or is it not
> possible to refer to another TextBox's value?
OK - I found it online: ReportItems!txtCount.Value.
I can refer to a TextBox in the same group using that syntax.
However, what I'm looking to do is as follows:
Group 1: Client
Group 2 (inside Group 1): Status
Details: Claims
There are 4 statuses possible. What I'm trying to do is get the counts of
each Status *in the footer of Group 1*. I can't think of a good way to do
this. I can get the total Claims count within Group 1, and I can get counts
of each Status within Group 2. But I can't figure out how to get a count of
each Status type from Group 1. I need to do a calculation on the Client
level based on those counts. I tried the following, which didn't work:
1) created 4 textboxes in the Group 2 footer to hold the counts for each
status
2) tried summing the values of the textboxes created in step 1 from the
Group 1 footer
Any other ideas? Am I approaching this the wrong way?
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]|||Lev Semenets [MSFT] wrote:
> You can get textbox value by refer to "ReportItems!<textboxname>.Value
> I'm not sure it will work in your case: Report item expressions can
> only refer to other report items within the same grouping scope or a
> containing grouping scope.
Thanks, Lev. I composed my other post before I saw your reply. Do you have
any ideas on my other post?
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]|||I think, in step 2 you may put expressions into those 4 textboxes
for 1st status:
=Sum(iif(Fields!Status.Value == "Status1", 1, 0))
for 2nd
=Sum(iif(Fields!Status.Value == "Status2", 1, 0))
etc.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jake Marx" <msnews@.longhead.com> wrote in message
news:OXcqPNIjEHA.1776@.TK2MSFTNGP15.phx.gbl...
> Jake Marx wrote:
>> Hi all,
>> How would I go about referring to the value of a TextBox within a
>> report? I have a TextBox that I named "txtCount", in which I use an
>> IIf expression to selectively count records when in a group. In the
>> footer of the container group, I'd like to refer to that TextBox's
>> value. I have no idea how to do it. I tried Fields!txtCount.Value
>> and that didn't work. I can't even refer to a TextBox's value in the
>> same detail line, so I must be missing something. Or is it not
>> possible to refer to another TextBox's value?
> OK - I found it online: ReportItems!txtCount.Value.
> I can refer to a TextBox in the same group using that syntax.
> However, what I'm looking to do is as follows:
> Group 1: Client
> Group 2 (inside Group 1): Status
> Details: Claims
> There are 4 statuses possible. What I'm trying to do is get the counts of
> each Status *in the footer of Group 1*. I can't think of a good way to do
> this. I can get the total Claims count within Group 1, and I can get
> counts
> of each Status within Group 2. But I can't figure out how to get a count
> of
> each Status type from Group 1. I need to do a calculation on the Client
> level based on those counts. I tried the following, which didn't work:
> 1) created 4 textboxes in the Group 2 footer to hold the counts for each
> status
> 2) tried summing the values of the textboxes created in step 1 from the
> Group 1 footer
> Any other ideas? Am I approaching this the wrong way?
> --
> Regards,
> Jake Marx
> MS MVP - Excel
> www.longhead.com
> [please keep replies in the newsgroup - email address unmonitored]
>|||Lev Semenets [MSFT] wrote:
> I think, in step 2 you may put expressions into those 4 textboxes
> for 1st status:
> =Sum(iif(Fields!Status.Value == "Status1", 1, 0))
> for 2nd
> =Sum(iif(Fields!Status.Value == "Status2", 1, 0))
> etc.
Great - thanks, Lev!
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]

No comments:

Post a Comment