Showing posts with label visible. Show all posts
Showing posts with label visible. Show all posts

Thursday, March 22, 2012

Conditionally hidden groups

Hi,

I have conditionially visible groups that are show/hide based on a report parameter. The problem is that I also want to have a document label on this group. When the group is hidden a blank entry appears in the doument map rather that no entry at all. Is this a bug or is there some work around. Thanks.

This worked for me.

I have two report parameters, Group1 and Group2, and the user selects what field they want to group on. One of the options for Group2 is "None", meaning that they do not want to have a second grouping for the report. In this case, I hide the group header and footer rows, and set the document map label to Nothing.

Edit the group, and set the document map label to something like:

=IIF (Parameters!Group2.Value = "None", Nothing, "My Document Map Label for Group2")

cheers,

Helen

|||Thanks for the reply, I'll give it a whirl.

Conditionally hidden groups

Hi,

I have conditionially visible groups that are show/hide based on a report parameter. The problem is that I also want to have a document label on this group. When the group is hidden a blank entry appears in the doument map rather that no entry at all. Is this a bug or is there some work around. Thanks.

This worked for me.

I have two report parameters, Group1 and Group2, and the user selects what field they want to group on. One of the options for Group2 is "None", meaning that they do not want to have a second grouping for the report. In this case, I hide the group header and footer rows, and set the document map label to Nothing.

Edit the group, and set the document map label to something like:

=IIF (Parameters!Group2.Value = "None", Nothing, "My Document Map Label for Group2")

cheers,

Helen

|||Thanks for the reply, I'll give it a whirl.

Conditionally hidden groups

Hi,

I have conditionially visible groups that are show/hide based on a report parameter. The problem is that I also want to have a document label on this group. When the group is hidden a blank entry appears in the doument map rather that no entry at all. Is this a bug or is there some work around. Thanks.

This worked for me.

I have two report parameters, Group1 and Group2, and the user selects what field they want to group on. One of the options for Group2 is "None", meaning that they do not want to have a second grouping for the report. In this case, I hide the group header and footer rows, and set the document map label to Nothing.

Edit the group, and set the document map label to something like:

=IIF (Parameters!Group2.Value = "None", Nothing, "My Document Map Label for Group2")

cheers,

Helen

|||Thanks for the reply, I'll give it a whirl.

Tuesday, March 20, 2012

Conditional visibility

I need to pass a parameter to determine the visibility of a remark. If the
parameter defines it to be visible, I also need to toggle the visibility of
the remark when the user expands or collapses the containing group. I do
not want the visibility turned on when the parameter wants it always
invisible.
If the Visibility.ToggleItem was based upon an expression, I believe I could
easily do this. Does anyone know how or when this could be done?Have you try the Iif function ?
= Iif(MyParameter.Value = "ViewNotes", True, False)
So set this formula as the visibility formula.
"Walter Lundgren" <lundgren_w@.crane.navy.mil> a écrit dans le message de
news:ekQ2AxhXEHA.1684@.tk2msftngp13.phx.gbl...
> I need to pass a parameter to determine the visibility of a remark. If
the
> parameter defines it to be visible, I also need to toggle the visibility
of
> the remark when the user expands or collapses the containing group. I do
> not want the visibility turned on when the parameter wants it always
> invisible.
> If the Visibility.ToggleItem was based upon an expression, I believe I
could
> easily do this. Does anyone know how or when this could be done?
>|||Thanks, but I also need to consider the need for a drilldown hide/unhide
feature. The ToggleItem, initial visibility, and InitialToggleState are
properties that support drilldown.
The ToggleItem property is hardwired to consider only the collapsed/expanded
state of the controls on the Dropdown list. If I could use an expression to
set ToggleItem, the reported "remarks" would not need to be tied to the
state of the collapsed/expanded control.
"Jéjé" <willgart@._A_hAotmail_A_.com> wrote in message
news:%23QDQI7hXEHA.2940@.TK2MSFTNGP09.phx.gbl...
> Have you try the Iif function ?
> = Iif(MyParameter.Value = "ViewNotes", True, False)
> So set this formula as the visibility formula.
>
> "Walter Lundgren" <lundgren_w@.crane.navy.mil> a écrit dans le message de
> news:ekQ2AxhXEHA.1684@.tk2msftngp13.phx.gbl...
> > I need to pass a parameter to determine the visibility of a remark. If
> the
> > parameter defines it to be visible, I also need to toggle the visibility
> of
> > the remark when the user expands or collapses the containing group. I
do
> > not want the visibility turned on when the parameter wants it always
> > invisible.
> >
> > If the Visibility.ToggleItem was based upon an expression, I believe I
> could
> > easily do this. Does anyone know how or when this could be done?
> >
> >
>

Monday, March 19, 2012

Conditional sum based on visibility

Hi,

I have a report that is conditionally showing a textbox based on the previous entry that is working correctly.

My issue is that the non visible entries are still being added to my Sum statement at the end of the report.

I need a way to exclude an entry based on its visibility.

Any help would be greatly appreciated.

Are you using the Previous aggregate to get the previous entry? If you are not, then you can add a conditional, using the same expression for determining the visibility, to the SUM aggregate. For example, =SUM(IIF(HiddenExpression, 0, Fields!FieldName.Value))|||

Thanks for the response.

I am using the Previous function to control the visibility. The report needs to show the first entry for each particular company code, but not the duplicate entries.

For example: =Previous(Fields!Company_code.Value) = Fields!Company_code.Value

I tried adding a conditional with the same expression to determine if it should be included in the Sum, but that does not work.

Any other suggestions?

Thanks!

|||

Try handling it in the code (Report -> Report Properties -> Code)

Declare a public shared variable (integer/float) in the code and write a public function to sum up the values based on current company code and previous company code. Your code will look something like this in VB.Net:

Public Shared SumTotal as Integer

SumTotal = 0

Public Function CalculateSum(isCompanyCodeSame as Boolean, FieldValue as Integer) As String

If isCompanyCodeSame = False Then

SumTotal = SumTotal + FieldValue

End If

CalculateSum = ""

End Function

and

append this expression to any of the textboxes in your detail row:

Fields!FieldName.Value & Code.CalculateSum(Fields!Company_code.Value=Previous(Fields!Company_code.Value), Fields!FieldToBeSummed.Value)

And use Code.SumTotal to get the sum.

Shyam

|||

Thanks for the code!

It is working correctly now.

|||

I used the same method to stop displaying rows in a table after the 10th row. It works fine in VS 2005 but it acts wierd when I publish it to the production server. I count up the rows that are visible...

Public Shared VisibleRowTotal as Integer=0

Public Function CountVisibleRow(isVisible as Boolean) As String
If isVisible = False Then
VisibleRowTotal = VisibleRowTotal + 1
End If
CountVisibleRow = ""
End Function

Then I added a column in my report table to call the code...

=Code.CountVisibleRow(ReportItems!textbox54.Value) & " " & Code.VisibleRowTotal

Then I based my row visibility on the code value.

=IIF(Code.VisibleRowTotal>=10, True,False)

To get it to work the first time I had to rename the original report on the production server and then upload the new report. Once several users start hitting the report then no rows are visible or it's intermittent.

I'll admit I've have never used custom code in a report before. Is there something different I need to do when uploading an rdl with custom code? Am I handling the custom code properly?

|||
You should change the VisibleRowTotal variable to not be Shared. Having it be shared or static will cause each instance of the report to share the same total value. So, removing the modifier will allow each report instance to execute independently from one another.

Ian|||

Thanks Ian.

I had the issue where my totals were correct for the first time the report loaded, but the totals just kept incrementing when I used different filters on the report.

Taking Shared off of the variable resolved the issue.

Thursday, March 8, 2012

Conditional Image Visibility with Embedded code

I am trying to create a embedded function that will accept a dataset field
value and based on the value, make an image visibility hidden or visible in
the body of the report. I receive an error that the mathimage is not
declared. How do I reference an image in the body of the report. The field is
within a list and based on the subject an image is displayed in the bodiy of
the report.
Below is a sample of the embedded code.
Function VisibleYN(subject as string,passedyn as boolean) as double
if subject = "Math" and passedyn = true then
mathimage.visibility = visible
end if
if subject = "Science" and passedyn = true then
scienceimage.visibility = visible
end if
THe following expression is in the visibility property tab of the textbox
that holds the subject.
code.visibleyn(fields!subject.value as string, passedyn as boolean)
Any help would be appreciated!
--
MarieThe actual property is under the visibility and is named "IsHidden", so your
function should return a boolean rather than try and set a property.
Change
mathimage.visibility = visible
to
Return False
and likewise for your science one to get it to work.
"Marie" wrote:
> I am trying to create a embedded function that will accept a dataset field
> value and based on the value, make an image visibility hidden or visible in
> the body of the report. I receive an error that the mathimage is not
> declared. How do I reference an image in the body of the report. The field is
> within a list and based on the subject an image is displayed in the bodiy of
> the report.
> Below is a sample of the embedded code.
> Function VisibleYN(subject as string,passedyn as boolean) as double
> if subject = "Math" and passedyn = true then
> mathimage.visibility = visible
> end if
> if subject = "Science" and passedyn = true then
> scienceimage.visibility = visible
> end if
> THe following expression is in the visibility property tab of the textbox
> that holds the subject.
> code.visibleyn(fields!subject.value as string, passedyn as boolean)
> Any help would be appreciated!
> --
> Marie|||The reason I am trying to set the property is because the function is being
called from a textbox bound to a field. Based on the value in the field I am
setting the property of a checkmark image. If I return the boolean value how
do I use this value to set the property of another report item? I was hoping
I could do something like Reportitem.image1.ishidden = false.
Any suggestions?
Thanks for your help.
--
Marie
"David Swanson" wrote:
> The actual property is under the visibility and is named "IsHidden", so your
> function should return a boolean rather than try and set a property.
> Change
> mathimage.visibility = visible
> to
> Return False
> and likewise for your science one to get it to work.
> "Marie" wrote:
> > I am trying to create a embedded function that will accept a dataset field
> > value and based on the value, make an image visibility hidden or visible in
> > the body of the report. I receive an error that the mathimage is not
> > declared. How do I reference an image in the body of the report. The field is
> > within a list and based on the subject an image is displayed in the bodiy of
> > the report.
> >
> > Below is a sample of the embedded code.
> >
> > Function VisibleYN(subject as string,passedyn as boolean) as double
> > if subject = "Math" and passedyn = true then
> > mathimage.visibility = visible
> > end if
> > if subject = "Science" and passedyn = true then
> > scienceimage.visibility = visible
> >
> > end if
> >
> > THe following expression is in the visibility property tab of the textbox
> > that holds the subject.
> >
> > code.visibleyn(fields!subject.value as string, passedyn as boolean)
> >
> > Any help would be appreciated!
> >
> > --
> > Marie|||You can use an expression for the hidden property of the image in the report.
Right click on the image, expand Visibility, then use this in the Hidden
property
=TextBox1.Value="Math"
or
=iif(textBox1.Value="Math",true,false)
I was looking for something similar the other day, and I found the custom
code is a little quirky because I could not find a way to access control
members via code.
When I passed Me as an object, I got some interesting results. For example,
try
this:
function Test(me as object) as boolean
msgbox("String=" & Me.ToString)
return false
end sub
TextBox9.Value=Code.Test(me)
Check out the title of the msgbox itself! It looks like there is funcky
name mangling going on in the host, which prevents us from using objects
directly in custom code.
msgbox("Name=" & Me.Name) indicates a public member not available, so it
appears that unless there is a reflection trick, I have yet to find a way to
access member variables of a report control in custom code.
I'll keep an eye on this thread, and I hope this is of some help to you..
Dwayne