zoukankan      html  css  js  c++  java
  • Crystal Report in AX

        COM  com = new COM("CrystalRuntime.Application");
        COM  report = new COM("CrystalRuntime.Report");
        str  pathfile = "F:\\CrystalReport1.rpt";
        ;

       

        report = com.OpenReport(pathfile, 1);
        CrystalReport.ReportSource(report);
        CrystalReport.ViewReport();

    void ViewCrystalReport()
    {
        Com comapp;
        Com reporting;
        str paramwhole;
        str paramfilename;
        str paramCond;
        str ViewYesNo;
        int ret;
        COMVariant variant;

        ;

        variant = new COMvariant(COMVariantInOut::OUT,COMVariantType::VT_BOOL) ;
        paramwhole = this.args().parm();
        comapp = new COM("CrystalRuntime.Application.11");

        ret = strfind(paramwhole,"|",2,strlen(paramwhole));

        paramfilename = substr(paramwhole,2,ret-2) ;
        ViewYesNo = substr(paramwhole,1,1);
        reporting = comapp.openreport(paramfilename);
        reporting.discardsaveddata();
        reporting.readrecords();

        paramcond = substr(paramwhole,ret+1,strlen(paramwhole));

        reporting.RecordSelectionFormula(paramCond);

        if(ViewYesNo == 'N')
        {
            variant.boolean(false);
            reporting.PrintOut(variant);
        }
        else
        {
            ActiveX.ReportSource(reporting);
            ActiveX.width(1200);
            ActiveX.height(750);
            ActiveX.DisplayToolbar(true);
            ActiveX.DisplayGroupTree(false);
            ActiveX.Refresh();
            ActiveX.ViewReport();
            ActiveX.Refresh();
        }


    }

  • 相关阅读:
    IOC容器特性注入第六篇:利用MVC注入点,把容器启动
    IOC容器特性注入第五篇:查找(Attribute)特性注入
    以女朋友为例讲解 TCP/IP 三次握手与四次挥手
    Kali信息收集
    Python3 异常处理
    Python3 hasattr()、getattr()、setattr()、delattr()函数
    Python3 常用模块
    Python设计模式——外观模式
    Python设计模式——模版方法模式
    一个很神奇的类
  • 原文地址:https://www.cnblogs.com/lingdanglfw/p/1296827.html
Copyright © 2011-2022 走看看