示例#1
0
        private void print()
        {
            DataRow dr        = gridGRVsView.GetFocusedDataRow();
            String  GRNString = dr["RefNo"].ToString();

            BLL.Receipt receipt = new BLL.Receipt(ReceiptID);


            HCMIS.Desktop.Reports.PreviousCostPrintout xReportCostBuildUp =
                new HCMIS.Desktop.Reports.PreviousCostPrintout();
            xReportCostBuildUp.DataSource = BLL.Receipt.GetPreviousStockforCostAnalysisPrintout(ReceiptID);

            HCMIS.Desktop.Reports.CostAnalysisSubReport xReportCostAnalysis =
                new HCMIS.Desktop.Reports.CostAnalysisSubReport();
            xReportCostAnalysis.DataSource = GRV.CostAnalysis(GRNString);

            HCMIS.Desktop.Reports.CostCalculationPrintout xReportCostCalculationPrintOut =
                new HCMIS.Desktop.Reports.CostCalculationPrintout();
            xReportCostCalculationPrintOut.DataSource = GRV.GRVSoundDetail;

            HCMIS.Desktop.Reports.CostReport xReportCostReport = new HCMIS.Desktop.Reports.CostReport();
            xReportCostReport.DataSource       = receipt.CostAnalysis(GRNString);
            xReportCostReport.xrDate.Text      = EthiopianDate.EthiopianDate.GregorianToEthiopian(BLL.DateTimeHelper.ServerDateTime);
            xReportCostReport.xrCostedBy.Text  = CurrentContext.LoggedInUserName;
            xReportCostReport.xrWarehouse.Text = receipt.GetWarehouse();
            xReportCostReport.subReportCostCalculation.ReportSource = xReportCostCalculationPrintOut;
            xReportCostReport.xrSubreportCostBuildup.ReportSource   = xReportCostBuildUp;
            xReportCostReport.xrSubreportCostAnalysis.ReportSource  = xReportCostAnalysis;
            xReportCostReport.ShowPrintStatusDialog = true;
            xReportCostReport.CreateDocument();
            xReportCostReport.PrintingSystem.Document.AutoFitToPagesWidth = 1;
            xReportCostReport.ShowPreviewDialog();
            // LOG Cost Analysis printout in PDF Log
            MemoryStream stream = new MemoryStream();

            xReportCostReport.ExportToPdf(stream);
            HCMIS.Core.Distribution.Services.PrintLogService.SavePrintLogNoWait(stream, "CostAnalysis", true, ReceiptID,
                                                                                CurrentContext.UserId,
                                                                                BLL.DateTimeHelper.ServerDateTime);
        }
        private void print()
        {
            DataRow dr = gridGRVsView.GetFocusedDataRow();
            String GRNString = dr["RefNo"].ToString();

            BLL.Receipt receipt = new BLL.Receipt(ReceiptID);

            HCMIS.Desktop.Reports.PreviousCostPrintout xReportCostBuildUp =
                new HCMIS.Desktop.Reports.PreviousCostPrintout();
            xReportCostBuildUp.DataSource = BLL.Receipt.GetPreviousStockforCostAnalysisPrintout(ReceiptID);

            HCMIS.Desktop.Reports.CostAnalysisSubReport xReportCostAnalysis =
                new HCMIS.Desktop.Reports.CostAnalysisSubReport();
            xReportCostAnalysis.DataSource = GRV.CostAnalysis(GRNString);

            HCMIS.Desktop.Reports.CostCalculationPrintout xReportCostCalculationPrintOut =
                new HCMIS.Desktop.Reports.CostCalculationPrintout();
            xReportCostCalculationPrintOut.DataSource = GRV.GRVSoundDetail;

            HCMIS.Desktop.Reports.CostReport xReportCostReport = new HCMIS.Desktop.Reports.CostReport();
            xReportCostReport.DataSource = receipt.CostAnalysis(GRNString);
            xReportCostReport.xrDate.Text = EthiopianDate.EthiopianDate.GregorianToEthiopian(BLL.DateTimeHelper.ServerDateTime);
            xReportCostReport.xrCostedBy.Text = CurrentContext.LoggedInUserName;
            xReportCostReport.xrWarehouse.Text = receipt.GetWarehouse();
            xReportCostReport.subReportCostCalculation.ReportSource = xReportCostCalculationPrintOut;
            xReportCostReport.xrSubreportCostBuildup.ReportSource = xReportCostBuildUp;
            xReportCostReport.xrSubreportCostAnalysis.ReportSource = xReportCostAnalysis;
            xReportCostReport.ShowPrintStatusDialog = true;
            xReportCostReport.CreateDocument();
            xReportCostReport.PrintingSystem.Document.AutoFitToPagesWidth = 1;
            xReportCostReport.ShowPreviewDialog();
            // LOG Cost Analysis printout in PDF Log
            MemoryStream stream = new MemoryStream();
            xReportCostReport.ExportToPdf(stream);
            HCMIS.Core.Distribution.Services.PrintLogService.SavePrintLogNoWait(stream, "CostAnalysis", true, ReceiptID,
                                                                                CurrentContext.UserId,
                                                                                BLL.DateTimeHelper.ServerDateTime);
        }