Sunday, February 26, 2012
Hiding Table Rows
Underneath there is a Hidden property. You can set this to an expression. So
you could do something like:
=iif(MyCondition, True, False)
HTH
Charles Kangai, MCT, MCDBA
"MER78" wrote:
> Is it possible to hide full table rows depending on data in a record?|||When I do that... it hides the row... but instead I just get blank space
where the row would have been.
"Charles Kangai" wrote:
> Yes. Highlight a table row in Layout view. Expand the Visibility property.
> Underneath there is a Hidden property. You can set this to an expression. So
> you could do something like:
> =iif(MyCondition, True, False)|||I see. Then do the following:
1) Remove all previous expressions.
2) Highlight the entire detail row again.
3) In the Properties sheet, select the Grouping property and click on the
ellipsis button to its right.
4) On the General tab, select a unique expression in the Expression column.
You want a unique expression for each row so that each row is in its own
group. You are not really grouping, but just pretending to, so that we can
use the Visibility feature.
5) Now click on the Visibility tab. For the Initial visibility radio button,
select Expression.
6) Now enter your expression, such as =IIF(Fields!MyRevenue.Value<100,True,
False)
This will now hide the (entire) row if MyRevenue is less than 100. You will
not get blank rows like before.
HTH this time
Charles Kangai, MCT, MCDBA
"MER78" wrote:
> When I do that... it hides the row... but instead I just get blank space
> where the row would have been.
> "Charles Kangai" wrote:
> > Yes. Highlight a table row in Layout view. Expand the Visibility property.
> > Underneath there is a Hidden property. You can set this to an expression. So
> > you could do something like:
> >
> > =iif(MyCondition, True, False)
Hiding Sub Total Rows depending upon the certain fields
I am trying to hide a sub total row depending upon certain fields . How would i go about doing that?
Thanks in Advance
This is how the report looks like......
Jan Feb March
Revenue R1 2 3 4
want to hide this line subtotal 2 3 4
R2 5 6 7
Total 7 9 11
Hi,
For the table row has visibility property.Write the condition in the expression of the Visibilty Property for that row.
Hope this helps
|||Its not a table . Its a matrix|||You can select edit the matrix group, in the visibility property, select expression and used the 'runningvalue' to determine when you want not to displace your group subtotal
Hiding Rows in Matrix
Hi,
I have a report which has got 52 rows of Week1/Week52. Depending on a field Duration (no. of weeks), I want tot display only those rows. i.e. If duration is 3 then display Row of week1, week2 and week3.
I tried to look in the visibility properties of rows in matrix report. But there is no option. Am I doing something wrong?
any help will be appreciated.
regards
Josh
Edit your row group and go to Visibility tab and use whatever expression you want there.
Shyam
|||Thanks for your reply.
I tried that, but there is no option of visibility when I select the rows. any idea as to what might be wrong?
thanks
Josh
|||Right click on any of your row and click on Edit Group and then go to Visibility tab.
Shyam
|||But it shows the values as blank, does not hide the row.
regards
Josh
|||Try using the same in visibility expressions of all the textboxes in the row.
Shyam
|||It works then. But still it leaves the blank space. So in essence if there is data for week1 to week4, it is displayed and then for week5 to week52 there is a blank space.
Any idea how this could be avoided?
regards
Josh
Sunday, February 19, 2012
Hiding columns does not shrink report
Although the columns become invisible and the table resizes as per the data,
the report width still remains the same. Hence, when the report is exported
to pdf, although the data fits on one screen, it still prints one extra empty
page. I do not want to use a matrix, because its a complex report which has
already been developed and I do not have enough time for re-development.The size of the report will be picking up on the body width. [If you can't
see this go to the property window, click the drop down at the top and select
'body']
So if you have 50 columns but are only showing 3 it will still default to
the width of the 50 columns - the body is always outside of this.
You could try having a landscape page, using smaller fonts, removing
uneccessary decimal places, rotaing column headers to be vertical, using
abbreviations in addition to making the column widths as small as they will
go.
"Madhusudan" wrote:
> I am trying to hide columns on a report depending on specific parameters.
> Although the columns become invisible and the table resizes as per the data,
> the report width still remains the same. Hence, when the report is exported
> to pdf, although the data fits on one screen, it still prints one extra empty
> page. I do not want to use a matrix, because its a complex report which has
> already been developed and I do not have enough time for re-development.|||Actually, your suggestions have already been implemented. Right now, there is
hardly any space in the report for additions. Whatever was possible has
already been made.
I was able to make out that the issue was due to the body width. Is there a
way to dynamically change the body width at runtime?
Also I have noted that, if I remove the page footer, the white space is not
printed on the html report. In this case the whole report resizes to the size
of the table. The report that I am working on, does not have a page header,
but it does have a page footer which just contains the page no. (page x of
y).
Thanks and Regards
Madhusudan
"adolf garlic" wrote:
> The size of the report will be picking up on the body width. [If you can't
> see this go to the property window, click the drop down at the top and select
> 'body']
> So if you have 50 columns but are only showing 3 it will still default to
> the width of the 50 columns - the body is always outside of this.
> You could try having a landscape page, using smaller fonts, removing
> uneccessary decimal places, rotaing column headers to be vertical, using
> abbreviations in addition to making the column widths as small as they will
> go.
> "Madhusudan" wrote:
> > I am trying to hide columns on a report depending on specific parameters.
> > Although the columns become invisible and the table resizes as per the data,
> > the report width still remains the same. Hence, when the report is exported
> > to pdf, although the data fits on one screen, it still prints one extra empty
> > page. I do not want to use a matrix, because its a complex report which has
> > already been developed and I do not have enough time for re-development.|||Madhusudan,
did you get a solution to this? I have the same issue.
Regards,
Andrew|||No Andrew, I did not get any answer to this question. Finally I had to create
a new report with the extra columns and show the respective report file
depending on the parameter selected. I know that, this would cause
maintenance issues as both the files would have to be updated if any changes
had to be done, but it was the only way out at that moment.
Regards,
Madhusudan
"Duke (AN247)" wrote:
> Madhusudan,
> did you get a solution to this? I have the same issue.
> Regards,
> Andrew
>|||Thanks Madhusudan,
that was my fallback plan. I was thinking of making the maintenance easier
by writing a utility application that would take the master version of a
given report, and then output extra RDL files with the hidden columns removed
from the RDL and the page resized.
Cheers,
Andrew
Hiding a table row depending on page number?
i am wondering if there is some way to hide a table row depending on the page number.
I have tried to find a way to access the global page number to use it in an expression for the visibility property on the table row, but i havent found anything useful.
Hi Palmie,
Unfortunatelly, global variables can be used only in the page header and footer. Maybe, if you know the number of columns in a page, then you can operate with the RowNumber variable (just an idea ).
Regards,
Janos
|||Do you mean something like this ? :IIF(RowNumber(Nothing) > [a number], True, False)
When i use that expression it hides the row on every page.
|||
Are you trying to show something only on page 1, or what exactly?
>L<
|||Yes, sorry if i wasnt being clear about that, i have a Table header row that i only want to show on the first page of the report.|||
OK then let's try the obvious things first:
If it is a group header, try hiding duplicates for a full dataset scope. If it is really a table header, make sure that "repeat on new page" is turned off.
You may have to turn "Can Shrink" on for all such items to get the effect you are after...
If none of these ideas work for you, tell me more about this table header and how it is placed, and I'll give it a shot...
For example maybe one of the following holds true:
it is a group header, and you want multiple repetitions, just not on any pages but #1 it is a table header and the table is contained in another control, so the table repeats multiple times in the report|||Hey again and sorry for the late reply.The table with the header row that i want to hide looks like this:
The table is not inside another control.
It is not a group header, just a table header.
The table has 3 header rows
Row 1 contains a subreport with a few textboxes and an image. This should be visible on all the pages. Row 2 contains a rectangle with some textboxes, This is the row i only want to show at the first page. Row 3 is the actual header for the detail rows and should be repeated on every page.|||
OK, gotcha. Assuming I have repro'd your situation correctly, this should work:
1. Add the following to your Report code:
Code Snippet
Public hideRow As Boolean = False
Function hideSpecialRow() As String
hideRow = True
Return ""
End Function
2. Add an expression to some textbox in header row #3 ( the one with the "actual header for the detail rows) or anyplace after row #2 I think would work. If it is an empty textbox, just make the expression
=Code.hideSpecialRow()
... but if you do not have an empty textbox, use this (make sure that you use & and not + in case, as in my example, the other value is not a string):
Code Snippet
=Max(Fields!Locale.Value) & Code.hideSpecialRow()
3. Select the row (not the textboxes) in row # 2. Set its Visibility property to:
Code Snippet
=Code.hideRowWhaddya think?
>L<
|||This looked like it could solve the problem, but I cant get it to work.I put the call for the function below the header row that i want
to hide, and I set the visibility property to the bool hideRow and it
is still repeating itself.
I checked the value of the bool before and after the call and it changes value
from False to True.
When i put a textbox with "=Code.hideRow.ToString" in the rows i get that
it is false in the row that is supposed to be hidden and true in the rows below that, and the header rows looks the same on every page.|||
>>When i put a textbox with "=Code.hideRow.ToString" in the rows i get that
it is false in the row that is supposed to be hidden and true in the rows below that, and the header rows looks the same on every page.
<<
It should be false in the row that is supposed to be hidden on page 1, and true *always* after that. For example it should be true in the first header row on page 2, as well as all subsequent rows. Can you verify that it is?
Assuming that it is, then there might be something else stopping the Visibility thing from working properly for you.
>>and I set the visibility property to the bool hideRow
What happens if you just edit the visibility property you have set here to =False? You should not see that row at all, even on page 1. Does this work as expected for you? (I just want to verify that it's being set in the right place and that nothing else is involved. -- I did test what I wrote and it did work <s>.)
>L<
|||
Lisa Nicholls wrote:
>>It should be false in the row that is supposed to be hidden on page 1, and true *always* after that. For example it should be true in the first header row on page 2, as well as all subsequent rows. Can you verify that it is?<<
It looks like RS copies the table header from the first page to the others.
Lisa Nicholls wrote:
What happens if you just edit the visibility property you have set here to =False? You should not see that row at all, even on page 1. Does this work as expected for you? (I just want to verify that it's being set in the right place and that nothing else is involved. -- I did test what I wrote and it did work.
|||
Yes, I did mean =True <s> Sorry.
>>
It is false on the first page and its the same on the other pages.
It looks like RS copies the table header from the first page to the others.
<<
Then something is wrong. If I put =Code.hideRow in the first header row, it is False on page 1, False on page 2, and then True on all other pages. This is because I set it in the third header row on page 2, so it is not True until *after* header row 1 on page 2.
OK, I see something else is involved here. The report I happened to pick to try this has the table inside a list element. I am not sure why that makes a difference but when I remove the list element I see what you describe. I'm sorry about this. I will try to figure out why it doesn't behave the same way and write back.
>L<
|||
OK -- I have pretty much confirmed that this works *IF* the table is in a list. This requires the list to have a group expression.
What happens is that the table's header row is suppressed for all the instances of the table inside that list. You might have multiple instances of the table on one page or, if you say "page break after" on the table, you would only see the header row in question on page 1. Which works exactly the way you want.
This is the bummer part -- it doesn't seem to work if you use a constant for the list's group expression, or anything that evaluates to a constant value, so if you don't actually need a group at all it won't work.
My original example happened to have a group, and I didn't notice that it had the table inside a list... because I generated the example using the report wizard <sigh>.
I don't know if the behavior (the table header seeming to be copied from the first page, without re-evaluation, if there is no group or list) is a bug or an optimization.
I don't suppose your table *has* a group and putting it inside a list is a viable possibility?
>L<
|||Nope, the table doesnt have a group. I tried putting the table in a list and just set an Id value for the report as group expression in the List but i still got that same problem where the report seems to copy the first page.|||
Well, like I said, this only is workable when the table *does* have a group and it can't be a group that doesn't change (I did try that <sigh>...) I'm not sure why this is because I am definitely using table header, not group header, but it made all the difference.
If I can think of a different approach I will post back here.
>L<
Hiding a group also hides all nested groups
Instead of giving visibility condition to the group (group row), try using the visibility condition on all textboxes (or any other elements) in that group individually. This way, you are hiding only those individual items instead of the group as a whole.
Shyam