In Dynamics NAV 2013 R2 it is now possible, again, to implement Page X of Y for document reports.

PageXofY

In previous versions of RDLC the problem was that in a typical document report the content of the body was put in a List container to implement the Number Of Copies option. Via the List we then grouped the Body on the OutputNo variable. To be able to calculate the page number we then had to use complex expressions because of the fact that we had to reset it for every new copy. And there was no solution to calculate and reset the total pages.

In RDLC 2010 there is a simple solution. Let’s he how it works.

Basically we will be using a new property introduced in RDLC 2010 in the group properties of a List data region: ResetPageNumber

PageXofY2

To do this follow these steps:

  1. select the List control in the body of your document report
  2. select the group in the Row Groups window
  3. open the Properties
  4. enable ResetPageNumber.

This means that when the group encounters a new OutPutNo it will reset the page numbers (PageNumber and TotalPages).

Then you can just use these in the Header of the report as shown here:

PageXofY3

In this example we are using a replace function to replace the placeholders %1 and %2 in the PageCaption and show the result.

And voila, you’re done.

Nice, isn’t it?

For a video demonstration on this topic please have a look here.

 

boom_lente_color

Plataan: Course 80433 Reporting in Microsoft Dynamics NAV 2013
(Date: 08 – 09 Apr, Location: Hasselt)

Reporting in NAV 2013 is perceived as one of the biggest opportunities while being a competence challenge at the same time. If you want to learn how to make state of the art RoleTailored client reports in NAV 2013, then this training is a great opportunity for you.

This course contains following modules:

  1. Creating Reports
  2. Interactive Features
  3. Adding code to a Report
  4. Design Considerations
  5. Running Reports
  6. Upgrade Reports

More info available here.

msdn

Microsoft has released new videos in the How do I video series on Microsoft MSDN, which you can find here. The project is a joint effort by Plataan and Microsoft, and I participated as a technical expert in charge of seven videos. The idea is to showcase a Dynamics NAV 2013 topic in 5-15 minutes. The videos are developed and delivered by following Plataan trainers:

  • Koen Stox (MCT)
  • Vjekoslav Babic (MCT / MVP)
  • Steven Renders (MCT)

The project is still ongoing, but a number of videos have just been released and announced on the Microsoft Dynamics NAV Team Blog:

Enjoy :)

 

tai wishes 2013


Imagine you have to create a report, for example a Document, and there’s certain information, like for example Sales Conditions, that only need to be printed on the footer of the last page. How do you do that in RDLC?

A good thing is always to investigate if there’s a property that you can use. In this case the properties of a header and footer that could help us are: PrintOnFirstPage and PrintOnLastPage. But actually, these two properties allow us to NOT print something on the First and/or Last page, and what we want is the other way around. So, bad luck, these properties will not help us.

Then let’s have a look at the Globals collection. Here we have two interesting Globals:

  • Globals!PageNumber
  • Globals!TotalPages

So, let’s try to use them.

When you use these in a textbox in the body of a report you will get an error:

So adding a textbox to the body of the report and determining via an expression if we are on the last page and then showing/hiding it is not an option. Why would we do this you might think. If you place something at the bottom of the Body it is automatically shown only on the last page, no? Well, in Dynamics NAV Document reports, the Body contains a List, putting it in the List would make it appear on every page and putting it below the List is not an option, because it needs to be shown on the last page, for everydocument.

No problem, let’s put it where it’s allowed, for example the Footer.

To be able to show a field in the dataset on a Footer (or Header) we will need to declare a Variable, a Set function and a Get function:

Shared LastPageInfo as Object
Public Function GetLastPageInfo() as Object
 Return Cstr(LastPageInfo)
End Function
Public Function SetLastPageInfo(NewData as Object)
 If NewData > "" Then
 LastPageInfo = NewData
 End If
End Function

Now we will create a Layout:

The textbox in the Footer is inside a Rectangle and in the Hidden property of the Rectangle we can set the following expression:

And voila the result:

Here you can download the example: InfoOnLastPage v1

By the way, on some blogs you might see a solution to be able to show the PageNumber and TotalPages on the Body of the report using an expression like the following:

Function PageNumber() As String
  Return Me.Report.Globals!PageNumber
End Function

But unfortunately it does not work and always shows 1 as the PageNumber (same for TotalPages). Actually there’s a mention on it on Microsoft Connect here. Were basically the answer from Microsoft is: “We will consider adding this as a new feature in a supported, declarative way via RDL ReportObjectModel enhancements in a future release, and in the meantime also monitor customer vote counts.

I have also tested it on Microsoft Dynamics NAV 2013, with the same result. Maybe when we switch over to RDLC2010 it might become possible :)

Are you interested in Dynamics NAV 2013? Would you like to get the latest in depth information on what’s new functional and technical? Then this might be very interesting…

MICROSOFT DYNAMICS NAV 2013 APPLICATION BOOTCAMP

This  NAV 2013 bootcamp enables you as an experienced NAVconsultant to learn everything and more there is to know about NAV 2013 from Microsoft Dynamics NAV MCT Koen Stox. Learn about user collaboration tools, productivity and RapidStart services. Learn what’s new in Financial Management, Business Intelligence en KPI’s, Assembly Management, Warehouse Management, Inventory, Supply Planning, Jobs en Resources.

MICROSOFT DYNAMICS NAV 2013 MVP DEVELOPMENT BOOTCAMP

This  NAV 2013 bootcamp enables you as an experienced NAV developer to learn everything and more there is to know about NAV 2013 from Microsoft Dynamics NAV MCT en MVP Vjekoslav Babic en MCT Steven Renders . This five day intensive bootcamp does not leave a NAV 2013 stone unturned and walks you throug topics  like architecture, capabilities, queries, .NET interoptability, Reporting, Testing and Debugging, Performance and Page development.

A couple of days ago when I was delivering a Report Design in Dynamics NAV 2009 training one of the students had a very strange problem. Being an experienced trainer I thought I had seen all possible bugs and ‘undocumented features’ of the Report Designer, but this one I had never seen before.

What happened?

Well, very simply, when the student opened the Layout of a report in Visual Studio Report Designer, in the toolbox, there were no Report Items

What you see here in this screenshot, was in fact not there, it was empty:

I then tried to reset it, using the right-click menu shown here:

But, nothing changed. Then I looked into the Options and Customize menu of Visual Studio, but could not find anything different or special. After a bit of searching I decided to de-install Visual Studio and Re-install it, but with no success. The problem still did not went away…

After a bit of searching on vatious fora and blogs I found a solution. In fact there a folder that you can find here: “%USERPROFILE%\Local Settings\Application Data\Microsoft\VisualStudio\x.0” (were x represents the version: 7, 8 or 9) and in this folder there are several hidden files like these:

  • toolbox.tbd
  • toolbox_reset.tbd
  • toolboxIndex.tbd
  • toolboxIndex_reset.tbd

And it seems you have to

  1. Close Visual Studio
  2. Delete these files
  3. Open Visual Studio again
  4. Open the Toolbox
  5. Select the Reset Toolbox option and, magically,

Report Items appear again :) :) :)

 

 

Birmingham-based IT publisher Packt Publishing is about to publish its 1000th title. Packt books are renowned among developers for being uniquely practical and focused, but you’d be forgiven for not yet being in the know – Packt books cover highly specific tools and technologies which you might not expect to see a high quality book on.
Packt is certain that in its 1000 titles there is at least one book that everyone in IT will find useful right away, and are inviting anyone to choose and download any one of its eBooks for free over its celebration weekend of 28-30th Sep 2012. Packt is also opening its online library for a week for free to give customers an easy to way to research their choice of free eBook.
Packt supports many of the Open Source projects covered by its books through a project royalty donation, which has contributed over $4,00,000 to Open Source projects up to now. As part of the celebration Packt is allocating $30,000 to share between projects and authors as part of the weekend giveaway, allocated based on the number of copies of each title downloaded.
Dave Maclean, founder of Packt Publishing:
“At Packt we set out 8 years ago to bring practical, up to date and easy to use technical books to the specialist tools and technologies that had been largely overlooked by IT publishers. Today, I am really proud that with our authors and partners we have been able to make useful books available on over 1000 topics and make our contribution to the development community.”