惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
The Last Watchdog
The Last Watchdog
Cisco Talos Blog
Cisco Talos Blog
A
Arctic Wolf
WordPress大学
WordPress大学
The Hacker News
The Hacker News
C
Cybersecurity and Infrastructure Security Agency CISA
H
Help Net Security
GbyAI
GbyAI
V
V2EX
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tor Project blog
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
月光博客
月光博客
B
Blog
T
Threat Research - Cisco Blogs
I
Intezer
Recent Announcements
Recent Announcements
Latest news
Latest news
S
Schneier on Security
美团技术团队
量子位
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
N
News | PayPal Newsroom
Martin Fowler
Martin Fowler
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
爱范儿
爱范儿
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
Cloudbric
Cloudbric
MyScale Blog
MyScale Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
S
Securelist
Hacker News: Ask HN
Hacker News: Ask HN
Y
Y Combinator Blog
Attack and Defense Labs
Attack and Defense Labs
TaoSecurity Blog
TaoSecurity Blog

博客园 - Jacky Xu

Office Excel Add-ins installation for AX 2012 and Dynamics AX 2012 clients reinstalltion Develop a Dynamics AX2012 Report by Visual Studio 2010 Codes Permission Management in AX 2012 Publish AX reports in AX2012 + SQL2008 Create a security policy in Dynamics AX2012 How to use a shared configuration file& Security configuration example in Dynamics AX 2012 Security management in Dynamics AX 2012 Dynamics AX2012 Installation& AOS (Cluster) configuration on Windows 7 Office 2007 Re-installed issue Delete printer sessions on Terminal server for users Launch AX2012 Virtual Machine Change Tracking -- SQL Server 2008 new feature FILESTREAM -- SQL Server2008 New Feature Don't use SQL keyword as your feild name of a table 记忆一些SQL语句 终端服务器许可问题 Can't access maintenance plan because Agent XPs component is turned off as part of the security configuration on sql2005 SQL Error log/Event ID(17890): A significant part of sql server process memory has been paged out. This may result.... command命令大全(转自http://blog.dhedu.gov.cn/u/72/archives/2009/14290.html)
Reports development in Axapta 3
Jacky Xu · 2010-10-15 · via 博客园 - Jacky Xu

XPO File:   /Files/JackyXu1981/ProdReport.rar

Objective: Develop a complex report by X++ (Axapta or Dynamics AX)

Key point: pass parameter, temporary table, query, programmable report

Steps:

Step 1: Create a table as temporary named myTableTMP.

Step 2: Create a Report named myReport.

Step 3: Create a class to show dialog box.

A, Class Declaration

class myClass  extends RunBaseReport
{
    DialogField     dialogsetsqm;
    SETSQM         enSetSQM;
}

B, Overwrite dialog()

public Object dialog(DialogRunbase dialog, boolean forceOnClient)
{
    Object ret;

    ret = super(dialog, forceOnClient);
    dialogsetsqm        = ret.addFieldValue(Typeid( SetSQM ), SETSQM::SET ,"Please select unit measurement for report");

    return ret;
}

C, Overwrite getFromDialog()

public boolean getFromDialog()
{
    boolean ret;

    ret = super();
    enSetSQM        = dialogsetsqm.value();
    return ret;
}

D, Pass parameter value

SetSQM parmSetSQM (SetSQM _setsqm = enSetSQM)
{
    enSetSQM = _setsqm;
    return _setsqm;
}

E, Overwrite lastValueElementName()
public identifiername lastValueElementName()
{
    identifiername ret;
    ret =   reportstr(YourReportName);
    return ret;
}

F, Define a method as temporary table type as your defination to calculate data and insert the data into temporary table.

Server Static myTableTMP CalculateDate(SETSQM _setsqm)
{
    myTableTMP        RptData;
    ;

    Delete_from RptData;

    if(true)
    {
            ttsbegin;
            RptData.XXX='XXX';
            RptData.update();
            ttscommit;
     }

    return RptData;
}

G, Overwrite main()

static void main(Args args)
{
    myReport    _report  =   new myReport()
    ;
    if (_report.prompt())
        _report.run();
}

Step 4: Report

A, Report class declaration

public class ReportRun extends ObjectRun
{
    myReport    _clsRpt;
    myTableTMP _wcpmonthtable ;

}

B, Overwrite init()

public void init()
{
    _clsRpt =  element.args().caller() ; // pass the parameter from a class to report
    super();
}

C, Overwrite Fetch()

public boolean fetch()
{
    boolean ret;
    boolean                     bRunOnce=true;
    int ntemp[14];
    int i   ;

    QueryBuildDataSource wcpmonth;
    myTableTMP  data1,data2 ;
    Query q;
    QueryRun qr;
    str 30 itemgrouparr[] ;
    int j=1 ;
    ;

    data1    = myClass::CalculateData(_clsRpt.parmSetSQM());           //Get data calculated from class
    myTableTMP.setTmpData(data1);                                                //Setup data to temp table   
    q = new Query(this);                       // define query     
    wcpmonth = q.dataSourceTable(tablenum(myTableTMP)) ;     // define query field  
    SysQuery::findOrCreateRange(wcpmonth, fieldnum(myTableTMP, Blind));
    SysQuery::findOrCreateRange(wcpmonth, fieldnum(myTableTMP, Size));
    SysQuery::findOrCreateRange(wcpmonth, fieldnum(myTableTMP, Purpose)) ;
    if(true)                                                                                           //define query sort order
    {
        wcpmonth.addSortField(fieldnum(myTableTMP, Purpose),SortOrder::Ascending) ;
    }


    qr = new QueryRun(q);

    qr.setCursor(data1) ;                     //using data1 to setup cursor for query
    //myPurpose =  wcpmonth.rangeField(fieldnum(myTableTMP, Purpose)).value() ;  // Get query field value
    while (qr.next())
    {
        _wcpmonthtable = qr.get(tablenum(myTableTMP));
        this.execute(3) ;   // insert programmable part. 3 is a control number on programmable part report

    }
    element.send(_wcpmonthtable);
    return true;
}