Esempio n. 1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            ActiveReport rpt = null;

            rpt = new Report.rptStackBalance();
            GRN_BL    objSGRN = new GRN_BL();
            DataTable dt      = new DataTable();

            dt = objSGRN.GetGRNStackBalanceReport(UserBLL.GetCurrentWarehouse(), new Guid(drpShed.SelectedValue), new Guid(drpInventoryCoordinatorLoad.SelectedValue), new Guid(drpStackNo.SelectedValue.ToString()));
            if (dt.Rows.Count > 0)
            {
                rpt.DataSource = dt;
                rpt.PageSettings.Margins.Top = 0;
                rpt.PageSettings.Orientation = DataDynamics.ActiveReports.Document.PageOrientation.Landscape;
                // rpt.PageSettings.Orientation=DataDynamics.ActiveReports.Document.Align

                WebViewer1.Report = rpt;
            }
            //Session["ReportType"] = "StackBalance";
            //ScriptManager.RegisterStartupScript(this,
            //                                              this.GetType(),
            //                                              "ShowReport",
            //                                              "<script type=\"text/javascript\">" +
            //                                              string.Format("javascript:window.open(\"ReportViewer.aspx\", \"_blank\",\"height=1000px,width=1000px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) +

            //                                              "</script>",
            //                                              false);
        }
        private void createReport(Object theReportSettings)
        {
            try
            {
                ActiveReport.reportType = Global.ReportsControls.SharedItems.reportTypes.AsposeExcel;
                clsDuplicateSampleReportSettings currentReportSettings = theReportSettings as clsDuplicateSampleReportSettings;
                string designerFile = TGlobalItems.ReportsFolder + "\\DuplicateSampleData.Xlsx";
                MWDataManager.clsDataAccess _courseBlankData = new MWDataManager.clsDataAccess();
                _courseBlankData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
                _courseBlankData.SqlStatement       = "sp_DuplicateSampleReport";
                _courseBlankData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
                _courseBlankData.ResultsTableName   = "DuplicateSampleData";

                SqlParameter[] _paramCollection =
                {
                    _courseBlankData.CreateParameter("@Shaft", SqlDbType.VarChar, 50, reportSettings.Shaft.ToString())
                };

                _courseBlankData.ParamCollection = _paramCollection;
                _courseBlankData.queryReturnType = MWDataManager.ReturnType.DataTable;
                _courseBlankData.ExecuteInstruction();
                DataSet repDataSet = new DataSet();
                repDataSet.Tables.Add(_courseBlankData.ResultsDataTable);
                ActiveReport.SetReport = designerFile;
                ActiveReport.SetReportData(repDataSet);
                ActiveReport.isDone = true;
            }
            catch (Exception _exception)
            {
                Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("Exception Error", _exception.Message, Color.Red);
            }
        }
Esempio n. 3
0
        public ReportTest()
        {
            this.ActiveReport = new ActiveReport();

            this.ActiveReport.ReadHeaders(@"C:\Users\noahb\OneDrive\Dokumente\Poker\PRE\TestData\report_IP_Full.csv");
            this.ActiveReport.ReadRecords(@"C:\Users\noahb\OneDrive\Dokumente\Poker\PRE\TestData\report_IP_Full.csv", 1);
        }
Esempio n. 4
0
        private void Write()
        {
            Task[] tasks = null;

            try
            {
                IEnumerable <KeyValuePair <long, Tick> >[] flows = new IEnumerable <KeyValuePair <long, Tick> > [FlowCount];
                for (int k = 0; k < flows.Length; k++)
                {
                    flows[k] = GetFlow();
                }

                ActiveReport = Reports[WRITE];
                ActiveReport.Start();

                tasks = DoWrite(flows);
                Task.WaitAll(tasks, Cancellation);

                DatabaseSize = Database.Size;
            }
            finally
            {
                ActiveReport.Stop();

                tasks        = null;
                ActiveReport = null;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ActiveReport rpt = null;

            if (Session["ReportType"].ToString() == "SR")
            {
                rpt = new Reports.rptSR();
            }
            else if (Session["ReportType"].ToString() == "GPassBFA")
            {
                rpt = new Reports.rptGPass();
            }


            rpt.Run(false);
            Response.ContentType = "application/pdf";
            Response.AddHeader("content-disposition", "inline; filename=MyPDF.PDF");

            // Create the PDF export object
            PdfExport pdf = new PdfExport();

            // Create a new memory stream that will hold the pdf output
            System.IO.MemoryStream memStream = new System.IO.MemoryStream();
            // Export the report to PDF:
            pdf.Export(rpt.Document, memStream);
            // Write the PDF stream out
            Response.BinaryWrite(memStream.ToArray());
            // Send all buffered content to the client
            Response.End();
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ActiveReport     report          = ReportFactory.GetReport();
            PageDataTransfer transferedData  = new PageDataTransfer(HttpContext.Current.Request.Path);
            string           requestedReport = (string)(transferedData.GetTransferedData("RequestedReport"));

            report.Run(false);
//            Response.AddHeader("Cache-Control", "no-cache");
            Response.ContentType = "application/pdf";
            Response.AddHeader("content-disposition", string.Format("inline; filename={0}.PDF", requestedReport));

            // Create the PDF export object
            PdfExport pdf = new PdfExport();

            // Create a new memory stream that will hold the pdf output
            System.IO.MemoryStream memStream = new System.IO.MemoryStream();
            // Export the report to PDF:
            pdf.Export(report.Document, memStream);
            // Write the PDF stream out
            Response.BinaryWrite(memStream.ToArray());
            // Send all buffered content to the client
            Response.End();

            transferedData.RemoveAllData();
        }
Esempio n. 7
0
        public Dictionary <string, object> Execute(OutputDocument document, Dictionary <string, object> namedPassThroughParameters)
        {
            Dictionary <string, object> results = new Dictionary <string, object>();

            try
            {
                if (document.MetaParameters[StdMetaParamNames.DocumentIDKey] != "GenericReport")
                {
                    throw new Exception("Report must be of type GenericReport.");
                }

                document.Data.Seek(0, SeekOrigin.Begin);

                using (XmlReader reader = XmlReader.Create(document.Data))
                {
                    reader.ReadToFollowing("Data");

                    using (MemoryStream data = new MemoryStream())
                    {
                        int    bytes = 0;
                        byte[] buf   = new byte[65536];

                        while ((bytes = reader.ReadElementContentAsBase64(buf, 0, 65536)) > 0)
                        {
                            data.Write(buf, 0, bytes);
                        }

                        if (data.Length == 0)
                        {
                            throw new Exception("The report has no content.");
                        }

                        data.Seek(0, SeekOrigin.Begin);

                        using (ActiveReport report = new ActiveReport())
                        {
                            report.Document.Load(data);

                            //report.Document.Save(exportFilename, DataDynamics.ActiveReports.Document.RdfFormat.ARNet);

                            if (Convert.ToBoolean(_configurationParameters[_OUTPUTENABLE]))
                            {
                                report.Document.Printer.PrinterName            = document.PrinterDeviceName;
                                report.Document.Printer.PrinterSettings.Copies = Convert.ToInt16(document.MetaParameters[StdMetaParamNames.NumberOfCopiesKey]);
                                report.Document.Print(false, false, false);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error printing RDF report.\r\n" + ex.Message);
            }

            return(results);
        }
Esempio n. 8
0
        private void btnPrintOrder_Click(object sender, System.EventArgs e)
        {
            PEMR_PrintOrder_UC printOrder = new PEMR_PrintOrder_UC();

            PopupBaseForm.ShowAsPopup(printOrder, this);
            ActiveReport.CreateDocument();
            ActiveReport.Initialize(PEMRBusinessLogic.ActivePEMRObject);
            documentViewer1.DocumentSource = ActiveReport;
        }
Esempio n. 9
0
        public SummaryTest()
        {
            this.ActiveReport = new ActiveReport();

            this.ActiveReport.ReadHeaders(@"C:\Users\noahb\OneDrive\Dokumente\Poker\PRE\TestData\report_IP_Full.csv");
            this.ActiveReport.ReadRecords(@"C:\Users\noahb\OneDrive\Dokumente\Poker\PRE\TestData\report_IP_Full.csv", 1);
            this.ActiveReport.CalculateActionFrequency();

            this.Summary = new Summary();
        }
Esempio n. 10
0
        public void AddGlobalReport()
        {
            string       expectedGlobalKey = "Global %";
            string       flop         = "9s 4h 3s";
            ActiveReport globalReport = new ActiveReport();

            this.Summary.FormatRecords(this.ActiveReport.Records);
            this.Summary.CalculateCombos(this.ActiveReport.Records);

            globalReport.ReadHeaders(@"C:\Users\noahb\OneDrive\Dokumente\Poker\PRE\TestData\report.csv", 3);
            globalReport.ReadRecords(@"C:\Users\noahb\OneDrive\Dokumente\Poker\PRE\TestData\report.csv", 4);
            this.Summary.AddGlobalReport(globalReport.Records);

            Assert.IsTrue(this.Summary.Records[flop].ContainsKey(expectedGlobalKey));
        }
Esempio n. 11
0
        public static bool PrintDocument(byte[] data, string printername, short copies)
        {
            ActiveReport ar = new ActiveReport();

            Stream mstr = new MemoryStream(data);

            ar.Document.Load(mstr);

            ar.Document.Printer.PrinterName = printername;

            ar.Document.Printer.PrinterSettings.Copies = copies;

            ar.Document.Print(false, false, false);

            mstr.Close();

            return(true);
        }
Esempio n. 12
0
        private void Init()
        {
            try
            {
                ActiveReport = Reports[WRITE];
                ActiveReport.Start();

                Database.Open();

                Database.DeleteTable(TableName);
                Table = Database.OpenOrCreateTable(TableName);
            }
            finally
            {
                ActiveReport.Stop();
                ActiveReport = null;
            }
        }
Esempio n. 13
0
        private ActionResult StreamReport(string reportType, ActiveReport report, string reportTitle)
        {
            FileStreamResult result = null;

            switch (reportType)
            {
            case CommonConstants.Pdf:
                result = _reportService.ToPdfResult(report, reportTitle);
                break;

            case CommonConstants.Word:
                result = _reportService.ToRtfResult(report, reportTitle);
                break;

            case CommonConstants.Csv:
                result = _reportService.ToTextResult(report, reportTitle);
                break;
            }
            return(result);
        }
Esempio n. 14
0
        private void SecondaryRead()
        {
            Task task = null;

            try
            {
                ActiveReport = Reports[SECONDARY_READ];
                ActiveReport.Start();

                task = DoRead();
                task.Wait(Cancellation);

                DatabaseSize = Database.Size;
            }
            finally
            {
                ActiveReport.Stop();

                task         = null;
                ActiveReport = null;
            }
        }
Esempio n. 15
0
        public static ActiveReport GetReport()
        {
            ActiveReport     report          = null;
            PageDataTransfer transferedData  = new PageDataTransfer(HttpContext.Current.Request.Path);
            string           requestedReport = (string)(transferedData.GetTransferedData("RequestedReport"));
            IGINProcess      ginProcess      = null;

            switch (requestedReport)
            {
            case "rptGINReport":
                ginProcess = GINProcessWrapper.GetGINProcess(false);
                ILookupSource lookupSource = ginProcess.LookupSource;
                report            = new Reports.rptGINReport();
                report.DataSource = new GINReportDataCollection(ginProcess.GetGINReport(ginProcess.GINProcessInformation.Trucks[0].TruckId), lookupSource);
                return(report);

            case "rptPUNTrackingReport":
                ginProcess        = GINProcessWrapper.GetGINProcess(false);
                report            = new Reports.rptPUNTrackingReport();
                report.DataSource = new TrackingReportDataCollection(ginProcess.PUNTrackingReportData);
                return(report);

            case "rptGINTrackingReport":
                report = new Reports.rptGINTrackingReport();
                GINTrackingReportDataCollection gtrDataSource = new GINTrackingReportDataCollection();
                gtrDataSource.AddList((List <GINTrackingReportData>)transferedData.GetTransferedData("GINTrackingReportData"));
                report.DataSource = gtrDataSource;
                return(report);

            case "rptPUNReport":
                report = new Reports.rptPUNReport();
                PUNReportDataCollection puDataSource = new PUNReportDataCollection((PUNReportData)transferedData.GetTransferedData("PUNReportData"));
                report.DataSource = puDataSource;
                return(report);
            }
            return(null);
        }
Esempio n. 16
0
        public void Finish()
        {
            if (!Cancellation.IsCancellationRequested)
            {
                DatabaseSize = Database.Size;
            }
            else
            {
                DatabaseSize = 0;
                return;
            }

            ActiveReport = Reports[SECONDARY_READ];
            ActiveReport.Start();

            try
            {
                Database.Close();
            }
            finally
            {
                ActiveReport.Stop();
            }
        }
Esempio n. 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // DataTable dt = new DataTable();
            ActiveReport rpt = null;

            if (Session["ReportType"].ToString() == "PreArrival")
            {
                BLL.PreArrival objPreArrival = new BLL.PreArrival();
                DataTable      dt            = objPreArrival.PopulatePreArrival(new Guid(Session["CommodityRequestId"].ToString()));
                rpt                           = new rptTrackingReport();
                rpt.DataSource                = dt;
                WebViewer1.Report             = rpt;
                Session["CommodityRequestId"] = null;
                WebViewer1.Width              = 600;
                WebViewer1.Height             = 400;
            }
            if (Session["ReportType"].ToString() == "GRN")
            {
                rpt = new rptGRNnew();
                GRN_BL    objGrnBl = new GRN_BL();
                DataTable dt       = objGrnBl.GetGRNReport(new Guid(Session["GRNId_GRN"].ToString()));
                rpt.DataSource    = dt;
                WebViewer1.Report = rpt;
            }
            if (Session["ReportType"].ToString() != "DoNuthing")
            {
                if (Session["ReportType"].ToString() == "PUN")
                {
                    rpt            = new rptPUNReport();
                    rpt.DataSource = GINBussiness.PickupNoticeModel.PrintPUN(Session["PUNID"].ToString());
                }
                else if (Session["ReportType"].ToString() == "GIN")
                {
                    rpt = new rptGINReport();
                    Session["GINID"] = ((GINModel)Session["GINMODEL"]).ID;
                    rpt.DataSource   = GINBussiness.PickupNoticeModel.PrintGIN(Convert.ToBoolean(Session["EditModePrint"]), new Guid(Session["GINID"].ToString()));
                }
                else if (Session["ReportType"].ToString() == "PSA")
                {
//----------Updated START ------ NOV 27 2013

                    // if it is redirected from search page
                    string statusx = "Unapproved PSA";
                    if (Request.QueryString["GINID"] == null)
                    {
                        rpt = new rptPSAReport(statusx);
                        Session["GINPSAID"] = ((GINModel)Session["GINMODEL"]).ID;
                        rpt.DataSource      = GINBussiness.PickupNoticeModel.PrintPSA(new Guid(Session["GINPSAID"].ToString()));
                    }
                    else
                    {
                        statusx = (Convert.ToInt16(Request.QueryString["ST"]) % 11 == 0) ? "Approved" : "Unapproved PSA";
                        rpt     = new rptPSAReport(statusx);
                        if (statusx.Equals("Approved"))
                        {
                            rpt.DataSource = GINBussiness.PickupNoticeModel.PrintPSA_Approved(new Guid(Request.QueryString["GINID"]));
                        }
                        else
                        {
                            rpt.DataSource = GINBussiness.PickupNoticeModel.PrintPSA(new Guid(Request.QueryString["GINID"]));
                        }
                    }
//----------Updated End ------ NOV 27 2013
                }
                else if (Session["ReportType"].ToString() == "ExpierdList")
                {
                    rpt = new rptPickupNoticeExpiredList();
                    DataTable dt = new DataTable();
                    dt = PickupNoticeModel.SearchExpieredList(UserBLL.GetCurrentWarehouse(), Convert.ToDateTime(Session["ExpirationDateFrom"]), Convert.ToDateTime(Session["ExpirationDateTo"]));
                    if (dt.Rows.Count > 0)
                    {
                        rpt.DataSource = dt;
                    }
                    else
                    {
                        return;
                    }
                }
                else if (Session["ReportType"].ToString() == "ExpierdListAdmin")
                {
                    rpt = new rptPickupNoticeExpiredList();
                    DataTable dt = new DataTable();
                    dt = PickupNoticeModel.SearchExpieredListAdmin(Convert.ToDateTime(Session["ExpirationDateFrom"]), Convert.ToDateTime(Session["ExpirationDateTo"]));
                    if (dt.Rows.Count > 0)
                    {
                        rpt.DataSource = dt;
                    }
                    else
                    {
                        return;
                    }
                }
                else if (Session["ReportType"].ToString() == "GINApproval")
                {
                    rpt                          = new rptGINApproval();
                    rpt.DataSource               = GINBussiness.GINModel.PrintGINApprovalReport(UserBLL.GetCurrentWarehouse(), new Guid(Session["SelectedLIC"].ToString()));
                    WebViewer1.Report            = rpt;
                    rpt.PageSettings.Margins.Top = 0;
                }
                else if (Session["ReportType"].ToString() == "SampleTicket")
                {
                    //rpt = new rptSampleTicketCoffeeNew();
                    //rpt.DataSource = SamplingBussiness.SamplingModel.GetSampleTicketReport(new Guid(Session["SampleId"].ToString()));

                    rpt            = new rptSampleTicketCoffeeNew();
                    rpt.DataSource = SamplingBussiness.SamplingModel.GetSampleTicketReport(new Guid(Session["SampleId"].ToString()));
                }
                else if (Session["ReportType"].ToString() == "GradingResult")
                {
                    rpt = new rptResultReport();

                    rpt.DataSource = GradingModel.GradingResultreport(Session["GradingCode"].ToString());
                }
                else if (Session["ReportType"].ToString() == "GradingResultNoDeposit")
                {
                    rpt = new rptInspectionTestResult();

                    rpt.DataSource = GradingModel.GetInspectionTestResult(Session["GradingCode"].ToString(), UserBLL.GetCurrentWarehouse());
                }
                else if (Session["ReportType"].ToString() == "GradingCode")
                {
                    rpt = new rptGenerate();
                    DataTable dt = new DataTable();
                    dt = GradingModel.printCode(new Guid(Session["GenerateCode"].ToString()), new Guid(Session["VoucherCommodityTypeID"].ToString()), new Guid(Session["CommodityID"].ToString()));

                    rpt.DataSource = dt;
                }
                else if (Session["ReportType"].ToString() == "GradingResultForSegrigation")
                {
                    rpt            = new Report.rptSegrigationGradingReport();
                    rpt.DataSource = GradingModel.GradingResultreportForSegrigation(Session["GradingCode"].ToString());
                }
                if (Session["ReportType"].ToString() != "GINApproval")
                {
                    rpt.PageSettings.Margins.Top   = 0;
                    rpt.PageSettings.Margins.Left  = 0.4f;
                    rpt.PageSettings.Margins.Right = 0.4f;
                    WebViewer1.Report = rpt;

                    //rpt.Run(false);
                    //Response.ContentType = "application/pdf";
                    //Response.AddHeader("content-disposition", "inline; filename=MyPDF.PDF");

                    //// Create the PDF export object
                    //PdfExport pdf = new PdfExport();
                    //// Create a new memory stream that will hold the pdf output
                    //System.IO.MemoryStream memStream = new System.IO.MemoryStream();
                    //// Export the report to PDF:
                    //pdf.Export(rpt.Document, memStream);
                    //// Write the PDF stream out
                    //Response.BinaryWrite(memStream.ToArray());
                    //// Send all buffered content to the client
                    //Response.End();
                }
            }
        }