Last post Aug 26, 2012 12:13 AM by jbdiacompleto
Dec 19, 2008 12:56 AM|Javier Fuentes|LINK
I need help with a subreport parameters.
I an using ASPX.NET with VB code, I have a reporviewer and I am passing a parameter to my dataset which is using stored procedure. in this case I am passing OrgId, which is ok.
Withing this report I have a Subreport, I need to pass from the main report two values string for the parameter in the dataset. In this case it is : CampId and Measure
Any Idea? Please help me, the examples I found are not usefull.
Dec 19, 2008 07:07 AM|rkchaudary|LINK
in the rdl file (i.e while creating the report ) mark the input parameter for the main report as the source for the dependent parameter in the sub report.
Dec 20, 2008 12:02 AM|Javier Fuentes|LINK
I am using rdlc files and I do not see how to mark the parameter in the report to send it to the subreport.
Can this work in the same way as rdl files? If so how?
Dec 20, 2008 07:54 AM|anamika_k|LINK
Pass all the 3 parameters from your aspx file to your report as parameters. In the main report you can reassign these values as input parameters for your subreport.
The foll article on subreports might be of help
Dec 23, 2008 03:42 AM|Javier Fuentes|LINK
I can not see how this work, the examples are not clear at all.
Can you give me an example. How do I define the ObjectDataSource for the subreport from the main report or I do not need to specify one?
I am getting the next message:
Error: Subreport could not be shown.
In my Page_Load event I have:
Dec 24, 2008 02:04 AM|Javier Fuentes|LINK
Please help me:
I got some example for Passing parameter from the main report, from this forum and now I am getting the next error:
Error: Subreport could not be shown.
Mycode is as follow:
txtCamapaignID.Text = Context.Items(
ReportViewer1.LocalReport.ReportPath = "ReportMeasures.rdlc"
ReportViewer1.Visible = True
Is this enough? or I need to specify some like:
comm.Connection = conn
comm.CommandType = Data.CommandType.StoredProcedure
resultSet = comm.ExecuteReader()
Anyway in boths cases I got the same error:
What is wrong with my code, I defined ObjectDataSource1 for the main report and ObjectDataSource2 for the subreport in my aspx form where I have the reportviewer.
Thank in advance.
Dec 24, 2008 08:30 PM|Javier Fuentes|LINK
I have this working now, it is OK, but I want the subreport to repeat and show more data? how can I do it?
What I want to do now is to make my report to show agin in a loop, to repeat.
How do I make a Loop and make the subreport to repeat?
Dec 25, 2008 01:39 AM|Nai-Dong Jin - MSFT|LINK
From your description, it seems that you want to repeat the report, right? If so, I think you have to create another report in your RDLC file, and show two reports
in a single reportviewer control, for more information on how to achieve that,
you may try the following articles.
Binding the ReportViewer Control to Multiple Generic Collections:
Multiple Reports with a single Report Viewer Control
Dec 26, 2008 11:44 AM|Javier Fuentes|LINK
In my program I have multiple collections, and they work fine, but I want to repeat the subreport as many times I need to repeat it like in a Loop.
Dec 30, 2008 02:33 AM|Javier Fuentes|LINK
I add a List1 to my Report to repeat the subreport like in a loop,
and it is working but the subreport have a problem now, it does not change, it repeat the same subreport.
Let me tell you what I did:
In the Report I defined 3 parameter.
Also in the LIst1 I am grouping list1_Details_Group with the fields
I am passing this values in the 3 parameters, but really only the Measure_Name is the one that change the other 2 remain the same, therefore this is the real parameter I need.
The subreport is suppose to change depending of the 3 values, but it just take the first 3 values and show the same subreport for all the diferent times it is produced, it is like the Measure_Name is not changing in the subreport.
This is what I have in the Page_Load
In the SubreportProcessing I have :
connStr = ConfigurationManager.ConnectionStrings(
OrgId = e.Parameters(0).Values(0).ToString
CampId = e.Parameters(1).Values(0).ToString
comm1.Connection = conn1
comm1.CommandType = Data.CommandType.StoredProcedure
ObjectDataSource5 = comm1.ExecuteReader()
More code Here for other collections
' This is the last ObjectDataSource
comm3.Connection = conn3
comm3.CommandType = Data.CommandType.StoredProcedure
ObjectDataSource3 = comm3.ExecuteReader()
What is Wrong? What do I need to do to make the data to refresh in the subreport?
Dec 31, 2008 05:53 PM|Javier Fuentes|LINK
Did you have a chance to see what I did? Do you hava any Idea? please help me.
Dec 31, 2008 05:54 PM|Javier Fuentes|LINK
Jan 06, 2009 04:31 PM|Javier Fuentes|LINK
I solve my problem but I not going to mark it resolved because that is not the right way to do it, but I have my report working.
If you have any clue, please let me know.
This is what I did:
I create a public Array and variables before the Load Event
I modify the Page_Load to load the measure I need before calling the report
cmd.Connection = con
cmd.CommandType = Data.CommandType.Text
strSql = strSql +
strSql = strSql + " Where Data_Collection_Scheduller.Organization_Id ='" + txtClientID.Text +
J = 0
cmd.CommandText = strSql
I = I + 1
' The next instruction is not getting the Last Measure I need from the report parameter.
Measr = e.Parameters(2).Values(0).ToString
' This is Why I have the next lines
If J = I
J = 0 ' This is to avoid an index that does not exist
' Then I get it from the public array.
Measr = MyMeasure(J)
J = J + 1
' After this I have the rest of my code por the subreport processing
txtMeasure.Text = Measr
Aug 26, 2012 12:13 AM|jbdiacompleto|LINK
That solved my problem here ... thank you!