예제 #1
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     CtrInvoiceReport rpt = new CtrInvoiceReport();
     rpt.Site = this.Site;
     return rpt;
 }
예제 #2
0
        private void Data()
        {
            sb = new StringBuilder();
            String sql;
            sb.Remove(0, sb.Length);

            sb.Append("SELECT ");
            sb.Append("A.InvoiceNumber, ");
            sb.Append("A.StatementHeadDatetime, ");
            sb.Append("C.CustomerName, ");
            sb.Append("B.SaleHeadId, ");
            sb.Append("(D.BankAccountNameBank+'   '+'สาขา   : '+D.BankAccountBrance) AS BankAccountNameBank, ");
            sb.Append("B.moneyPay ");

            sb.Append("FROM STATEMENT_HEAD A ");
            sb.Append("JOIN STATEMENT_DETAIL B ");
            sb.Append("ON A.StatementHeadId = B.StatementHeadId ");
            sb.Append("LEFT JOIN CUSTOMER C ");
            sb.Append("ON A.CustomerId = C.CustomerId ");
            sb.Append("LEFT JOIN BANKACCOUNT D ");
            sb.Append("ON  D.BankAccountId = A.BankAccountId ");

            sb.Append("WHERE A.StatementHeadId = @StatementHeadId");

            sql = sb.ToString();

            com = new SqlCommand(sql, Conn);
            com.Parameters.Add("@StatementHeadId", SqlDbType.Int).Value = StatementHeadId;
            //
            dt = new SqlDataAdapter(com);
            dt.Fill(SaleDataset, "Sale");

            Conn.Close();

            Statement.CtrInvoiceReport Ctr = new CtrInvoiceReport();
            Ctr.SetDataSource(SaleDataset.Tables[0]);
            CrvVC.ReportSource = Ctr;
            CrvVC.Refresh();
            CrvVC.Show();
        }