How to: Verify Code on a Report

Microsoft Dynamics Nav 2009

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 How to: Apply Conditional Visibility Controls.

To verify code on a report

  1. In the Classic client, on the Tools menu, click Object Designer.

  2. In Object Designer, click Report, select a report, and then click Design.

  3. On the View menu, click C/AL Code.

  4. 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.

  5. Close the C/AL Editor.

  6. On the View menu, click Sections.

  7. In Section Designer, right-click each section, and then select C/AL Code.

  8. 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.

  9. On the File menu, click Save.

  10. In the Save window, select the Compiled check box, and then click OK.

Example

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.

See Also

Community Additions

ADD
Show: