Thursday 15 December 2016

Microsoft dynamics NAV Report

In simple term, Report is used to display certain information as specified in your filter from a database. Two important tasks are required to create a report
  • Designing the data model or dataset by using Report Dataset Designer
  • Design the Visual Layout: Also divided into 2
    • RDLC - Client Report Definition report Layout: created using Visual Studio Report Designer or SQL Server Report Builder.
    • Word Layout: created using Microsoft.
NB: I will only go into RDLC only

Report Dataset determines the data that is extracted or calculated from the Microsoft Dynamics NAV database tables that can be used in a report. Report Dataset is built from data items --which are tables and columns -- which can be any of these: field, variable, expression or text constant.

How to Create a Report Dataset
  • Open the Object Designer and select Report from the left navigation pane.
  • Click New to open a new Report
  • In the first blank line select the data item, the datasource and a CLS complaint name as the name.
  • In the second line select the column(s) you want for your report. 
    • Click View >> Select Field Menu to choose the fields you want. You can select multiple by holding down CTRL or SHFT key.
  • You can link Tables by indenting data items (table) under another data items (table)
    • Make sure you verify the DataItemLinkReference property is set to the Parent data item.
    • Also use the DataItemLink to connect the Tables - just like in SQL connecting the primary key to the foreign key (by setting the field and reference field)

Design the Visual Layout

The layout is designed in Microsoft Visual Studio Report Designer
It starts by opening Visual Studio Report Designer from the Report Object Designer in NAV Development environment.

  • Report >> Design
  • Click View >> Layout: this opens visual studio.
  • On VS, Click View >> Report Data: pin this to the left navigation pane of the IDE

From the Toolbox, drag a Table to the Designer, Right-Click the header to add Column (as many as required).
It is good practice not to hard-code your table therefore follow these steps to name your header and textbox values

  • Right-Click the header >> select Expression 
  • For the header. Select the parameter and double click the value. Repeat this step for all your headers

  • For the textbox: Select the Fields (second row) and double-click the value. Repeat this step for all your textboxes.

In the Properties window, select the Table properties and set the property DataSetName to DataSet_Result -which is automatically done by visual studio.

The Request Page

Request pages enable end users to specify options and filters for a report. It is created by default when a new report created. In addition, you can create custom options in the Request Page.You design these options  y using the Request Options Page Designer which is accessed from the Report Designer.

There are so any properties and functionalities in Report that I can't cover half of it in this blog, so I'll advice you to visit MSDN for more information

The headache here is that any visual design has to be done in Visual Studio and  you have to close VS before you can run the report on the RoleTailoredClient. This means any little customization requires you to open VS, make customization and close VS again before running report. 

No comments:

Post a Comment