function ShowCreprt()
{
string str_sql=null;
DataSet DsMain = new DataSet();
CrystalDecisions.CrystalReports.Engine.ReportDocument rp;
string reportPath = Server.MapPath("LogReport.rpt"); //Set path of Crystal Report
rp = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); // Object of Report Document
sql = "Select l_name as username,'' as sno, userdetail.user_ip as uip from userdetail Where userdetail.user_id=" + int_loginID + " order by servertime";
//in DsMain i fill records as per above query
rp.FileName = reportPath;
rp.SetDataSource(dsmain.Tables[0]);
crviewer.ReportSource = rp;
//I have crviewer control on my page
}
No comments:
Post a Comment