zoukankan      html  css  js  c++  java
  • How to get the underlying SSRS Report Query, reset query , add your own ranges and execute report [AX2012]

    Below is the small code snippet to get the underlying query of the SSRS report, reset query, prompt the parameters form, add our own ranges and execute the report. You can customize the job as per your requirements. Below I have used CustBaseData.Report report and added my own range on customer group.

    static void AX6_ResetQueries_executeReport(Args _args)
    {
        #define.reportName(‘CustBaseData.Report’) // report Name
        QueryBuildRange queryBuildRange;
        QueryBuildDatasource queryBuildDatasource;
        SRSReportRun srsReportRun;
        Query reportRunQuery;
        srsReportRun = new SRSReportRun(#reportName);
        srsReportRun.init();
        srsReportRun.resetQueries(); // reset the query
        reportRunQuery = srsReportRun.reportQueries().lookup(srsReportRun.currentQueryKey());
        if (srsReportRun.isInitialized() && srsReportRun.prompt()) // prompt the parameters form
        {
            queryBuildDatasource = SysQuery::findOrCreateDataSource(reportRunQuery, tablenum(CustTable));
    queryBuildRange = SysQuery::findOrCreateRange(queryBuildDatasource,  fieldnum(CustTable, CustGroup));
            queryBuildRange.value(‘INT’);
            queryBuildRange.status(RangeStatus::Hidden);
            srsReportRun.saveSettings();
            srsReportRun.executeReport();
        }
    }
  • 相关阅读:
    C#拾遗(一、基本类型)
    JS正则表达式的test()方法检查汉字
    从程序员到项目经理(一)
    程序员基本素质要求
    似乎比较快
    Qt常用类
    QT 获取窗口 大小 信息
    QT 获取屏幕尺寸的法子
    Qt中 QString 和int, char等的“相互”转换
    qt 读取xml文件
  • 原文地址:https://www.cnblogs.com/Fandyx/p/3243315.html
Copyright © 2011-2022 走看看