-2
/* protected void Page_Load(object sender, EventArgs e)
{
//--Sql string
string strId1;
strId1=Request["empid"].ToString();
string strId2;
strId2 = Request["empid1"].ToString();
String strCmd = "";
strCmd += "Select YKCODE,NAME,RNAME,TICODE,MADKBN,MKCODE,TANKBN,YOUKBN,KOUCODE ";
strCmd += "From GMYAKU ";
if(strId1!="" && strId2!="")
{
strCmd += "where YKCODE BETWEEN " + strId1 + " AND " + strId2;
}
//--Opening Sql Connection
string strConn = ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection sqlConn = new SqlConnection(strConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(strCmd, sqlConn);
//--this statement is very important, here the table name should
//--match with the XML Schema table name
da.Fill(ds, "GMYAKU");
//--Closing Sql Connection
sqlConn.Close();
//--(Optional) I have used it to disable the properties
//CrystalReportViewer1.DisplayGroupTree = false;
//CrystalReportViewer1.HasCrystalLogo = false;
//--Initializing CrystalReport
// ReportDocument myReportDocument;
//myReportDocument = new ReportDocument();
ReportViewer1.LocalReport("Report1.rdlc");
//--Binding report with CrystalReportViewer
ReportViewer1.ReportSource = ReportViewer1;
ReportViewer1.DataBind();
}*/
什麼你問這裏? – nitzmahone 2009-10-22 06:19:09
代碼可能不起作用,因爲它的註釋掉了? – 2009-10-22 06:28:08
您是使用Crystal Report還是MS Reporting Service?評論說水晶,但代碼說MS。 – dotjoe 2009-10-22 14:51:08