How to: Verify Code on a Report
Some code that is supported on Classic report layouts is not supported on client report definition (RDLC) report layouts. If you want to use the RDLC layout of a report, you should verify that all code on your report is supported in the RDLC layout. If code on your report is not supported, then you must move or modify the code.
In some cases, you can use the new report layout functionality to achieve the same result as the unsupported code. For example, some reports have code in a section trigger that specifies whether an item in a report will be visible or not. In the RDLC report layout, code on section triggers is not supported. You can use an expression for the Visibility property instead of code on a section trigger. For more information, see.
To verify code on a report
In the Classic client, on the Tools menu, click Object Designer.
In Object Designer, click Report, select a report, and then click Design.
On the View menu, click C/AL Code.
Verify that the report does not call unsupported functions. If a report does call an unsupported function, determine how to achieve the same functionality by moving or modifying the code or by using new report layout functionality.
Close the C/AL Editor.
On the View menu, click Sections.
In Section Designer, right-click each section, and then select C/AL Code.
Verify that the report does not have code on any section triggers. If a report does have code on a section trigger, determine how to achieve the same functionality by moving or modifying the code or by using new report layout functionality.
On the File menu, click Save.
In the Save window, select the Compiled check box, and then click OK.
Microsoft Dynamics NAV 2009 includes IsServiceTier, which is a new system variable. If you need to modify code on a report, you may need different code to run depending on whether you are running the Classic report layout or the RDLC report layout. Use the IsServiceTier variable to determine which block of code to run.
If the return value of IsServiceTier is true, then the code is being run on Microsoft Dynamics NAV Server. If IsServiceTier is false, then the code is being run on the Classic client.
The following example shows how to use the IsServiceTier variable.
IF IsServiceTier THEN BEGIN <code to run on Microsoft Dynamics NAV Server>; END ELSE BEGIN <code to run on Classic client>; END;
To see an example of the use of the IsServiceTier variable in a report, view the C/AL code on Report 111, Customer - Top 10 List.