Saturday, April 11, 2009

show reports (using stored procedure)

//import CrystalDecisions.Shared;
//...............we take a crystalreport viewer and a crystalreport source in the webform and inthe property of crstalreportsource there is report option we click thet and then in filename we have to write the crystalreport name such as "crystalreport1" etc//
///.............
protected void Page_Load(object sender, EventArgs e)
{
ConnectionInfo cn = new ConnectionInfo();

cn.ServerName = "Net1/SQLEXPRESS";
cn.UserID = "sa";
cn.Password = "ats";
cn.DatabaseName = "employee";
CrystalReportViewer1.ReportSource = CrystalReportSource1;
string s1 = Request.QueryString["allias"].ToString();
foreach (TableLogOnInfo Tinfo in CrystalReportViewer1.LogOnInfo)
{
Tinfo.ConnectionInfo = cn;
}

ParameterField param = CrystalReportViewer1.ParameterFieldInfo[0];
ParameterDiscreteValue value = new ParameterDiscreteValue();
value.Value = s1;
param.CurrentValues.Add(value);
}
///................

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home