Ejemplo n.º 1
0
        private string OutPutFile(UFSoft.UBF.Report.Entity.Report template, DataSet data)
        {
            PrintService printService = new PrintService();
            PrintCreater printCreater = new PrintCreater();

            printService.LoadXmlFormatFromString(printCreater.CreateReport(template).InnerXml);
            printService.LoadPrintData(data);
            printService.ConvertStart();
            string[] resultFilesName = printService.GetResultFilesName();
            return(printService.PhysicalFilePrefix + resultFilesName[0]);
        }
Ejemplo n.º 2
0
        public string ShipUpdown()
        {
            string        printTemplateID = "";
            string        OrgID           = "";
            PurchaseOrder po = PurchaseOrder.Finder.FindByID(poid);

            OrgID = Context.LoginOrg.Code.ToString();
            if (OrgID == "1001")
            {
                if (po.DocumentType.Code.ToString() == "PO31")
                {
                    printTemplateID = "7a794236-de24-48ca-9d56-be1c7d4ec122";
                    //printTemplateID = "dbecd59b-5a87-45c4-89bc-c112a19ca389";
                }
                else if (po.DocumentType.Code.ToString() == "PO32")
                {
                    printTemplateID = "dbecd59b-5a87-45c4-89bc-c112a19ca389";
                }
                else if (po.DocumentType.Code.ToString() == "PO33" || po.DocumentType.Code.ToString() == "PO34")
                {
                    if (po.TC.Name == "人民币元")
                    {
                        printTemplateID = "c8edd94d-960f-44f3-904e-d2be529d01ce";
                    }
                    else
                    {
                        printTemplateID = "8067b04f-8f2f-4d1b-a098-db82b9a43012";
                    }
                }
                else if (po.DocumentType.Code.ToString() == "PO36")
                {
                    printTemplateID = "7a794236-de24-48ca-9d56-be1c7d4ec122";
                    //printTemplateID = "dbecd59b-5a87-45c4-89bc-c112a19ca389";
                }
            }
            else if (OrgID == "1002")
            {
                if (po.DocumentType.Code.ToString() == "PO31")
                {
                    printTemplateID = "a303c5ee-ad16-4d31-96c5-0c4dfbab88a8";
                }
                else if (po.DocumentType.Code.ToString() == "PO32")
                {
                    printTemplateID = "f12ff6c7-79c3-4e8e-80a4-6338400c3395";
                }
                else if (po.DocumentType.Code.ToString() == "PO33" || po.DocumentType.Code.ToString() == "PO34")
                {
                    if (po.TC.Name == "人民币元")
                    {
                        printTemplateID = "0768ce62-a296-4d78-bc4a-5c7d98b39d2c";
                    }
                    else
                    {
                        printTemplateID = "cb2408ee-fe67-4762-82cc-4e1f54403c36";
                    }
                }
                else if (po.DocumentType.Code.ToString() == "PO36")
                {
                    printTemplateID = "a303c5ee-ad16-4d31-96c5-0c4dfbab88a8";
                }
            }


            string          connectionString = UFSoft.UAP.Report.Base.DBConnectionHelper.GetConnectionString();
            string          cultrueName      = UFSoft.UBF.Util.Context.PlatformContext.Current.Culture;
            ReportMDService service          = ReportMDService.GetInstance(connectionString, cultrueName);
            IReportMDReader reader           = service.GetReader();
            IReportTemplate reportTemplate   = reader.GetReportTemplateByID(printTemplateID);

            UFSoft.UBF.Report.Entity.Report report = (UFSoft.UBF.Report.Entity.Report)reportTemplate.Content;
            reader.Dispose();

            DataSet ds       = GetPrintData(poid);
            string  fileName = OutPutFile(report, ds);

            logger.Error("文件路径:" + fileName);
            dyfileurl = fileName;
            return(fileName);
        }