Dynamics NAV

Showing posts with label NAV2013R2. Show all posts
Showing posts with label NAV2013R2. Show all posts

Friday, 27 March 2015

Upgrading Reports from NAV2013,NAV2013R2 to NAV2015

If you want to use reports from earlier versions of Microsoft Dynamics NAV, you must upgrade the reports before you can run or modify them. The report formats that were supported in Microsoft Dynamics NAV 2013 were client report definition (RDLC) 2008. In Microsoft Dynamics NAV 2013 R2, the report formats are replaced with client report definition (RDLC) 2010.
Typically, upgrading reports is part of upgrading the Microsoft Dynamics NAV application. However, you can also import reports from .txt files or .fob files.

Importing RDLC 2008 Reports
If you import reports that have RDLC 2008 format from Microsoft Dynamics NAV 2013, then you must upgrade the reports to Microsoft Dynamics NAV 2013 R2.
Upgrading reports is part of the Upgrading the Application Code section of the upgrade process. Follow steps 1 through 5d in the Identifying Customized Objects topic to begin the upgrade process. Then export the relevant report objects, and import them into Microsoft Dynamics NAV 2013 R2.
The following illustration shows the upgrade process for the reports.


When you import the report, Microsoft Dynamics NAV automatically upgrades it to RDLC 2010. SQL Server Report Builder first validates that the reports have the correct RDLC 2008 format and then upgrades them to RDLC 2010 format.
In Object Designer, when the upgrade is complete, the Modified flag is set to Yes. All other properties for the report are not changed.
After the upgrade, you can open the layout in Visual Studio. For more information, see How to: Integrate Report Dataset Designer and Visual Studio Report Designer. You must compile the imported report before you can run it.
Importing RDLC 2010 Reports
You can import reports that have RDLC 2010 format to Microsoft Dynamics NAV 2013 R2. Upgrading the reports is an automated process. SQL Server Report Builder first validates that the reports have the correct RDLC 2010 format and then imports them.
In Object Designer, no properties for the report are changed.

Note : You cannot import reports from versions earlier than Microsoft Dynamics NAV 2013 into Microsoft Dynamics NAV 2013 R2. If you want to import a Microsoft Dynamics NAV 2009 report, you must first upgrade the report to Microsoft Dynamics NAV 2013, and then import it into Microsoft Dynamics NAV 2013 R2


Thursday, 12 March 2015

How can I Reset the page Number for each group in rdlc reports

Please follow the below steps to get the page n of m for each page
Step 1:  Make sure there's a textbox in the report which contains the group expression
Step 2:  Add shared variables to track the current group and page offset
 Shared offset as Integer
 Shared currentgroup as Object
Step 3:  Add a custom function to set the shared variables and retrieve the group page number
 Public Function GetGroupPageNumber(group as Object, pagenumber as Integer) as Object
  If Not (group = currentgroup)
   offset = pagenumber - 1
   currentgroup = group
  End If
  Return pagenumber - offset
 End Function
Step 4: Use the function in the page header or footer
 =Code.GetGroupPageNumber(ReportItems!Category.Value,Globals!PageNumber)
Note:  Because this uses static variables, if two people run the report at the exact same moment, there's a slim chance one will smash the other's variable state  (In SQL 2000, this could occasionally happen due to two users paginating through the same report at the same time, not just due to exactly simultaneous executions)  If you need to be 100% certain to avoid this, you can make each of the shared variables a hash table based on user ID (Globals!UserID).

Wednesday, 14 January 2015

How to add FactBoxes using Query in Dynamics NAV 2013 R2

Introduction

In this demonstration we will explore how to utilize query objects to provide visual statistical data in FactBoxes. For this purpose we will be using Dynamics NAV 2013 R2 version.
The FactBox control in Dynamics NAV is a non-editable right-side pane window which is aimed at providing a quick overview of some statistics for the selected entity (customer, item, invoice line, etc.). The idea is to use the pre-generated query to fill in the FactBox data and display it on a page. To achieve this, we will be going through the following steps:
  • Design the query
  • Create the FactBox
  • Add the FactBox to the page

Design the Query

In Dynamics NAV 2013 R2 Development Environment, open the Object Designer and select the Query object type. Click New to create the new query:
In the Query Designer, fill in the following query data structure:
The field GroupBy is filled in automatically. We added the Salesperson/Purchaser table as the top-level data item. This is the table we are going to use to get the names of our salespeople. We have added one column called Name to this data item.

Next, we have added the Sales Invoice Header data item indented below the Salesperson/Purchaser table. We did not add fields from the Sales Invoice Header table itself, but we changed the Method Type field to Totals and Method to Count. This tells Dynamics NAV to count the total records.

To connect the two tables and calculate the number of invoices per salesperson, select the Sales Invoice Header data item and click SHIFT+F4 to open its properties. Modify the properties as follows:
Click File, Save As and save the query as Salesperson Activity with a sample ID number. The query is generated as follows:

Create the FactBox

In this step we will create the FactBox where we will incorporate the data passed from the query designed previously. In the Object Designer, select Page object type and click New to create the new page. Save the page as Salesperson Activity FactBox with a sample ID. Click View, C/AL Gblobals and add the following variable:
Enter the following page structure:
Select the first empty row in the page designer and click SHIFT+F4 to open the page properties. Change the following properties as shown:
The source table for the page will already have the name of the salesperson to be displayed. What we need to do next is fill in the total quantity of invoices for this salesperson. We will be using the variable InvoiceCount we added above to store the values from the query we created earlier.
Click View, C/AL Globals, and on the Functions tab, add the new function FillTempTable. Close the Globals window and press F9 to open the code designer. Scroll down to the FillTempTable function and while inside the function code, click View, C/AL Locals and add our query as a local variable:
Close the C/AL Locals window and add the following code to the function:
What we do here essentially is:
  • Reset the count variable for each salesperson;
  • Set the query data according to the values in the Salesperson/Purchaser table
  • Open and read the query to calculate the invoices for each salesperson
  • Close the query
Next, we need to place this function on the appropriate page trigger. Scroll up to the following triggers and add the code as shown:
In this way, we tell the system to run and process the query after retrieving the record from the database.
Close and save the page. When we run this FactBox page, we see the following:

Add the FactBox to the Page

The final step is to incorporate the FactBox page into the Salesperson/Purchaser Card page. In the Object Designer, find page 5116 Salesperson/Purchaser Card and click Design. Navigate to the FactBoxArea container and add our FactBox as shown:
Click SHIFT+F4 to open the properties for this page part and change them as follows:
The SubPageLink property actually links our FactBox data to what is displayed on the Salesperson/Purchaser Card at the moment. We are lining the data by the Code field. Save and close the page. When run, we can see the following:

Conclusion

This simple example shows how powerful the combination of Query and FactBox can be. The aim of a query in these cases is to join several tables’ data and display it in an informative view via FactBox control.
Let us know in the comments if you were able to successfully use Query and FactBox together. We’d love to hear about the solutions you come up with!

Saturday, 10 January 2015

Multi-tenancy from NAV2013R2

Multi-tenancy is a principle in software architecture where a single instance of the application runs on a server (or group of servers) and serves multiple clients or tenants. Multi-tenant hosting for Dynamics NAV 2013 R2 is available to be run on both Azure cloud and partner-hosted deployments.


“Multi-tenancy is all about having a lot of customers running the same application,”

The multi-tenancy architecture in NAV 2013 R2 consists of a single application database and multiple data databases. The application database only serves as a source for metadata and source code,”. “Data is separated in tenant databases. One NAV Server Tier (NST) can serve one application database and multiple tenant databases. [On] the other hand the application database and tenant databases can be opened by multiple servers. They even can sit on different SQL servers. This makes the model very flexible and scalable.”