Ejemplo n.º 1
0
        private void FrmPrint_Load(object sender, EventArgs e)
        {
            var sql = "SELECT a.*,c.Dept FROM udstr a LEFT JOIN dbo.udone b ON b.sgdhao=a.sgdhao " +
                      "LEFT JOIN DZDJ.dbo.TB_Dept c ON c.ID=b.DeptId " +
                      $"WHERE zling='{SqlHelper.ProcCardNo}' AND DeptId='{SqlHelper.DeptId}' ORDER BY a.gxone,a.gxtwo";

            SqlHelper.FillDataset(SqlHelper.GetConnection(), CommandType.Text, sql, _ds, new [] { "sql" });
            //var cr = new cncCryst();
            cncCryst1.Load(Application.StartupPath + "cncCryst.rpt");
            cncCryst1.SetDataSource(_ds.Tables[0]);
            //cr.SetParameterValue("procCardNo", SqlHelper.ProcCardNo);
            //cr.SetParameterValue("DeptId", SqlHelper.DeptId);

            //cr.ReportDocument.ParameterFields["Parm"].CurrentValues.AddValue(
            crystalReportViewer1.ReportSource = cncCryst1;
        }