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

Wednesday, March 28, 2012

Parameter passing from master to subreport

Is it possible to pass a multi-value parameter from a master report to one or more subreports? If so, how?

Thanks for any help.

Wayne E. Pfeffer

Yes you can do this. I suggest the following: In your subreport make the report parameter a multi-value parameter. Test the subreport stand alone and make sure it works. Then drop the subreport into your main report, and map the subreport parameters to the main report parameters.

Scenario 1 (multi value parameter pass through):
The Main report has report parameter A which is a multi value parameter. You want to pass it to SubReport1 which has a report parameter B which is also defined as multi value parameter. In this case the mapping is just a simple parameter expression: =Parameters!A.Value
The subreport RDL element would look like this:
<Subreport Name="SubReport1">
...
<Parameters>
<Parameter Name="B">
<Value>=Parameters!A.Value</Value>
</Parameter>
</Parameters>
</Subreport>


Scenario 2:
The Main report has no report parameters. You have a SubReport1 with a report parameter B defined as multi value parameter. You want to pass e.g. three selected values "A", "B", "C" as parameter values to the subreport. You need to create a multidimensional object array on-the-fly, e.g. with the Split function, e.g.: =Split("A,B,C", ",")
RDL example:
<Subreport Name="SubReport1">
...
<Parameters>
<Parameter Name="B">
<Value>=Split("A,B,C", ",")</Value>
</Parameter>
</Parameters>
</Subreport>


Scenario 3:
The Main report has a multi-value parameter A. You want to pass only the first selected value from the main report's parameter to the subreport and the subreport's report parameter B is a single-value parameter. You can do this by using e.g. =Parameters!A.Value(0)
RDL example:
<Subreport Name="SubReport1">
...
<Parameters>
<Parameter Name="B">
<Value>=Parameters!A.Value(0)</Value>
</Parameter>
</Parameters>
</Subreport>


-- Robert

|||Thank you for the help, it worked out.

Wayne|||Is there a limit on how many parameters you can pass if you are using Scenario1. I have 5 parameters and 1 subreport. I can pass in the first 4 (A,B, C,D) and the report works fine but when I try to pass in the last one (E), which is no different than the previous 4 parameters other than it might have a few more values than the others, I get an error saying that one or more parameters need has not been specified.|||

There is no limit on the number of parameters.

Instead, it seems like the parameter values passed in violate constraints defined for the subreport parameters. For example, the subreport parameter's data type is integer and you pass string values. Or you pass a NULL value ('Nothing' in VB) as one of the parameter values - which is not allowed for multi value parameters, etc.

-- Robert

|||

Okay, I am sort of new to reporting services...where would I go to check the data type?..I don't believe anything is a null but where would I go to check that? The subreport works fine on its own...The master report will be/is populated by stored procedures so at first I thought something may be off with the stored procedures but all the other parameters work just fine when hooked up to the subreport's parameters. Currently, the subreport is running off of data from the cube however, it has been suggested that I change the subreport to pull from the same stored procedures as the master report and it will work fine...which I don't understand because again the first four parameters work fine with out using the stored procedures. Any further assistance would be greatly appreciated.

Thanks.

Parameter passing from master to subreport

Is it possible to pass a multi-value parameter from a master report to one or more subreports? If so, how?

Thanks for any help.

Wayne E. Pfeffer

Yes you can do this. I suggest the following: In your subreport make the report parameter a multi-value parameter. Test the subreport stand alone and make sure it works. Then drop the subreport into your main report, and map the subreport parameters to the main report parameters.

Scenario 1 (multi value parameter pass through):
The Main report has report parameter A which is a multi value parameter. You want to pass it to SubReport1 which has a report parameter B which is also defined as multi value parameter. In this case the mapping is just a simple parameter expression: =Parameters!A.Value
The subreport RDL element would look like this:
<Subreport Name="SubReport1">
...
<Parameters>
<Parameter Name="B">
<Value>=Parameters!A.Value</Value>
</Parameter>
</Parameters>
</Subreport>


Scenario 2:
The Main report has no report parameters. You have a SubReport1 with a report parameter B defined as multi value parameter. You want to pass e.g. three selected values "A", "B", "C" as parameter values to the subreport. You need to create a multidimensional object array on-the-fly, e.g. with the Split function, e.g.: =Split("A,B,C", ",")
RDL example:
<Subreport Name="SubReport1">
...
<Parameters>
<Parameter Name="B">
<Value>=Split("A,B,C", ",")</Value>
</Parameter>
</Parameters>
</Subreport>


Scenario 3:
The Main report has a multi-value parameter A. You want to pass only the first selected value from the main report's parameter to the subreport and the subreport's report parameter B is a single-value parameter. You can do this by using e.g. =Parameters!A.Value(0)
RDL example:
<Subreport Name="SubReport1">
...
<Parameters>
<Parameter Name="B">
<Value>=Parameters!A.Value(0)</Value>
</Parameter>
</Parameters>
</Subreport>


-- Robert

|||Thank you for the help, it worked out.

Wayne|||Is there a limit on how many parameters you can pass if you are using Scenario1. I have 5 parameters and 1 subreport. I can pass in the first 4 (A,B, C,D) and the report works fine but when I try to pass in the last one (E), which is no different than the previous 4 parameters other than it might have a few more values than the others, I get an error saying that one or more parameters need has not been specified.|||

There is no limit on the number of parameters.

Instead, it seems like the parameter values passed in violate constraints defined for the subreport parameters. For example, the subreport parameter's data type is integer and you pass string values. Or you pass a NULL value ('Nothing' in VB) as one of the parameter values - which is not allowed for multi value parameters, etc.

-- Robert

|||

Okay, I am sort of new to reporting services...where would I go to check the data type?..I don't believe anything is a null but where would I go to check that? The subreport works fine on its own...The master report will be/is populated by stored procedures so at first I thought something may be off with the stored procedures but all the other parameters work just fine when hooked up to the subreport's parameters. Currently, the subreport is running off of data from the cube however, it has been suggested that I change the subreport to pull from the same stored procedures as the master report and it will work fine...which I don't understand because again the first four parameters work fine with out using the stored procedures. Any further assistance would be greatly appreciated.

Thanks.

Friday, March 9, 2012

Paging (or beating a dead horse?)

My report used to work beautifully in regards to paging and then the
requirements changed. I added a subreport into the table's detail
section and made it a drilldown with the toggle based on a group
value. The paging went wonky as in there is only one page now even
with the paging set up on the group.
Any good resources out there on this?
TIA, ReneeUser "beener" <rmp_colo@.hotmail.com> wrote
news:1191519015.869502.324820@.19g2000hsx.googlegroups.com...
> My report used to work beautifully in regards to paging and then the
> requirements changed. I added a subreport into the table's detail
> section and made it a drilldown with the toggle based on a group
> value. The paging went wonky as in there is only one page now even
> with the paging set up on the group.
> Any good resources out there on this?
Try set Hidden=false on group details.
Best regards
Adam

Pagination Issue

I have a report which contains a list box, which in turn contains a
subreport. The list box is set up to group on one of the data set's columns.
There is only one row per group column value. I have not forced new pages
on the beginning and ending of the list box, nor have I specified to keep the
group together. The report was created and previewed using the report
designer, then was deployed. When rendered, the text box group and the sub
report works correctly. The issue is pagination.
When I first render the report, several groups are printed on a single
"Page". When I press the preview button again (in report designer) or export
the report to PDF (in report server), each group and subreport appears on one
page (which is what I want), but a new blank page now appears between groups.
How can I make this report paginate correctly to show 1 group per page and
no blank pages?
--
Jay P. Meredith
Senior Software Engineer
Columbia Helicopters, Inc.
PO Box 3500
Portland, OR 97208Jay,
Go into the layout tab of the report, then go up to the Report -> Report
Properties menu. Check your paper size & margins. Also, verify the width
and height of your list box. It could be that RS has re-sized your report to
fit data on it (or just to fit your list box without warning you - it's
really bad about that) and that is causing the extra pages to print. Also,
look at your padding values and border values for the list box and play with
them just to make sure they aren't causing the extra space to be generated
when the report is generated.
Catadmin
--
MCDBA, MCSA
Random Thoughts: If a person is Microsoft Certified, does that mean that
Microsoft pays the bills for the funny white jackets that tie in the back?
@.=)
"Jay Meredith" wrote:
> I have a report which contains a list box, which in turn contains a
> subreport. The list box is set up to group on one of the data set's columns.
> There is only one row per group column value. I have not forced new pages
> on the beginning and ending of the list box, nor have I specified to keep the
> group together. The report was created and previewed using the report
> designer, then was deployed. When rendered, the text box group and the sub
> report works correctly. The issue is pagination.
> When I first render the report, several groups are printed on a single
> "Page". When I press the preview button again (in report designer) or export
> the report to PDF (in report server), each group and subreport appears on one
> page (which is what I want), but a new blank page now appears between groups.
> How can I make this report paginate correctly to show 1 group per page and
> no blank pages?
> --
> Jay P. Meredith
> Senior Software Engineer
> Columbia Helicopters, Inc.
> PO Box 3500
> Portland, OR 97208|||Messing with the margins and object sizes did the trick. I also have a
better understanding about SRS's preview pane in the Report Designer. The
first time you preview a report, the preview is in HTML mode, which does not
support pagination, therefore pagination is not shown. If you click the
preview button a second time, it switches to paged mode, which reflects how
the report looks when exported to a format capable of pagination, such as PDF.
Thanks much for your help.
--
Jay P. Meredith
Senior Software Engineer
Columbia Helicopters, Inc.
PO Box 3500
Portland, OR 97208
"Catadmin" wrote:
> Jay,
> Go into the layout tab of the report, then go up to the Report -> Report
> Properties menu. Check your paper size & margins. Also, verify the width
> and height of your list box. It could be that RS has re-sized your report to
> fit data on it (or just to fit your list box without warning you - it's
> really bad about that) and that is causing the extra pages to print. Also,
> look at your padding values and border values for the list box and play with
> them just to make sure they aren't causing the extra space to be generated
> when the report is generated.
> Catadmin
> --
> MCDBA, MCSA
> Random Thoughts: If a person is Microsoft Certified, does that mean that
> Microsoft pays the bills for the funny white jackets that tie in the back?
> @.=)
>
> "Jay Meredith" wrote:
> > I have a report which contains a list box, which in turn contains a
> > subreport. The list box is set up to group on one of the data set's columns.
> > There is only one row per group column value. I have not forced new pages
> > on the beginning and ending of the list box, nor have I specified to keep the
> > group together. The report was created and previewed using the report
> > designer, then was deployed. When rendered, the text box group and the sub
> > report works correctly. The issue is pagination.
> > When I first render the report, several groups are printed on a single
> > "Page". When I press the preview button again (in report designer) or export
> > the report to PDF (in report server), each group and subreport appears on one
> > page (which is what I want), but a new blank page now appears between groups.
> > How can I make this report paginate correctly to show 1 group per page and
> > no blank pages?
> >
> > --
> > Jay P. Meredith
> > Senior Software Engineer
> > Columbia Helicopters, Inc.
> > PO Box 3500
> > Portland, OR 97208

Wednesday, March 7, 2012

Pagination

I have a report which consists of a list item, in which is a rectangle containing a header (as a subreport, but I think that's not relevant) and a subreport. The aforementioned rectangle is specified to include a pagebreak after each occurrence, but that pagebreak is not working as expected.

When I run the report I get 1 subreport on the first page, and exactly two on each subsequent page. Other than the pagination, I am getting very close to what I want. It's too bad that the subreport's pagination is ignored, but I can live with that for now.

Things I've already tried:

The report's pageSize and interactiveSize are both set to landscape

The subreport's report's pageSize and interactiveSize are both set to the actual size that the subreport takes up on the main report (which is ignored anyway)

The list does not have any of the page break options selected.

Any Ideas?

Are you using any visibility condition for subreport or rectangle?

I am asking this becasue page break is not supported with visibility condition.

|||

Thanks for your help.

I have not set any visibility settings away from the default of visible.

|||

Maybe it would help if I explained more of what I'm trying to do...

A single report is run from a single id, but there are several ways of selecting that ID, and some ways should result in batches of reports being generated. (for example, a rep may want to run one report to be mailed to each of their clients). Each report should have just one header at the beginning of it.

My report consists of one big list. In the list there are two subreports, one for the header that should be at the top of each report, and one for the body of the report itself. The list uses a query that returns the IDs that should be included in the batch as its dataset. The ID field is passed as one of the report parameters to the body subreport, with the rest of the parameters for the subreport passed straight through.

I put both of the subreports inside a rectangle (inside the list) to try to force the pagebreak.

<Edit: I removed the bit about table headers in the subreport, because that seems to be working>

|||

I hate to keep bumping my thread, but I need help figuring this out.

Maybe I am making my process too complicated? Is there another way to do what I'm trying to do that will allow the report server to correct the pagination?

Is there more info I could give that would help find a solution?

Saturday, February 25, 2012

PageBreak only before odd pages

Hi all,

I have a report with a few subreports and after each subreport I've added a page-break. But I want to skip a page and to leave it blank if the previous subreport ends at an odd page, so the next subreport will start at the next odd page instead of the even page.

I use a transparent rectangle to add page breaks after each subreport, but because I don't have access to the Global.PageNumber variable in the body section of the report, I don't know when the page is even, so a second rectangle with a custom expression for the Visibility property is unuseful.

Does anyone know how to fix this issue?

Thank you and I look forward to seeing some suggestions.

Radu.

Have you found any solution if yes please let me know

PageBreak only before odd pages

Hi all,

I have a report with a few subreports and after each subreport I've added a page-break. But I want to skip a page and to leave it blank if the previous subreport ends at an odd page, so the next subreport will start at the next odd page instead of the even page.

I use a transparent rectangle to add page breaks after each subreport, but because I don't have access to the Global.PageNumber variable in the body section of the report, I don't know when the page is even, so a second rectangle with a custom expression for the Visibility property is unuseful.

Does anyone know how to fix this issue?

Thank you and I look forward to seeing some suggestions.

Radu.

Have you found any solution if yes please let me know

Monday, February 20, 2012

Page Orientation Problem

How can I have my main report in Portrait and my subreport , who creates a new page, in Landscape. Is it possible ??
Thank you for your helpI don't thing so. How would you send a job to the printer that is both portraint and landscape?|||you got a point here..|||Well I thought so anyway! :lol:|||i give up.. :( I'll try to resize it to fit portrait