Hi all,
I have problem with CrystalReport and I have no idea how fight this problem.
I wrote aspx as below:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
//for CR
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public partial class Application_rapReport : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ParameterDiscreteValue discrete01 = new ParameterDiscreteValue();
ParameterField Pole01 = new ParameterField();
ParameterFields Pola = new ParameterFields();
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("~//Reports//Report01.rpt"));
Pole01.ParameterFieldName = "IDKontrah";
discrete01.Value = int.Parse(TextBox1.Text);
Pole01.CurrentValues.Add(discrete01);
Pola.Add(Pole01);
report.SetDatabaseLogon("user", "passwd", "localhost", "database");
CrystalReportViewer1.ParameterFieldInfo = Pola;
CrystalReportViewer1.ReportSource = report;
CrystalReportViewer1.RefreshReport();
}
}
Abstract:When I pass parameter to CR (from TextBox) first time after loading page- all is OK. It works. Later, when I try pass other parameter from TextBox once again (without reloading page) CR prompt me on parameter.
What do I wrong??
I set already property ReuseParameterValuesOnRefreshis set to "true", because CR prompted me about parameter every time.
I read that may put a fragment code to Page_Init, but i have no idea how split code above.
Advice me what I can to do, please. If you can give me an example I would be grateful.
Edited by Wojciech - 13 Feb 2010 at 9:00pm