www.qucamba.com

Tools — Tutorial

Copy Report Wizard

Level: Beginners
Language: English

Things you will learn in this tutorial:

  • How to copy an existing report e.g. from a base app including its AL Code, RDLC layout and Word layout.
  • How to copy translations of an existing report.
  • How to substitute an existing report of the application by your own report.


Tutorial


Tools

Back to List

Copy Report Wizard

Level: Beginners
Language: English

Things you will learn in this tutorial:

  • How to copy an existing report e.g. from a base app including its AL Code, RDLC layout and Word layout.
  • How to copy translations of an existing report.
  • How to substitute an existing report of the application by your own report.

The "Copy Report" tool which is located in the "Tools" section of the "START" ribbon can now be used to create an entirely new report based on an existing one.

This tool allows copying all content of an existing report, such as

  • AL code

  • RDLC layout

  • Word layout

  • Translations

The copied items are placed directly in the current app and the copy is wired-up correctly so that the copy works with the new layout files as well as with the new translations without the user having to customize this. Translations can either be copied to the app’s translation files or to separate files for later merge.

Before using the "Copy Report" tool, we recommend making a backup of your app.

There are three ways to use the copy tool:

  • By clicking the "Copy Report" action in the "Tools" group of the "START" ribbon menu. This opens the "Copy Report" wizard which guides you through all necessary steps to create a copy of one particular report. The wizard lets you specify which report to copy and which parts of the report should be copied. Furthermore, the wizard gives you an option to automatically create report substitution code that redirects all attempts to run the original report to your report copy.

  • In the Instant Styler, by selecting the "Copy Report" style from the "Report Settings" style group. You may want to use this style instead of the wizard mentioned above if you already have the source report opened in the PREVIEW.

  • In the Styler, by adding the "Copy Report" style from the "Report Settings" style group. Please keep in mind, that this requires to either add some "Import" styles or at least put the reports to copy into the styling cart. Using the Copy Report tool from within the styler allows to you create one copy for each report in the styling cart in one go.

To copy a report by using the Copy Report wizard, select the "START" ribbon menu and click on "Copy Report" located in the Tools ribbon group.

Copy Report Ribbon Action

Follow the steps as explained by the wizard and select the content you want to copy.

Copy Report Wizard Step 2

 

First, select the source report that is to be copied. Then, select which content you want to copy and click Next.

In the next wizard step, enter name and id for the new report.

Copy Report Wizard Step 3

Pick an available id from the list or enter the id you want to assign to the new report. In the name field, remember using your app’s prefix or suffix. Then, click Next.

Copy Report Wizard Step 4

In this wizard step, you can check the substitution option which generates AL code that registers an event subscriber that replaces the original report with your new copy. Regardless of how the user attempts to start the original report, all executions of the original report will be redirected and will launch your customized report copy.

The required code needs to reside in a codeunit. In this wizard step, enter id and name for the codeunit to create. Again, remember adding your app’s prefix or suffix to the object’s name.

Click Next to go to the wizard’s summary before proceeding with Finish.

After the wizard processed the copy operation, it opens the copy of the report in the PREVIEW. From here, you may want to either click the "Open in Code" action to examine the AL code in Visual Studio Code or click the "Open in Designer" action to edit the RDLC layout.

Depending on the source report’s AL code, when compiling your app the compiler might come up with some errors. This e.g. happens if the source report calls code that is only visible to internals or if it uses DotNet functionality while your app is configured to not support DotNet (depending on the target-key in your app.json file). In these cases, correct the errors and re-compile your app.

Conclusion

It has never been that easy to copy a report containing all of its content to a new report object. Of course, one could also copy all the parts of a report manually but as soon as it comes to translations this is going to be a tedious job. Using the Copy Report wizard instead, the developer can focus on his job: creating and designing reports.

Back to List