Ejemplo n.º 1
0
        private void ShowImportedDataasRpt(List <CSOMaster> oListSOMaster)
        {
            POS       posdateset  = new POS();
            DataTable dtDailySale = posdateset.DailySales;


            foreach (CSOMaster oSOMaster in oListSOMaster)
            {
                foreach (CSODetails oSODetails in oSOMaster.SOMstr_DetailsList)
                {
                    DataRow drDailySale = dtDailySale.NewRow();

                    drDailySale["BranchName"] = oSOMaster.SOMstr_Branch;
                    drDailySale["Address"]    = currentBranch.CompBrn_Street;
                    drDailySale["Road"]       = currentBranch.CompBrn_Road;
                    drDailySale["City"]       = currentBranch.CompBrn_City;
                    drDailySale["Phone"]      = currentBranch.CompBrn_Phone;
                    drDailySale["Mobile"]     = currentBranch.CompBrn_Mobile;
                    drDailySale["ItemName"]   = oSODetails.SODet_ItemName;
                    drDailySale["Qty"]        = oSODetails.SODet_QTY;
                    drDailySale["Rate"]       = oSODetails.SODet_Price;
                    drDailySale["Amount"]     = oSODetails.SODet_Amount;

                    drDailySale["TotalAmount"] = oSOMaster.SOMstr_TotalAmt;
                    drDailySale["DiscAmount"]  = oSOMaster.SOMstr_DiscAmt;
                    drDailySale["NetAmount"]   = oSOMaster.SOMstr_NetAmt;


                    dtDailySale.Rows.Add(drDailySale);
                }
            }

            rptDailySales orpt = new rptDailySales();

            orpt.SetDataSource(posdateset);
            orpt.SetParameterValue(0, currentBranch.CompBrn_Name.Trim());
            orpt.SetParameterValue(1, oListSOMaster[0].SOMstr_Date.Date);

            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = orpt;
            // orptviewer.AutoSize = false;

            orptviewer.Show();
            ofrmReportView.Show();

            //crystalReportViewer1.ReportSource = orpt;
            //crystalReportViewer1.Show();
        }
Ejemplo n.º 2
0
        private void ShowReport()
        {
            #region 1
            List <CSOMaster> oListSOMaster = LoadSOData();

            POS       posdateset  = new POS();
            DataTable dtDailySale = posdateset.DailySales;



            foreach (CSOMaster oSOMaster in oListSOMaster)
            {
                int i = 0;
                foreach (CSODetails oSODetails in oSOMaster.SOMstr_DetailsList)
                {
                    DataRow drDailySale = dtDailySale.NewRow();

                    //drDailySale["InvoiceNo"] = dr1["InvoiceNo"];
                    drDailySale["BranchName"]  = oSOMaster.SOMstr_Branch;
                    drDailySale["Address"]     = currentBranch.CompBrn_Street;
                    drDailySale["Road"]        = currentBranch.CompBrn_Road;
                    drDailySale["City"]        = currentBranch.CompBrn_City;
                    drDailySale["Phone"]       = currentBranch.CompBrn_Phone;
                    drDailySale["Mobile"]      = currentBranch.CompBrn_Mobile;
                    drDailySale["ItemName"]    = oSODetails.SODet_ItemName;
                    drDailySale["Qty"]         = oSODetails.SODet_QTY;
                    drDailySale["Rate"]        = oSODetails.SODet_Price;
                    drDailySale["Amount"]      = oSODetails.SODet_Amount;
                    drDailySale["TotalAmount"] = oSOMaster.SOMstr_TotalAmt;
                    if (i == 0)
                    {
                        drDailySale["DiscAmount"] = oSOMaster.SOMstr_DiscAmt;
                    }
                    if (i != 0)
                    {
                        drDailySale["DiscAmount"] = 0;
                    }
                    drDailySale["NetAmount"] = oSOMaster.SOMstr_NetAmt;
                    drDailySale["PPrice"]    = oSODetails.SODet_PPrice;


                    dtDailySale.Rows.Add(drDailySale);
                    i++;
                }
            }
            #endregion
            List <CReturnItem> oListCReturnItem = new List <CReturnItem>();
            //List<CSOMaster> oListSOMasterretu = new List<CSOMaster>();
            CSOBO    oCSOBO  = new CSOBO();
            CResult  oResult = new CResult();
            DateTime date    = dtpDate.Value.Date;
            oListCReturnItem = oCSOBO.ReadSalesReturn(dtpDate.Value.Date, currentBranch.CompBrn_Code);
            //oListCReturnItem.Add(oListSOMasterretu);
            New       PosDataSet11 = new New();
            DataTable dtReturn     = PosDataSet11.ReturnItems;
            //foreach (CSOMaster oSoMaster in oListSOMasterretu)
            //{
            //oListCReturnItem.Add(oSoMaster);
            //}

            foreach (CReturnItem oSoDetail in oListCReturnItem)
            {
                DataRow odr = dtReturn.NewRow();
                odr["ItemName"]           = oSoDetail.ItemName;
                odr["Ret_QTY"]            = oSoDetail.Ret_QTY;
                odr["ItemPrice"]          = float.Parse(oSoDetail.ItemPrice.ToString());
                odr["BranchName"]         = oSoDetail.Ret_BranchOID;
                odr["Ret_DiscountAmount"] = oSoDetail.Ret_DiscountAmount;
                //odr["ReturnDate"] = oSoDetail.date;

                dtReturn.Rows.Add(odr);
            }


            //ReturnReport re = new ReturnReport();
            //re.SetDataSource(PosDataSet11);

            rptDailySales orpt = new rptDailySales();
            orpt.SetDataSource(posdateset);
            //orpt.Load("ReturnReport.rpt");
            orpt.OpenSubreport("ReturnReport.rpt").SetDataSource(PosDataSet11);
            orpt.SetParameterValue(0, currentBranch.CompBrn_Name.Trim());
            orpt.SetParameterValue(1, dtpDate.Value.Date);

            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];
            orptviewer.ReportSource = orpt;
            // orptviewer.AutoSize = false;

            orptviewer.Show();
            ofrmReportView.Show();

            //crystalReportViewer1.ReportSource = orpt;
            //crystalReportViewer1.Show();
        }