I Used RDLC in my Asp Page but main Report is comming but subreport not comming
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
Width="652px">
<LocalReport ReportPath="Student\MyGrade.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="MyGrade" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData"
TypeName="MyGradeTableAdapters.usp_mygrading_1TableAdapter" OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:SessionParameter Name="id" SessionField="Stud_id" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
this.ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(prcProcessSubReport);
}
}
catch
{ }
}
private void prcProcessSubReport(object sender, SubreportProcessingEventArgs e)
{
e.DataSources.Clear();
DataTable dtSubReport = new DataTable();
ReportDataSource Subreport1;
try
{
SqlConnection thisConnection = new SqlConnection(connection);
DataSet ds = new DataSet();
SqlDataAdapter adapter = new SqlDataAdapter();
thisConnection.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "usp_mygrading_2";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@id", e.Parameters["id"].Values[0].ToString()));
cmd.Parameters.Add(new SqlParameter("@exam", e.Parameters["examid"].Values[0].ToString()));
cmd.Connection = thisConnection;
adapter = new SqlDataAdapter(cmd);
adapter.Fill(ds);
Subreport1 = new ReportDataSource("MyGrade2", dtSubReport);
e.DataSources.Add(Subreport1);
}
catch (Exception ex)
{
}
finally
{
dtSubReport = null;
Subreport1 = null;
}
}
I passing Parameter also and i am getting data in coding but when viewing it showing no data
Please Help me..