官术网_书友最值得收藏!

Creating a new layout template

Chapter 1, Understanding and Creating Simple SSRS Reports, discussed how using templates can standardize the report. Dynamics AX offers standard templates but there is also the capability to add a new template. This recipe will show how to create a custom layout template that can be used to standardize report aesthetics such font, size, color, and so on.

How to do it…

A new layout template can be created as follows:

  1. Open Visual Studio and navigate to View | Application Explorer. This displays the entire AOT as in the AX environment in Visual Studio.
  2. Navigate to the Sharedlibrary project under Visual Studio Projects | Dynamics AX Model Projects. Right-click and select Edit.
  3. This project contains all the predefined templates. Right-click on the project and select Add | Table style template (Choose the template based on the data region such as table, list, and so on.).
  4. There is no inheritance concept among templates, each template is independent and must define the entire formatting.
  5. Double-click on the template to open the editor and rename it as PktTableStyleFancyTemplate.
  6. In the current report design, there are two levels of groupings defined, CustGroup followed by AccountNum.
  7. To set the fonts for both the levels, the GroupLevel1Style and GroupLevel2Style nodes must be modified.
  8. Expand GroupLevel1Style and double-click on the FieldCaptionStyle node to open the following form (Alternatively open the property window):
  9. Set the following properties for both the nodes:
  10. Repeat the same for DetailRowStyle | FieldValueStyle
  11. Templates don't need deployment and they are available once they are created. Switch to the report node and select the table data region CustTransTable.
  12. The drop-down will have the new template that was added, and set that as the template:
  13. Right-click and preview to see that the fonts are different and the group nodes have a dashed line.

How it works…

Layout templates define the general layout settings such as company name, date, page number, and formatting for a report. The style templates are applicable for data regions and depending on the data region the type of template also varies. AX offers a set of predefined report layout and style templates.

These templates bring in the ability to present uniform look and feel across reports. The elements in a template are fixed depending on the type, so elements cannot be added or removed but can only have different formatting. The templates are useful only in case of auto design, while in the case of precision design they are not used.

主站蜘蛛池模板: 察雅县| 上高县| 宣武区| 昌吉市| 宜黄县| 广河县| 高平市| 宁都县| 仁怀市| 延寿县| 恩平市| 竹北市| 泰宁县| 大港区| 巴彦县| 洞头县| 抚顺市| 车致| 承德市| 博乐市| 台北县| 台湾省| 元谋县| 瓮安县| 沅陵县| 呼玛县| 股票| 都兰县| 通化县| 左云县| 六盘水市| 东阿县| 二手房| 淮滨县| 敖汉旗| 枣强县| 揭西县| 石台县| 阿拉善左旗| 卢龙县| 西安市|