Conversion of DataItem properties and triggers
The following section explains the main rules of DataItem properties and triggers conversion from Classic Dynamics NAV to RDLC format report.
Conversion of DataItem properties​
The structure of report designer where all the report DataItems are listed has changed. In Classic Dynamic NAV there is Report Designer, the place where only DataItems and their properties are defined.
Figure 5. Classic Report Designer. |
In RDLC format reports there is Report Dataset Designer, the place where all DataItems, DataItem properties, columns and column properties are defined.
Figure 6. RDLC Report Dataset Designer. |
The value of Classic Report Designer DataItem is transferred to Data Source where Data Type = DataItem
in Report Dataset Designer (this is the same as DataItem property DataItemTable). The value of DataItem Name in Report Designer is transferred to Name where Data Type = DataItem
in Report Dataset Designer.
If the same DataItem property exist in both versions, the value of DataItem property from Classic Dynamics NAV report is transferred to the same RDLC format report DataItem property with no changes.
List of Classic Dynamics NAV report DataItem properties which are transferred to RDLC format report DataItem properties:
Classic DataItem Property | RDLC DataItem Property |
---|---|
DataItemIndent | Indentation |
DataItemTable | DataItemTable |
DataItemTableView | DataItemTableView |
DataItemLinkReference | DataItemLinkReference |
DataItemLink | DataItemLink |
ReqFilterHeading | ReqFilterHeading |
ReqFilterHeadingML | ReqFilterHeadingML |
ReqFilterFields | ReqFilterFields |
CalcFields | CalcFields |
MaxIteration | MaxIteration |
DataItemVarName | Name |
PrintOnlyIfDetail | PrintOnlyIfDetail |
Figure 7. Classic Dynamics NAV report DataItem properties which are transferred to RDLC format report DataItem properties. |
There are some Classic Dynamics NAV report DataItem properties which are transferred to RDLC format report layout, as RDLC format reports do not have such properties, but have similar properties or functions in layout part.
List of Classic Dynamics NAV report DataItem properties which are implemented in RDLC format report layout:
Classic DataItem Property |
---|
NewPagePerGroup |
NewPagePerRecord |
TotalFields |
GroupTotalFields |
Figure 8. Classic Dynamics NAV report DataItem properties which are implemented in RDLC format report layout. |
NewPagePerGroup DataItem property. This property specifies if page break is generated after each group defined in GroupTotalFields property. RDLC format reports does not have the same DataItem property, but the same functionality is implemented in layout by using BreakLocation = Between (
Group Properties -> PageBreaks -> BreakLocation
) for a group defined in GroupTotalFields property.NewPagePerRecord DataItem property. This property specifies if page break is generated after each record. RDLC format reports does not have the same DataItem property, but the same functionality is implemented in layout by using BreakLocation = Between (
Group Properties -> PageBreaks -> BreakLocation
) for DataItem body group (group where grouping is defined by DataItemTable primary key).TotalFields DataItem property. This property is used to specify the fields for which totals should be maintained. RDLC format reports does not have the same DataItem property, but the same functionality is implemented by using Sum() function in RDLC format report layout for a field defined in TotalFields property or by adding global variables and performing calculations if Sum() function is not proper to use.
GroupTotalFields DataItem property. This property specifies fields by which grouping should be performed in GroupHeader and GroupFooter sections. RDLC format reports does not have the same DataItem property, but the same functionality is implemented by using fields listed in GroupTotalFields property as a grouping expressions in layout groups.
Conversion of DataItem trigger​
As performance of DataItem triggers have not changed between Classic Dynamics NAV and RDLC format versions, during the conversion all the code from Classic Dynamics NAV report DataItem trigger is transferred to the same RDLC format report DataItem trigger together with C/AL local variables.
List of Classic Dynamics NAV report DataItem triggers which code is transferred to the same RDLC format report DataItem triggers:
Classic DataItem Trigger | RDLC DataItem Trigger |
---|---|
OnPreDataItem() | OnPreDataItem() |
OnAfterGetRecord() | OnAfterGetRecord() |
OnPostDataItem() | OnPostDataItem() |
All the code from Classic Dynamics NAV report OnAfterGetRecord() trigger is added to BEGIN END
sentence in order to avoid converted report compilation errors because of missing semicolon, which can occur as some implementation code (for example, function CurrReport.CREATETOTALS() implementation code) is usually added to the end of OnAfterGetRecord() trigger.
Figure 9. Classic Dynamics NAV report OnAfterGetReccord() trigger. |
Figure 10. RDLC format report OnAfterGetRecord() trigger after conversion. |