PDA

View Full Version : [CLOSED] Unable to load ssrs report on button click in 2.2



legaldiscovery
Aug 06, 2013, 11:36 AM
-- Having requirement of loading local report with dynamic .rdlc file on button click event but it is not loading the report except the report toolbar (as in attached image)

-- does anyone know the reason behind not showing report in button click

we have checked in version 1.0 but it will not work so we have cheked in version 2.2 and in version 2.2 it also not work

here is code
Page -> .aspx (in ext.net)



<body>
<form id="form1" runat="server">
<div>

<ext:ResourceManager ID="rm1" runat="server">
</ext:ResourceManager>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ext:Viewport runat="server" Layout="BorderLayout">
<Items>
<ext:Panel ID="pnl" runat="server" Region="Center">
<Items>
<ext:Button ID="btn" runat="server" Text="Show Report">
<DirectEvents>
<Click OnEvent="btn_Click">
</Click>
</DirectEvents>
</ext:Button>
</Items>
<Content>
<rsweb:ReportViewer ID="ReportViewer1" Width="100%" runat="server">
</rsweb:ReportViewer>
</Content>
</ext:Panel>
</Items>
</ext:Viewport>
</div>
</form>
</body>



page behind code -> .aspx.cs



protected void btn_Click(object sender, DirectEventArgs e)
{
try
{
ReportDataSource dsReport = new ReportDataSource();
dsReport.Name = "Report1";
dsReport.Value = GetData().Tables["1"];
ReportViewer1.Reset();


ReportViewer1.LocalReport.DataSources.Add(dsReport );
ReportViewer1.LocalReport.DisplayName = "Report1";
ReportViewer1.LocalReport.LoadReportDefinition(Get ReportDef(GetData().Tables["1"], dsReport.Name));
ReportViewer1.Update();
}
catch (Exception ex)
{
throw ex;
}
}


attached screenshot with this post
(report-in-ext.net.JPG)

working the same in asp.net

.aspx (in asp.net)


<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:Button ID="btn1" runat="server" OnClick="btn_Click" Text="Show Report"/>

<rsweb:ReportViewer ID="ReportViewer1" Width="100%" runat="server">
</rsweb:ReportViewer>
</div>
</form>
</body>


.aspx.cs


protected void btn_Click(object sender, EventArgs e)
{
try
{
ReportDataSource dsReport = new ReportDataSource();
dsReport.Name = "Report1";
dsReport.Value = GetData().Tables["1"];
ReportViewer1.Reset();


ReportViewer1.LocalReport.DataSources.Add(dsReport );
ReportViewer1.LocalReport.DisplayName = "Report1";
ReportViewer1.LocalReport.LoadReportDefinition(Get ReportDef(GetData().Tables["1"], dsReport.Name));
ReportViewer1.Update();
}
catch (Exception ex)
{
throw ex;
}
}

Daniil
Aug 06, 2013, 2:41 PM
Hi @legaldiscovery,

The thread is related to this one:
http://forums.ext.net/showthread.php?25456

Please clarify did you try the suggestion for the post #4 (http://forums.ext.net/showthread.php?25456&p=112307&viewfull=1#post112307)?

legaldiscovery
Aug 07, 2013, 9:18 AM
Yes i have tried this solution in both version and its not working

Daniil
Aug 07, 2013, 1:30 PM
OK.

Currently, I have no experience with ReportViewer.

Please guide me how to run your test case.