zoukankan      html  css  js  c++  java
  • 通过Batch发送Report

    1、生成文件。

     1 Args                args;
     2 ReportRun           reportRun;
     3 System.Exception     ex;
     4 str  reportname     = reportstr(PriceDiscTable_Purch_Expiration);
     5 str  AttachmentPath = "\\\\xxxx004\\MailAttachment\\PriceDiscTable_Purch_Expiration.PDF";
     6 //通过Batch生成文件要用相对路径的共享文件夹
     7 ;
     8 
     9 args = new args();
    10 args.name(reportname);
    11 reportRun = new reportRun(args);
    12 reportRun.query().interactive(False);
    13 reportRun.report().interactive(False);
    14 reportRun.setTarget(printMedium::File);
    15 reportRun.printJobSettings().setTarget(PrintMedium::File);
    16 reportRun.printJobSettings().preferredTarget(PrintMedium::File);
    17 reportRun.printJobSettings().format(PrintFormat::PDF);
    18 reportRun.printJobSettings().warnIfFileExists(False);
    19 reportRun.printJobSettings().suppressScalingMessage(True);
    20 reportRun.printJobSettings().packPrintJobSettings();
    21 reportRun.printJobSettings().fileName(AttachmentPath);
    22 reportRun.run();

    2、发送邮件。

     1 SysEmailBatch   mailer = SysEMailBatch::construct();
     2 ;
     3 
     4 mailer.parmPriority(emailPriority::High);
     5 mailer.parmSenderAddr("xxxx@xxxx.com.cn");
     6 mailer.parmEmailAddr("xxxx@xxxx.com.cn");
     7 mailer.parmMessageBody("Jinn test send mail!");
     8 mailer.parmSubject('Jinn test mail');
     9 mailer.addAttachmentfileName("\\\\xxxx004\\MailAttachment\\PurchPriceExp.PDF");
    10 mailer.run();

    3、相关设置。

    (1)邮件服务器设置。

    (2)AOS打印配置。

  • 相关阅读:
    【POJ1456】Supermarket(贪心)
    【HDU5831】Rikka with Parenthesis II(括号)
    【ZOJ2278】Fight for Food(dp)
    【ZOJ2277】The Gate to Freedom
    【ZOJ2276】Lara Croft(bfs)
    3944: Sum[杜教筛]
    [Sdoi2016]平凡的骰子
    [Sdoi2016]齿轮
    [Sdoi2016]硬币游戏
    [NOI2005]月下柠檬树[计算几何(simpson)]
  • 原文地址:https://www.cnblogs.com/Jinnchu/p/2659922.html
Copyright © 2011-2022 走看看