Exemplo n.º 1
0
 /// <summary>
 /// 显示对应单据报表
 /// </summary>
 /// <param name="rowHeaderName">行头名</param>
 /// <param name="columnName">列头名</param>
 public void SqlToReport(string rowHeaderName, string columnName)
 {
     string TypeName = "";
     string sql = "SELECT ReceiptId  单据号,InvoiceNo 发票编号, ReceiptTypeID  单据类别," +
                 "CustomerReceiptNo 自定义编号,CurWorkMonth 工作年月,OccurTime 单据日期," +
                 "CustName 客户名称,MatId 商品编号 ,MatName 商品名称,SourceStoreH 仓库," +
                 "MatType 类型,num 数量,price 含税单价,Amount 含税金额,TTaxPurchPrice 成本金额," +
                 "ML 毛利, lotCode 批号,VerifyPerson 验收员,BillUser 操作员,Memo 备注 " +
                 "FROM T_JXDetail where SourceStoreH='" + columnName + "' and ";
     string strsql = "";
     switch (rowHeaderName)
     {
         case "01": TypeName = "JHDetail";
             strsql = sql + " ReceiptTypeID='01'"; break;
         case "03": TypeName = "JHDetail";
             strsql = sql + " ReceiptTypeID='03'"; break;
         case "20": TypeName = "JHDetail";
             strsql = sql + " ReceiptTypeID='20'"; break;
         case "51": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='51'"; break;
         case "52": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='52'"; break;
         case "53": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='53'"; break;
         case "54": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='54'"; break;
         case "55": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='55'"; break;
         case "56": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='56'"; break;
         case "75": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='75'"; break;
         case "88": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='88'"; break;
         case "90": TypeName = "XSDetail";
             strsql = sql + " ReceiptTypeID='90'"; break;
         default: break;
     }
     SqlDBConnect db = new SqlDBConnect();
     DataTable dt = new DataTable();
     strsql += " and (OccurTime between '" + dateTimeFrom + "' and '" + dateTimeTo + "')";
     dt = db.Get_Dt(strsql);
     string count = dt.Rows.Count.ToString();
     //通过sql条件显示报表窗体
     PublicDetailForm form = new PublicDetailForm();
     form.MdiParent = this.MdiParent as MainForm;
     form.Show();
     form.strSql = strsql;
     form.count = count;
     form.ReiceName = TypeName;
     form.Username = (this.MdiParent as MainForm).userName;
     form.ShowReport();
 }
Exemplo n.º 2
0
 /// <summary>
 ///报表通用连接查询语句
 /// </summary>
 public void Connect(string strSql, string receiname)
 {
     SqlDBConnect db = new SqlDBConnect();
     DataTable dt = new DataTable();
     dt = db.Get_Dt(strSql);
     string count = dt.Rows.Count.ToString();
     //通过sql条件显示报表窗体
     PublicDetailForm form = new PublicDetailForm();
     form.MdiParent = this;
     form.Show();
     form.ReiceName = receiname;
     form.Username = userName;
     form.strSql = strSql;
     form.count = count;
     form.ShowReport();
 }