What should we select whicle configuring datasource in define parameters from options(None, Cookie,Control, QueryString, Form,Session, Profile, RouteData) while passing parameter from report to its subreport contained in it.
Pls Advise
I am selecting None and it gives me error
Data retrieval failed for the subreport, 'rptchildData', located at: C:\SSRS\VS2010Repor\SubReport.rdlc. Please check the log files for more information.
Their is no info in log files
Below is the code used
code behind
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
this.ReportViewer1.LocalReport.SubreportProcessing +=
new SubreportProcessingEventHandler(SubreportProcessingEventHandler);
ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource
("dsSource", SqlDataSource1));
}
}
void SubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e)
{
e.DataSources.Add(new ReportDataSource("dsVBSubReport", this.SqlDataSource2));
}
aspx
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
Font-Size="8pt" InteractiveDeviceInfos="(Collection)"
WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Height="800px"
Width="1000px">
<LocalReport ReportPath="MainReport.rdlc" EnableExternalImages="True">
<DataSources>
<rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="dsMain" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="---select statement---">
<SelectParameters>
<asp:Parameter Name="Id" />
</SelectParameters>
</asp:SqlDataSource>
Here Id is parameter passed from main report to subreport
In design view of Main Report i have already passed parameter from main report to sub report.
Please Help