locked
Parameter prompt on button click RRS feed

  • Question

  • User1867929564 posted

    Hi,

    When report method is called in page_init then its working fine.
    when i call the same method on button click then its always prompt for parameter.

    What must be the problem ? 

    Tuesday, May 29, 2012 8:36 AM

All replies

  • User-661350001 posted

    may i request you to please share the code to know what's the actual problem ?

    Tuesday, May 29, 2012 11:35 AM
  • User1867929564 posted

    i hv written this in method.i am calling the same method in button click as well as page_init.
    whenever i change id(parameter and page load.it work fine and report change according to parameter.
    but when on button click,it prompt for parameter.
    chk the code.is the order of code correct ?what must be the problem.
    my parametertype is int.

    ReportDocument rpt= new ReportDocument();
    Crystalviewer1.ReportSource = report;
    ParameterField paramField = new ParameterField();
          ParameterFields paramFields = new ParameterFields();
          ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
          ConnectionInfo crConnectionInfo = new ConnectionInfo();
          TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
          Tables CrTables;
    
         rpt.Load(Server.Mappath("");
    
    crConnectionInfo.ServerName = @"something";
          crConnectionInfo.DatabaseName = "something1";
          crConnectionInfo.UserID = "something11";
          crConnectionInfo.Password = "something1111";
          crConnectionInfo.IntegratedSecurity = false;
          CrTables = rpt.Database.Tables;
          foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
          {
            crtableLogoninfo = CrTable.LogOnInfo;
            crtableLogoninfo.ConnectionInfo = crConnectionInfo;
            CrTable.ApplyLogOnInfo(crtableLogoninfo);
          }
    
    
         paramField.CurrentValues.Clear();
          //report.SetParameterValue("@ID", id);
          paramField.Name = "ID";
          paramDiscreteValue.Value = id;
          
          paramField.CurrentValues.Add(paramDiscreteValue);
          paramField.HasCurrentValue = true;
          paramFields.Add(paramField);
          Crystalviewer1= paramFields;
    
    rpt.Refresh();



     

    Wednesday, May 30, 2012 1:31 AM
  • User1867929564 posted

    how to call javascript function on crystal report print click ?

    Any idea ? 

    Thursday, May 31, 2012 1:53 AM
  • User1867929564 posted

    i hv remove aspnet_client folder my root directory and rename aspnet_client from inetpub.
    but image and css still working for crystal viewer.

    what must be wrong ? 

    Saturday, June 2, 2012 4:09 AM
  • User-37275327 posted

    Wrap your code in

    if (!IsPostBack)

    {

    //your code here

    }

    Parameters may be cleared away when the button click.

    Sunday, June 3, 2012 7:52 AM