Showing posts with label subreport. Show all posts
Showing posts with label subreport. Show all posts

Wednesday, March 7, 2012

Hierarchical Subreports

Does the ReportViewer support hierachical subreports (a subreport in a
subreport)? If so, how do you get the SubreportProcessing event to fire on
the second or higher level subreports? Or better yet, how do you add a
subreport to a subreport and get it to populate?
--
Thanks,
PaulNo reason why you can not do hierarchical subreports. As with any report you
need to insert a subreport control and define the properties of this
subreport. These would include:
a) the subreport's name, and
b) the report parameter mappings (if any) to feed into the subreport
HTH,
Magendo_man
"Paul M" wrote:
> Does the ReportViewer support hierachical subreports (a subreport in a
> subreport)? If so, how do you get the SubreportProcessing event to fire on
> the second or higher level subreports? Or better yet, how do you add a
> subreport to a subreport and get it to populate?
> --
> Thanks,
> Paul

Friday, February 24, 2012

Hiding main report row if subreport is empty

I have a main report with a list of people, and a subreport that has
data about that person. How can I hide the person's name (the main
report row) if the subreport has no data about that person?
Thanks,
Hanhannibal,
I answered this yesterday. See your initial post.
Michael
"Hannibal111111" wrote:
> I have a main report with a list of people, and a subreport that has
> data about that person. How can I hide the person's name (the main
> report row) if the subreport has no data about that person?
> Thanks,
> Han
>

Hiding Main Report row if subreport is empty

I have a main report which has a list of people, and a subreport with
some data about each person. How do I hide that person's name (ie the
main report row) if the subreport of that person does not contain any
data?
Thanks,
HanHey Hannibal,
There are probably a few ways to deal with this, but what I usually do is
just add a reference in your main reports dataset to the people_detail table.
Then add an expression that evaluates that reference. For example:
if your dataset is
SELECT pkyPeople, firstname, lastname FROM People
modify it to be
SELECT p.pkyPeople,firstname,lastname, pd.fkyPeople
FROM People as p LEFT OUTER JOIN People_Details as pd on
p.pkyPeople=pd.fkyPeople
Then, when your running your report you just need an expression in the
'visibility' sections 'Hidden' field that reads
=IIf(Fields!fkyPeople.value = "", True, False)
Michael
"Hannibal111111" wrote:
> I have a main report which has a list of people, and a subreport with
> some data about each person. How do I hide that person's name (ie the
> main report row) if the subreport of that person does not contain any
> data?
> Thanks,
> Han
>|||On Jul 18, 7:16 pm, Michael C <Micha...@.discussions.microsoft.com>
wrote:
> Hey Hannibal,
> There are probably a few ways to deal with this, but what I usually do is
> just add a reference in your main reports dataset to the people_detail table.
> Then add an expression that evaluates that reference. For example:
> if your dataset is
> SELECT pkyPeople, firstname, lastname FROM People
> modify it to be
> SELECT p.pkyPeople,firstname,lastname, pd.fkyPeople
> FROM People as p LEFT OUTER JOIN People_Details as pd on
> p.pkyPeople=pd.fkyPeople
> Then, when your running your report you just need an expression in the
> 'visibility' sections 'Hidden' field that reads
> =IIf(Fields!fkyPeople.value = "", True, False)
> Michael
>
> "Hannibal111111" wrote:
> > I have a main report which has a list of people, and a subreport with
> > some data about each person. How do I hide that person's name (ie the
> > main report row) if the subreport of that person does not contain any
> > data?
> > Thanks,
> > Han- Hide quoted text -
> - Show quoted text -
I would love to do that, unfortunately the detail data is contained on
a different server, which is the reason why I had to use the
subreport. Any other ideas?|||As a matter of fact I do!
i would change my nesting from
Main Report (people data)
--> SubReport (people details)
To be
1. Main Report (Parameter Data)
2. --> SubReport (People Data filtered by paramters. 1 person at a
time)
3. --> subSubReport (Details)
Now, level 1 simply passes the current person to level 2. At level 2 you
need two datasources. The first one looks at the People Server the second
one at the Details Server. The first dataset for the level 2 report looks
just like it does currently, except you need to add a WHERE PeopleId =@.People (to filter for the current person). Then you need to add a second
dataset, whose DataSource is the Detail Server. In this dataset you filter
for the details of that same person. Then just evaluate
First(Fields!PersonId.Value,"PersonDetails") to see if there is any data. At
this point you will then know whether or not to hide the details subreport.
Please feel free to ask for more description if this doesn't make sense! I
hope this helps though.
Michael
> On Jul 18, 7:16 pm, Michael C <Micha...@.discussions.microsoft.com>
> wrote:
> > Hey Hannibal,
> > There are probably a few ways to deal with this, but what I usually do is
> > just add a reference in your main reports dataset to the people_detail table.
> > Then add an expression that evaluates that reference. For example:
> >
> > if your dataset is
> >
> > SELECT pkyPeople, firstname, lastname FROM People
> >
> > modify it to be
> >
> > SELECT p.pkyPeople,firstname,lastname, pd.fkyPeople
> > FROM People as p LEFT OUTER JOIN People_Details as pd on
> > p.pkyPeople=pd.fkyPeople
> >
> > Then, when your running your report you just need an expression in the
> > 'visibility' sections 'Hidden' field that reads
> >
> > =IIf(Fields!fkyPeople.value = "", True, False)
> >
> > Michael
> >
> >
> >
> > "Hannibal111111" wrote:
> > > I have a main report which has a list of people, and a subreport with
> > > some data about each person. How do I hide that person's name (ie the
> > > main report row) if the subreport of that person does not contain any
> > > data?
> >
> > > Thanks,
> >
> > > Han- Hide quoted text -
> >
> > - Show quoted text -
> I would love to do that, unfortunately the detail data is contained on
> a different server, which is the reason why I had to use the
> subreport. Any other ideas?
>|||Ah...I just figured out why this may not work because I've never deployed
anything like that...however can you assign 2 datasources in ReportManager to
a single report? Interesting problem....
"Hannibal111111" wrote:
> On Jul 18, 7:16 pm, Michael C <Micha...@.discussions.microsoft.com>
> wrote:
> > Hey Hannibal,
> > There are probably a few ways to deal with this, but what I usually do is
> > just add a reference in your main reports dataset to the people_detail table.
> > Then add an expression that evaluates that reference. For example:
> >
> > if your dataset is
> >
> > SELECT pkyPeople, firstname, lastname FROM People
> >
> > modify it to be
> >
> > SELECT p.pkyPeople,firstname,lastname, pd.fkyPeople
> > FROM People as p LEFT OUTER JOIN People_Details as pd on
> > p.pkyPeople=pd.fkyPeople
> >
> > Then, when your running your report you just need an expression in the
> > 'visibility' sections 'Hidden' field that reads
> >
> > =IIf(Fields!fkyPeople.value = "", True, False)
> >
> > Michael
> >
> >
> >
> > "Hannibal111111" wrote:
> > > I have a main report which has a list of people, and a subreport with
> > > some data about each person. How do I hide that person's name (ie the
> > > main report row) if the subreport of that person does not contain any
> > > data?
> >
> > > Thanks,
> >
> > > Han- Hide quoted text -
> >
> > - Show quoted text -
> I would love to do that, unfortunately the detail data is contained on
> a different server, which is the reason why I had to use the
> subreport. Any other ideas?
>

Hiding Main Report Items based on SubReport Value

Hi Group,
How do i Conditionally Hide the Main Report Iitem based on the SubReport
Value.
My Main Report Looks Like This
Task Id Description Effort
1020 Project Plan 100(Subreport Item)
What i want is if the effort is Zero i Should hide 1020,Project Plan and My
Subreport Value,Items How do i do
Respond ASAPThe main report cannot reach inside the subreport(s) to extract values. You
would need to make sure the relevant value is available in your main query.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"Manoj.Pasumarthi" <ManojPasumarthi@.discussions.microsoft.com> wrote in
message news:D0A47874-C1C6-4D0A-88AA-A96BE0E27094@.microsoft.com...
> Hi Group,
> How do i Conditionally Hide the Main Report Iitem based on the SubReport
> Value.
> My Main Report Looks Like This
> Task Id Description Effort
> 1020 Project Plan 100(Subreport Item)
> What i want is if the effort is Zero i Should hide 1020,Project Plan and
My
> Subreport Value,Items How do i do
> Respond ASAP
>|||Hi Chris,
Thank u
"Chris Hays [MSFT]" wrote:
> The main report cannot reach inside the subreport(s) to extract values. You
> would need to make sure the relevant value is available in your main query.
> --
> This post is provided 'AS IS' with no warranties, and confers no rights. All
> rights reserved. Some assembly required. Batteries not included. Your
> mileage may vary. Objects in mirror may be closer than they appear. No user
> serviceable parts inside. Opening cover voids warranty. Keep out of reach of
> children under 3.
> "Manoj.Pasumarthi" <ManojPasumarthi@.discussions.microsoft.com> wrote in
> message news:D0A47874-C1C6-4D0A-88AA-A96BE0E27094@.microsoft.com...
> > Hi Group,
> >
> > How do i Conditionally Hide the Main Report Iitem based on the SubReport
> > Value.
> > My Main Report Looks Like This
> >
> > Task Id Description Effort
> > 1020 Project Plan 100(Subreport Item)
> >
> > What i want is if the effort is Zero i Should hide 1020,Project Plan and
> My
> > Subreport Value,Items How do i do
> >
> > Respond ASAP
> >
> >
>
>|||"Chris Hays [MSFT]" wrote:
> The main report cannot reach inside the subreport(s) to extract values. You
> would need to make sure the relevant value is available in your main query.
> --
> This post is provided 'AS IS' with no warranties, and confers no rights. All
> rights reserved. Some assembly required. Batteries not included. Your
> mileage may vary. Objects in mirror may be closer than they appear. No user
> serviceable parts inside. Opening cover voids warranty. Keep out of reach of
> children under 3.
> "Manoj.Pasumarthi" <ManojPasumarthi@.discussions.microsoft.com> wrote in
> message news:D0A47874-C1C6-4D0A-88AA-A96BE0E27094@.microsoft.com...
> > Hi Group,
> >
> > How do i Conditionally Hide the Main Report Iitem based on the SubReport
> > Value.
> > My Main Report Looks Like This
> >
> > Task Id Description Effort
> > 1020 Project Plan 100(Subreport Item)
> >
> > What i want is if the effort is Zero i Should hide 1020,Project Plan and
> My
> > Subreport Value,Items How do i do
> >
> > Respond ASAP
> >
> >
>
>|||I'm guessing the original question was in regards to RS 2000. Has the answer
changed with RS 2005? Can subreport values be referenced from the master
report in RS 2005
"Chris Hays [MSFT]" wrote:
> The main report cannot reach inside the subreport(s) to extract values. You
> would need to make sure the relevant value is available in your main query.
> --
> This post is provided 'AS IS' with no warranties, and confers no rights. All
> rights reserved. Some assembly required. Batteries not included. Your
> mileage may vary. Objects in mirror may be closer than they appear. No user
> serviceable parts inside. Opening cover voids warranty. Keep out of reach of
> children under 3.
> "Manoj.Pasumarthi" <ManojPasumarthi@.discussions.microsoft.com> wrote in
> message news:D0A47874-C1C6-4D0A-88AA-A96BE0E27094@.microsoft.com...
> > Hi Group,
> >
> > How do i Conditionally Hide the Main Report Iitem based on the SubReport
> > Value.
> > My Main Report Looks Like This
> >
> > Task Id Description Effort
> > 1020 Project Plan 100(Subreport Item)
> >
> > What i want is if the effort is Zero i Should hide 1020,Project Plan and
> My
> > Subreport Value,Items How do i do
> >
> > Respond ASAP
> >
> >
>
>

Sunday, February 19, 2012

Hiding a subreport SSRS

Hi,

I'm a newbie inSSRS, kindly help!!

i have a subreport and it needs to be displayed only based on some selection criteria, in all other case it needs to be hidden.i made the visibility to hidden, but when i run the report,it gives me a blank page where it usually gets me the subreport.How can i remove this blank page from getting displayed ?

PS: this is the expression i have added :

=IIF(Parameters!strChoice.Value="Single",True,False)

Thanks in advance for any help..

Hello,

Is the subreport part of a table?

If it's in a table row, then you will need to set the visibility on the row itself, not the subreport.

Jarret

|||

Thanx Jarret

I tried toggling the visibility of the row having the subreport.

i gave the same expression as well,but i'm still getting the blank page.

Thanx for any help.

Hiding a subreport - How to suppress the blank line ?

Hi, I have a main report with several subreports in a list. If I hide a subreport that contains no data by using the "visibility" attribute, there s always a blank line left in the list. Is there any way to suppress that blank line?

Minimize the size(width and height) of the sub report to the maximum extent.

sincerely,

Amde

|||

Hi,

I have the same problem. I am using a sub report with a table. Even, if I reduce the height to maximum extent, it still adds up and creates blank space. Is there any other way?

Can I suppress a single cell of the table if it is blank?

Thanks in advance !!!

|||Thanks, I tried that before, but that doesn′t solve my problem.
Even when I minimize the height of the line in the main report or the sub report itself, there′s still a noticable blank line. In my case, I′ve got like 6 or more sub reports in that table and even minimized there′s too much blank space if more than one sub reports are hidden.
Isn′t there any way to completley hide the line, where the sub report would have been?
|||Common guys, any "Pro" out there has got to know how to do that?!
Or is it just impossible?
I postet on several forums and a lot of people have this problem, too, but noone seems to have a solution for this.
|||

hi nic

Create an Empty Row in yout table.

Embed the sub-report in this table row.

Hide the table row when theres no data in your subreport.

And it will hide the extra space

|||

Hi,

Right click on the field and go to expression.

In expression type the below

=IIF(Field!FieldName="",true,false)

Regards,

Prashant

|||

What is the actual expression to "Hide the table row when theres no data in your subreport" ?

Thanks,

Pete

Hiding a subreport

We have a parameter that takes the values of "Yes" or "No" (non-queried). If the user chooses "Yes", we want the subreport to display, but remain hidden on "No".

In the expression for visibility, we have the following:

=IIf(cstr(Parameters!Heading.Value = "Yes"),False,True)

When the report runs we get the following error: "The input string was not in the correct format."

Has anybody seen this before?

Thanks for the information.

Problem solved - the parameter data-type was set to boolean.

Hiding a Subreport

Hi, Folks.
I have a "List" report which contains a "Table"-style subreport.
I'd like to display the table, WITH the headers, as the subreport ONLY IF
there are some elements to be displayed within the table. In many cases,
there will be no data in the subreport. I'd like to suppress the entire
subreport if there are no rows in the table.
Alternatively, I'd be happy to simply suppress/hide the table header row
when the number of rows returned is zero. I have a field in the table
header called "NumKey", which is the Count(KeyValue). If no records, then
the table should be hidden; if there are one or more records, all the
records AND the table leader should be displayed.
Alas, there doesn't seem to be anyplace that I can access the "Visible"
property for the entire subreport from within the subreport itself, and
there's no place within the table header that allows me to change the
"Visible" propery of the header row based on the "NumKey" text box.
This ought to be possible. What am I missing?
Thanks.
--
---
Ken Mitchell ken@.creativemindssacramento.com
916-275-3610 (voice) Citrus Heights, CA
--http://www.creativemindssacramento.com--
"Those of us who DO remember our history are condemned to live
watching others around us trying to repeat it. "
---Two options:
1. Set the visible property on the table and use Count(KeyValue) in the
expression for this property.
2. Set the NoRows property on the table, so the NoRows text will be shown
instead of the table when there is no data.
Fang Wang (MSFT)
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ken Mitchell" <cmmcken@.comcast.net> wrote in message
news:OFTN4w%23XEHA.2972@.TK2MSFTNGP12.phx.gbl...
> Hi, Folks.
> I have a "List" report which contains a "Table"-style subreport.
> I'd like to display the table, WITH the headers, as the subreport ONLY IF
> there are some elements to be displayed within the table. In many cases,
> there will be no data in the subreport. I'd like to suppress the entire
> subreport if there are no rows in the table.
> Alternatively, I'd be happy to simply suppress/hide the table header row
> when the number of rows returned is zero. I have a field in the table
> header called "NumKey", which is the Count(KeyValue). If no records, then
> the table should be hidden; if there are one or more records, all the
> records AND the table leader should be displayed.
> Alas, there doesn't seem to be anyplace that I can access the "Visible"
> property for the entire subreport from within the subreport itself, and
> there's no place within the table header that allows me to change the
> "Visible" propery of the header row based on the "NumKey" text box.
> This ought to be possible. What am I missing?
> Thanks.
> --
> ---
> Ken Mitchell ken@.creativemindssacramento.com
> 916-275-3610 (voice) Citrus Heights, CA
> --http://www.creativemindssacramento.com--
> "Those of us who DO remember our history are condemned to live
> watching others around us trying to repeat it. "
> ---
>
>