zoukankan      html  css  js  c++  java
  • Using The 'Report Data Provider' As The Data Source For AX 2012 SSRS Report

    In this case, we will build a simple vendor report including the fields 'Vendor group', 'Vendor account' and the 'Vendor name'.

    1、At first, we should define a temp table that it will be used as a returning data set for the report.

    2、Create a query for the report.

     3、Define a new 'DataContract' class to add the additional query ranges for the report, this kind of query range dosen't include in the base query.

    [DataContractAttribute]
    public class VendTableDetailContract
    {
        VendName    vendName;
    }
    
    [DataMemberAttribute("Vendor name")]
    public VendName parmVendName(VendName _vendName = vendName)
    {
        vendName = _vendName;
        
        return vendName;
    }
    

    4、Define a new 'SRSReportDataProviderBase' class as the data source for the report.

    [
        SRSReportQueryAttribute(queryStr(VendTableDetaill)),
        SRSReportParameterAttribute(classStr(VendTableDetailContract))
    ]
    public class VendTableDetailDP extends SRSReportDataProviderBase
    {
        VendTableTmp    vendTableTmp;
    }
    
    [SysEntryPointAttribute]
    public void processReport()
    {
        QueryRun                    QR;
        VendTableDetailContract     contract;
        VendTable                   vendTable;
        VendName                    vendName;
    
        contract = this.parmDataContract() as VendTableDetailContract;
        vendName = contract.parmVendName();
    
        QR = new QueryRun(this.parmQuery());
        while (QR.next())
        {
            vendTable = QR.get(tableNum(VendTable));
            
            if (vendTable.name() like strFmt("*%1*", vendName))
            {
                vendTableTmp.clear();
                vendTableTmp.VendGroup  = vendTable.VendGroup;
                vendTableTmp.AccountNum = vendTable.AccountNum;
                vendTableTmp.VendName   = vendTable.name();
                vendTableTmp.doInsert();
            }
        }
    }
    
    [SRSReportDataSetAttribute("VendTableTmp")]
    public VendTableTmp getVendTableTmp()
    {
        select vendTableTmp;
    
        return vendTableTmp;
    }
    

    5、Use the new data source for the report.

  • 相关阅读:
    SQL CREATE INDEX 语句:如何创建索引?
    SQL DEFAULT 约束:使用方法及撤销方法解析
    SQL CHECK 约束:使用方法及撤销方法剖析
    SQL FOREIGN KEY 约束:外键的用法大全
    oracle表的管理和单行函数、多行函数、行列转换、分析函数以及集合运算
    oracle插入数据中文乱码问题
    oracle体系结构
    PL/SQL连接Oracle数据库
    SVN规范
    IDEA下 SVN 配置与使用
  • 原文地址:https://www.cnblogs.com/Jinnchu/p/5355387.html
Copyright © 2011-2022 走看看