Teach Me NAV
A site to support our book 'Implementing Microsoft Dynamics NAV 2009'.
Custom Control for Reporting Services Reports

I recently presented a session at Intergen Dynamics Day called Dynamics NAV 2009 – a “deep dive” in which I showed a custom control that displayed a Graph depicting the Aged Debt for a customer. In this post, I’ll tell you a little bit about how I created this control, how to use it, and of course provide a link to the downloads. The control is free for your own use but as usual it is provided without support or warranty. Here is an example of the control linking to the Customer List (there's no sound on this video but I think it illustrates the control better than a picture).

The control is based upon Freddy Kristiansen’s blog post and sample project for integration to Virtual Earth. In Freddy’s post, he creates a custom control that uses a browser to display a web page that he modifies dynamically to show the Bing Map location of a customer. This made me think that I could pinch Freddy’s code and with a few little tweaks, create a custom control that can display any URL in a mini-browser. Initially I was going to display a PDF, as I wanted to render a NAV 2009 report as a PDF and then display it in the browser control, but I couldn’t find a way to display the PDF without the Adobe Toolbar. Then I remembered I could create a Reporting Services report and use the ReportServer to display the report with no toolbar. Perfect!

I’m amazed at not only how powerful these new custom controls are, but also how easy it was to create one (thanks to Freddy’s sample).

I created the control in the VPC for NAV 2009 SP1 that can be downloaded from PartnerSource. To use this control yourself, you first need to create the stored procedure sp_CustAgingBand. This stored procedure takes a Customer No., the Company Name (as it is converted in SQL) and the date at which the graph should be based (since it is an aged debt graph we need a date).

Next, you need to deploy the Reporting Services report. You can do this by opening the Dynamics Day Reports solution and deploying to the http://nav-srv-01/ReportServer that you’ll find on the VPC image.

Then copy the URLControl.dll to the RoleTailored Client\Add-ins\ directory, and register it with a public key token of a1b0b65d07f64054. I called mine SmallURLControl.

Finally, I created a new Page called Customer Aged Debt Factbox (Page 90000) that uses the custom control and modified the Customer List page (page 22) to include my new Fact Box.

I’ve deliberately kept this post short. If you want to know about any of these parts, leave me a comment and I can make a more detailed post at a later date.

You can download the objects from here.


Posted 10-19-2009 10:52 p.m. by David Roys
Powered by Community Server (Non-Commercial Edition), by Telligent Systems