B1.2 Create a report in NAV 2009 using the external assembly
Try to remember once again: The goal is to create a new report using the external assembly.
- 1. Open Microsoft Dynamics NAV 2009 Classic with SQL Option and connect to you database
- 2. Select Tools – Object Designer
- 3. Select Reports
- 4. Select New
- 5. Create a blank report
- 6. For the data item we will use the user table to get a list of the NAV user.
- 7. Move you cursor to the next empty line the data item designer and select the properties.
- 8. Modify the EnableExternalAssemblies property to yes. This is very important because of security risks by default it is not allowed using external assemblies in reports.
- 9. Moving on to the Section Designer
- 10. Insert a User Header and a User Body
- 11. Insert the USER ID field with the field menu
If you like you can also insert a caption for the report and/or company name and page number etc.
At this point we will move into Visual Studio
- 12. Close the Section Designer
- 13. Select Tools – Create Layout Suggestion
Now we will setup the external assembly for using in this report.
- 14. Go to Report – Report Properties
- 15. Move on to the References tab
- 16. Select the appropriate Assembly using the button on the right side.
- 17. Close the report properties using the OK button and return to the designer
- 18. Insert a second row next to the user id by using the right mouse button.
We will now change the expression of the second textbox calling the assembly
For calling the assembly we have to call the Code region – function(variable) name – name of function in the assembly
- 19. Enter =Code.myfunction.GetPassword in the expression of the textbox
That’s it. Now it’s time to save, compile and start the report.
- 20. Click save in Visual Studio
- 21. Close Visual Studio and return to NAV classic.
- 22. Confirm the appropriate question about update the RDLC in NAV by using the Yes button
- 23. Save and compile the report in NAV
- 24. Start the report
Attention: If you have no output or a blank page in your preview, please check if you have a database user in your company because this example is based on database user list…(or use another table ;-)
Using External Assemblies in NAV 2009 reporting Part II
Using External Assemblies in NAV 2009 reporting Part I
Training- NAV 2009 Reporting mit RDLC Advanced
Далее