.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Persisting ReportViewer through Postback

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :Sql Server
I'm curious if there is a way to allow the ASP.Net ReportViewer control to persist the currently displayed report through postbacks.  I'm looking at restructuring the page to only use partial postbacks, but it's proving to be a pain.  If there was an easy way to ensure that the displayed reports don't reset whenever another control causes a postback, that would be ideal.

View Complete Post

More Related Resource Links

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

jQuery live() and ASP.NET Ajax asynchronous postback

The issue is that normally $(document).ready() is called when the DOM is ready to be manipulated. But this doens't happen after an ASP.NET Ajax asynch postback occurs.

This means that the initial jQuery bindings won't be automatically available after the asynchronous postback is over. I underline "automatically" here because my last post describes more possibilities, how this issue can be worked around.

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

Session problem with display of image in row of reportviewer


Hello techies...

I am new to this sql reporting service. But anyhow by surfing I am able to bind the report but i was stuck in image display.

Anyways, i also managed that. But the real problem is whenever i was keeping a image control in rdlc report i was having session prob. If i remove the image control then as usual report works fine.

Please suggest me some solution.... either for session problem or for image display. I am keeping the image name in database but for binding the rdlc report i am using a store procedure which return the path (static) concating with the image name(kept in database).

Hope to find a solution .....

(Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Re


 I am trying to use ReportViewer 9 in Visual Studio 8 but I get this error when I try to run the page:

The base class includes the field 'ReportViewer1', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).

Please help if you can!


Automatic Batch Printing in ReportViewer Remote Mode


Please help me, i have a properly working codes that is capable of the following:

1. Printing of Reports from ReportViewer without using the build-in print ICON in the actual ReportViewer. to view the working for the printing alone please click here.

2. Batch Printing by making a loop and placing a checkbox on the gridview where the needed paramerter (DataKeyNames ID) is retrieved then pass to the ReportViewer

This is my Code

foreach (GridViewRow row in GridView1.Rows)
            CheckBox chk = (CheckBox)row.FindControl("CheckBox2");
            if (chk.Checked)
                ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://TestServer/ReportServer");
                ReportViewer1.ServerReport.ReportPath = @"/Tavern/StudPaymentReport";
                ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                ReportParameter[] rptParams = new ReportParameter[1];

                rptParams[0] = new ReportParameter("ClientID", GridView1.DataKeys[row.RowIndex].Value.ToString());


ReportViewer :: Failed to enable constraints. But my statement is valid!!

  • A
  • n error has occurred during report processing.
      • Exception has been thrown by the target of an invocation.
        • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    Why do I keep getting this error, even when not using any data on the report. When I run the query in SQL server I get a resultset. However when I try to render the report I get this error.


    Dynamic Report in reportviewer


    HI I m sorry to say this But this task too urgent.

     Ex- i have two tables in my db name called Comdetails, deptdetails.

    TCS is a one company name stored in ComDetails and Company_ID took as primany key,

    TCS having 10 department stored in deptdetails and Company_ID as foreign key.

    so now in DB we have available one company with 10 departments.

    so now i need to generate report , i m using report.rdlc and reportviewer.

    i hope upto now its clear.

    my task-

    1- i have two pages in a report in page 1 i m doing designing report like top i  need to show companydetails, middle frist department details in deptdetails table , and bottom some calculation part leave about calculation part. in report page 2 on  top i need to show second department details from deptdetails next below the design again same design i did here i need to show 3 department details from deptdetails next below the design again same design i did here i need to show 4 department details from deptdetails next below again calculation part design leave about calculation part. so up to now i shown 4 department details here still i need to show 6 department details , for this programatically after 4 department details finish next generate dynamatically page 2 of re

    page postback problem with crystal report


    Hi , i am creating crystal report with asp.net it is working showing data but  data is of two page its is take round trip action but report is not show 
    until again i click on show button in this it is not propersly showing that data is how.

    <br />
        <asp:Button ID="btnShow" runat="server" OnClick="btnShow_Click" Text="Show Report" />
    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" DisplayGroupTree="False" EnableDatabaseLogonPrompt="False" /> CrystalReportViewer1.ReportSource = null; SqlCommand cmd = new SqlCommand(strcmd, c.con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); ReportDocument doc = new ReportDocument(); doc.Load(AppDomain.CurrentDomain.BaseDirectory + "\\rptQuotation.rpt"); doc.SetDataSource(ds.Tables[0]); // login info SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString); TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new Tabl

    Toolbox: Protecting Code, Persisting Data, and More


    This month obfuscating your code, persisting your data, and a good read on SQL Server 2005.

    Scott Mitchell

    MSDN Magazine October 2006

    C++ at Work: Persisting View State Update, Using Managed Extensions in a DLL


    This month marks the 11th anniversary of my column and the inauguration of a new title: C++ At Work. We're also adding a new bimonthly column, "Pure C++," by my pal Stan Lippman, one of the great C++ Masters.

    Paul DiLascia

    MSDN Magazine February 2005

    Remeber page postion on postback



    I dont know if this is possible or not...

    I want the page when refreshed to remember the position that the user was at on the page, for instance if they are scrolled half way down the page when the page posts back can it return to that position on the page?



    Dynamically load user control without postback


    Hi all,

    I need urgent help. (c#coding)

    In my base page, I have a dropdownlist control which loads different usercontrols on selectedindexchanged event.

    While loading these usercontrols, my page postbacks all the page. I used updatepanel but again same problem.

    Is there any way to load controls without postback? I Really need help as soon as possible.

    Here is my code:

    protected void Page_Init(object sender, EventArgs e)
            if (Session["control"] != null)
                string c = Session["control"].ToString();
                if (c == "1")
                    iuc = (IlkogretimUC)LoadControl("~/Controls/Ilkogretim.ascx");
                    dl.SelectedValue = Session["control"].ToString();
                else if (c == "2")
                    luc = (LiseUC)LoadControl("~/Controls/LiseUC.ascx");
                    dl.SelectedValue = Session["control"].ToString();
                else if (c == "3")
                    youc = (YuksekokulUC)LoadControl("~/Controls/Yuksekokul.ascx");

    no response when refreshing reportviewer


    Hi guys, I've been struggling with this for some time now, but I can't figure out why it's not working. I got a gridview in which I'm selecting a specific row. This gives me a string back, which is used to load some data inside a datatable, using DAL The callback works and it's also giving the correct string to retrieve the wanted data. But when I'm trying to use this fresh data update my reportviewer (.rdlc) nothing happens. For now I'm testing the event with a simple button, but even with the button nothing happens. Does anyone know what I'm missing The DAL is working correct and I'm using .NET 3.5

    <rsweb:ReportViewer ID="ReportViewer" runat="server" Font-Names="Verdana" 
                                     InteractiveDeviceInfos="(Collection)"  WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" >
            <LocalReport ReportPath="Office\Reporting\InvoiceReport.rdlc" />                                
        protected void Button1_Click(object sender, EventArgs e)
            string strInvoiceId = "603663";
            tblInvoiceTableAdapter InvoiceAdapt = new tblInvoiceTableAdapter();
            TGU.tblInvoiceDataTable invoiceDt = InvoiceAdapt.GetIn

    Checkbox will show panel based on selection without postback.. how to do



    I have Two Checkbox in my asp.net textbox..

    First what i want is

    based on two checkbox user has to be select any one only..

    if checkbox1 is selected then Panel1 visible true without postback

    if checkbox2 is selected then Panel2 visible true without postback


    • A data source instance has not been supplied for the data source 'EventDetail'.

    • I am stuck with this error.

    I searched for this but no respite.

    I am using the reportviewer in a drilled down report. The parent report shows up fine. But when I try to drill down i get the data source missing error.

    ObjectDataSource obDSS = new ObjectDataSource("Business.EventDetails", "GetEventDetailsReport");
                obDSS.SelectParameters.Add("workOrderID", workorderid);       

                rpViewer.LocalReport.ReportPath = "reports/WorkOrderDetails.rdlc";

    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend