Exemple #1
0
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);
            string reportName                 = Request.QueryString[DDSetup.QueryReportName];
            string aUId                       = Request.QueryString[DDSetup.ReportParameterUid];
            string allReportFileNmae          = string.Empty;
            string allReportFileNameWithRefId = Request.QueryString[DDSetup.ReportJobName];

            if (!string.IsNullOrEmpty(reportName) && !string.IsNullOrEmpty(aUId))
            {
                allReportFileNmae = reportName;
            }
            else
            {
                Response.Write(" Cannot find report file !");
                return;
            }

            string productReferenceId   = Request.QueryString[DDSetup.ReportParameterProductReferenceID];
            string PdmRequestRegisterID = Request.QueryString[DDSetup.PdmRequestRegisterID];
            string dataSourceType       = Request.QueryString[DDSetup.QueryReportDataSourceType];


            string mainReferenceID   = Request.QueryString[DDSetup.ReportParameterMainReferenceID];
            string masterReferenceID = Request.QueryString[DDSetup.ReportParameterMasterReferenceID];


            if (string.IsNullOrEmpty(PdmRequestRegisterID))
            {
                PdmRequestRegisterID = string.Empty;
            }

            if (!this.IsPostBack)
            {
                if (string.IsNullOrEmpty(allReportFileNameWithRefId))
                {
                    Response.Write(" Report Job name is missing !");
                    return;
                }
                else// need to create a new JOB
                {
                    // create a report job and add to the queue
                    ReportJobDesc aReportJobDesc = new ReportJobDesc();
                    aReportJobDesc.ReportJobName        = allReportFileNameWithRefId;
                    aReportJobDesc.UId                  = aUId;
                    aReportJobDesc.AllReportFileNmae    = allReportFileNmae;
                    aReportJobDesc.ProductReferenceId   = productReferenceId;
                    aReportJobDesc.PdmRequestRegisterID = PdmRequestRegisterID;
                    aReportJobDesc.DataSourceType       = dataSourceType;
                    aReportJobDesc.MainReferenceID      = mainReferenceID;
                    aReportJobDesc.MasterReferenceID    = masterReferenceID;

                    ReportJobProcessor.ReportJobQueue.Enqueue(aReportJobDesc);


                    Response.Write(" the Print Job was added to print queue  !");
                }
            }
        }
Exemple #2
0
        static void PorcessReportJob()
        {
            while (true)
            {
                while (ReportJobQueue.Count > 0)
                {
                    ReportJobDesc aReportJobDesc = ReportJobQueue.Dequeue();
                    string        atgements      = "\"" + aReportJobDesc.ReportJobName + "," + aReportJobDesc.UId + "," + aReportJobDesc.AllReportFileNmae + "," + aReportJobDesc.ProductReferenceId + "," + aReportJobDesc.PdmRequestRegisterID + "," + aReportJobDesc.DataSourceType + "\"";
                    Process       process        = new Process();
                    process.StartInfo.FileName        = reportExecPrintLocaltion;
                    process.StartInfo.Arguments       = atgements;
                    process.StartInfo.UseShellExecute = true;
                    process.StartInfo.WindowStyle     = ProcessWindowStyle.Normal;
                    process.StartInfo.CreateNoWindow  = true;
                    process.Start();
                    process.WaitForExit();
                }

                Thread.Sleep(1 * 1000);
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                System.Console.Write("cannot find args");
                return;
            }
            string atgements = args[0];

            //  string atgements = "Ref,1,Crystal_OSC_GetTab1.rpt|OSC_Proto Summary.rdlx|OSC_First_Offline_Report.rdlx,21836,,PLMDatabase";
            //HybridReportEngine "Ref# 21836 PDP Test 1,1,Crystal_OSC_GetTab1.rpt^21836,,PLMDatabase"


            string[] inPutPara = atgements.Split(',');
            if (inPutPara.Length != 5)
            {
                return;
            }


            Application_Start();
            ReportJobDesc aReportJobDesc = new ReportJobDesc();

            aReportJobDesc.ReportJobName     = inPutPara[0];
            aReportJobDesc.UId               = ControlTypeValueConverter.ConvertValueToInt(inPutPara[1]);
            aReportJobDesc.AllReportFileNmae = inPutPara[2];

            aReportJobDesc.PdmRequestRegisterID = inPutPara[3];
            aReportJobDesc.DataSourceType       = inPutPara[4];
            aReportJobDesc.MainReferenceID      = inPutPara[5];
            aReportJobDesc.MasterReferenceID    = inPutPara[6];



            ReportJobManagement.PrintUserReportJob(aReportJobDesc);

            //  File.WriteAllLines("c:\\Test.txt", new string[] { atgements });
        }
Exemple #4
0
        static void AddJobToQueue()
        {
            // need to from Database
            //select PrintJobID ,CreatedDate  from  [pdmPrintJob] where [filename] is null  order by CreatedDate desc
            string atgements = "Ref,1,OSC_Proto Summary.rdlx|OSC_First_Offline_Report.rdlx,21836,,PLMDatabase";

            string[] inPutPara = atgements.Split(',');
            if (inPutPara.Length != 6)
            {
                return;
            }

            ReportJobDesc aReportJobDesc = new ReportJobDesc();

            aReportJobDesc.ReportJobName        = inPutPara[0];
            aReportJobDesc.UId                  = ControlTypeValueConverter.ConvertValueToInt(inPutPara[1]);
            aReportJobDesc.AllReportFileNmae    = inPutPara[2];
            aReportJobDesc.ProductReferenceId   = inPutPara[3];
            aReportJobDesc.PdmRequestRegisterID = inPutPara[4];
            aReportJobDesc.DataSourceType       = inPutPara[5];

            ReportJobQueue.Enqueue(aReportJobDesc);
        }
Exemple #5
0
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);

            //ReportName=Test Crystal Report^15210|Test Dynamic Report^15210
            string mutipleReportNamesWithReferenceIds = Request.QueryString[DDSetup.QueryReportName];
            string sessionUid = Request.QueryString[DDSetup.ReportParameterUid];

            string reportJobName = Request.QueryString[DDSetup.QueryReportJobName];



            int?userid = DDSetup.GetUserIdFromSessionId(sessionUid);

            if (!userid.HasValue)
            {
                Response.Write(" access denied ");
                return;
            }

            if (string.IsNullOrEmpty(mutipleReportNamesWithReferenceIds))
            {
                Response.Write(" no report file name ");
                return;
            }



            string productReferenceId   = Request.QueryString[DDSetup.ReportParameterProductReferenceID];
            string PdmRequestRegisterID = Request.QueryString[DDSetup.QueryPdmRequestRegisterID];
            string dataSourceType       = Request.QueryString[DDSetup.QueryReportDataSourceType];


            string mainReferenceID   = Request.QueryString[DDSetup.QueryReportParameterMainReferenceID];
            string masterReferenceID = Request.QueryString[DDSetup.QueryReportParameterMasterReferenceID];


            if (string.IsNullOrEmpty(PdmRequestRegisterID))
            {
                PdmRequestRegisterID = string.Empty;
            }

            if (!this.IsPostBack)
            {
                if (string.IsNullOrEmpty(reportJobName))
                {
                    Response.Write(" Report Job name is missing !");
                    return;
                }
                else// need to create a new JOB
                {
                    // create a report job and add to the queue
                    ReportJobDesc aReportJobDesc = new ReportJobDesc();
                    aReportJobDesc.ReportJobName        = reportJobName;
                    aReportJobDesc.UId                  = userid;
                    aReportJobDesc.AllReportFileNmae    = mutipleReportNamesWithReferenceIds;
                    aReportJobDesc.ProductReferenceId   = productReferenceId;
                    aReportJobDesc.PdmRequestRegisterID = PdmRequestRegisterID;
                    aReportJobDesc.DataSourceType       = dataSourceType;
                    aReportJobDesc.MainReferenceID      = mainReferenceID;
                    aReportJobDesc.MasterReferenceID    = masterReferenceID;

                    ReportJobProcessor.ReportJobQueue.Enqueue(aReportJobDesc);


                    Response.Write(" the Print Job was added to print queue  !");
                }
            }
        }