Relationship between datasource in REPORT query

Source: Internet
Author: User
In a report, query is used as the report data source. If multiple data sources exist and data sources need to be joined by certain fields, there are two ways.
1. Set the relations attribute of the sub-data source to yes, so that the relationship between the data source and the parent data source will be automatically established according to the relationship between the physical table
2. manually add a link under the relations node.
Neither of the two methods can solve one problem. There are two associations between parent and child data sources: nomal and field fixed.
For example, the inventtrans and inventjournaltable tables have multiple relationships. They are all associated using the field transrefid in nomal mode, and define a field fixed relationship by specifying different transtype, in this way, multiple ralations such as Bom, bomline, and inventjournal are formed between the two tables. If you want to use the inventjournal relationship in the report to obtain data in the two tables, the above two methods cannot be implemented (maybe, I cannot find them), because if the first method is used, the default first link is always used (I don't know how to specify the inventjournal link), but the second method cannot create the field fixed type relationship.
No solution was found for viewing the document, but the fetch method can only be reloaded. Code The code for load-specific relationships is as follows: Public Boolean fetch ()
{
Boolean ret;
Queryrun QR;
Dictrelation dict;
;
Qr =   New Queryrun ( This );

Dict =   New Dictrelation (tablenum (inventtrans ));
Dict. loadnamerelation ( " Inventjournal " );

Qr. Query (). datasourcetable (tablenum (inventtrans). addrelation (dict );
RET = Super ();
Return RET;
}

In addition, the right alignment is condemned. It is hard to figure out why axapta has a right alignment. If the corresponding fields of the two tables are installed by default and the global type is not adjusted, no data can be found, by default, one is left-aligned and the other is right-aligned. ft!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.