Exemplo n.º 1
0
 public void PrintSendDetail()
 {
     try
     {
         CpNpStat stat = new CpNpStat();
         Sql2KDataAccess access = new Sql2KDataAccess();
         DataSet ds = new DataSet();
         access.Run_SqlText(ref ds, "select Description ,TotalNum  from V_NpType t inner join (select Code,Count(NpId) as TotalNum from V_Np Where InPutTime between '" + this.m_FromDate.ToShortDateString() + "' and '" + this.ToDate.AddDays(1.0).ToShortDateString() + "'" + this.m_State + " Group By Code) t1 on t.Code=t1.Code", "V_NpStat");
         ParameterFields fields = new ParameterFields();
         ParameterField field = new ParameterField();
         ParameterDiscreteValue value2 = new ParameterDiscreteValue();
         field.ParameterFieldName="FromDate";
         value2.Value=this.m_FromDate.ToShortDateString();
         field.CurrentValues.Add(value2);
         fields.Add(field);
         field = new ParameterField();
         field.ParameterFieldName="ToDate";
         value2 = new ParameterDiscreteValue();
         value2.Value=this.m_ToDate.ToShortDateString();
         field.CurrentValues.Add(value2);
         fields.Add(field);
         field = new ParameterField();
         field.ParameterFieldName="State";
         value2 = new ParameterDiscreteValue();
         value2.Value=this.StateDesc;
         field.CurrentValues.Add(value2);
         fields.Add(field);
         this.crv_Send.ParameterFieldInfo=fields;
         ds.Tables[0].TableName = "V_NpState";
         stat.SetDataSource(ds);
         this.crv_Send.ReportSource=stat;
         this.crv_Send.PrintReport();
     }
     catch (Exception exception)
     {
         MessageBox.Show("打印时发生错误" + '\n' + exception.Message, "打印生产量统计", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Exemplo n.º 2
0
 private void Frm_NpStat_Load(object sender, EventArgs e)
 {
     CpNpStat stat = new CpNpStat();
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet ds = new DataSet();
     access.Run_SqlText(ref ds, "select Description ,TotalNum  from V_NpType t inner join (select Code,Count(NpId) as TotalNum from V_Np Where InPutTime between '" + this.m_FromDate.ToShortDateString() + "' and '" + this.ToDate.AddDays(1.0).ToShortDateString() + "'" + this.m_State + " Group By Code) t1 on t.Code=t1.Code", "V_NpStat");
     ParameterFields fields = new ParameterFields();
     ParameterField field = new ParameterField();
     ParameterDiscreteValue value2 = new ParameterDiscreteValue();
     field.ParameterFieldName="FromDate";
     value2.Value=this.m_FromDate.ToShortDateString();
     field.CurrentValues.Add(value2);
     fields.Add(field);
     field = new ParameterField();
     field.ParameterFieldName="ToDate";
     value2 = new ParameterDiscreteValue();
     value2.Value=this.m_ToDate.ToShortDateString();
     field.CurrentValues.Add(value2);
     fields.Add(field);
     field = new ParameterField();
     field.ParameterFieldName="State";
     value2 = new ParameterDiscreteValue();
     value2.Value=this.StateDesc;
     field.CurrentValues.Add(value2);
     fields.Add(field);
     this.crv_Send.ParameterFieldInfo=fields;
     stat.SetDataSource(ds);
     this.crv_Send.ReportSource=stat;
 }