none
Refresh report asynchronously during click

    Question

  • Hi,

    I am new to SSRS 2008 reporting. I have created a report that will have two table like Product list with count available. and on clicking the count there is another table which will show the date and the number of items added to the inventory filtered by the product. 

    Here when i click on the master table count, the sub table is refreshing but the thing is the entire report itself is refreshing.

    I have 2 datasets for this, one for the main table and another for this sub table.

    Instead i need to do it like AJAX which will update only the remaining part of the report.

    If you need further clarification on my issue please let me know.

    Please provide me some ideas and suggestions to get it work.


    Sathish




    • Edited by N.Sathish Thursday, May 16, 2013 7:57 PM
    Thursday, May 16, 2013 4:57 PM

Answers

All replies

  • Hi Sathish,

    In Reporting Services, we use action property to achieve you requirement. And it seems that you have done it already. If you haven't do it, please see:
    http://www.codeproject.com/Articles/270924/Master-Details-Report-in-SSRS-2008
    When we click the count then it drill-through to the same report, then the report will refresh. We cannot refresh sub part of the report.

    Besides, in SQL Server 2012, you can use the new feature of it Power View to achieve this.  Here has a blog about how to do it, please see:
    http://denglishbi.wordpress.com/tag/power-view/

    If you have any questions, please feel free to ask. 

    Regards,


    Charlie Liao
    TechNet Community Support

    • Marked as answer by N.Sathish Tuesday, May 21, 2013 4:27 PM
    Friday, May 17, 2013 8:10 AM
    Moderator
  • Hi,

    i got the clarity now. 

    Can i get some sample for updatepanel and reportviewer as given below.

    I want a sample that, i will have 2 buttons and if i click button1 it should refresh the report viewer and if i click the button2 it should refresh the test in the label alone and the report in reportviewer should not refresh.

    my asp.net page design is as follows

    <form id="form1" runat="server">
        <div>
        <asp:ScriptManager runat="server" ID="ScrptMgr" >
        </asp:ScriptManager>
        <asp:UpdatePanel runat="server" ID="UpdtPnl">
        <triggers>
                <asp:AsyncPostBackTrigger ControlID="btn2" EventName="Click" />
            </triggers>
        <ContentTemplate>
        <asp:Button runat="server" Text="DateTime" id="btn2" onclick="btn2_Click"></asp:Button>
        <asp:Label runat="server" Text="Label" ID="LblText"></asp:Label>
        </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" ID="UpdtPnl2">
        <triggers>
                <asp:AsyncPostBackTrigger ControlID="btn1" EventName="Click" />
            </triggers>
        <ContentTemplate>
        <asp:Button runat="server" Text="Report" id="btn1" onclick="btn1_Click"></asp:Button>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" 
                InteractivityPostBackMode="AlwaysAsynchronous" AsyncRendering="true" 
                Width="600px" onload="ReportViewer1_Load"
                onreportrefresh="ReportViewer1_ReportRefresh">
        </rsweb:ReportViewer>

        </ContentTemplate>

        </asp:UpdatePanel>

        </div>
        </form>

    My c# code 

     protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    Uri serverurl = new Uri(ConfigurationManager.AppSettings["ReportServerUrl"]);
                    string reportsfolder = ConfigurationManager.AppSettings["SampleReportsPath"];                                           // folder or site path
                    string fileextension = (ConfigurationManager.AppSettings["ReportServerMode"] == "SharePoint" ? ".rdl" : String.Empty);  // extension, depending on the report server mode
                    // (for information on the report path format, 
                    // see http://msdn.microsoft.com/en-us/library/ms252075.aspx)

                    ReportViewer1.ServerReport.ReportServerUrl = serverurl;
                    ReportViewer1.ServerReport.ReportPath = String.Format("{0}/Company Sales SQL2008R2{1}", reportsfolder, fileextension);

                    LblText.Text = DateTime.Now.ToString();
                }
            }

            protected void btn1_Click(object sender, EventArgs e)
            {
                Uri serverurl = new Uri(ConfigurationManager.AppSettings["ReportServerUrl"]);
                string reportsfolder = ConfigurationManager.AppSettings["SampleReportsPath"];                                           // folder or site path
                string fileextension = (ConfigurationManager.AppSettings["ReportServerMode"] == "SharePoint" ? ".rdl" : String.Empty);  // extension, depending on the report server mode
                // (for information on the report path format, 
                // see http://msdn.microsoft.com/en-us/library/ms252075.aspx)


                ReportViewer1.ServerReport.ReportServerUrl = serverurl;
                ReportViewer1.ServerReport.ReportPath = String.Format("{0}/Product Catalog SQL2008R2{1}", reportsfolder, fileextension);
            }
            protected void btn2_Click(object sender, EventArgs e)
            {
                System.Threading.Thread.Sleep(3000);
                LblText.Text = DateTime.Now.ToString();
            }

    when i am clicking the report button its refreshing the report alone. but when i click the datetime button its refreshing the date time and the report also.

    Please help me slove the issue.


    Sathish

    Tuesday, May 21, 2013 4:27 PM