NAV 2009 Reporting: Document Map

Here is a new blog entry about a feature that comes available thanks to the RDLC we can use in NAV 2009. Called "Document map". A document map is a navigation feature that you know form PDF. In some PDF's you can browse to the chapters in the document. Something like this:

In Microsoft Word 2010, if you use the Header-formats, you get this out-of-the-box:

You can use this in your RDLC-layout as well. It works with groupings. A group-title (if I may call it like that) is some kind of "title" of a certain group of data. You can compare it with a title of a paragraph in a word or pdf document. Let us work this out with an example (a complete useless idiotic example, as always ... you know ... I've got the creativity of a canary (and nothing more)): we'll create a report on Item Ledger Entry, grouped by Location code and Entry Type. I know, it doesn't make sense, but it gave me enough data to show you the concept.

Let's do the report:

I created the dataset with the report-wizard ... A list-style document with these columns:

  • Entry No.
  • Item No.
  • Posting Date
  • Entry Type
  • Document No.
  • Description
  • Location Code
  • Quantity

Furthermore, no groupings (we'll do that in Visual Studio when defining the layout) and finished! If you would run this report, it would give you this result:

That's it, we've got the dataset. Now, let's define the RDLC layout. I'm lazy, so I don't want to start from scratch .. therefore, let's click "Tools"/"Create Layout Suggestion". You'll open a Visual Studio (or another RDLC editor)(if you want to know what you need for this, please read my blog entry about it) and the layout will be there.

You see, just a default layout like we had in the NAV Report Designer. We'll change this, because we want to have a document map example ... .

I want to group on "Location code" and "Entry Type", so first I sort on the key (I would recommend to add a key for this, and use this in your dataset - but it seems it's not necessary (my report worked fine without the key)):

  • Go to the properties of the table
  • Go to the Sorting tab
  • Add:
    • =Fields!Item_Ledger_Entry__Location_Code_.Value
    • =Fields!Item_Ledger_Entry__Entry_Type_.Value

For a better look, I'll move those two columns to the front (you can do this my cut/past). The, I'll add the grouping:

  • Go to the properties of the table again
  • Go to the Groups tab
  • Click Add
  • Group on Location code
  • Uncheck the "Include Group Footer" option

Do the same for the "Entry Type" field.

Now, we've got two groups .. to make this a little bit clearer, just move the expression of the location code to its grouping level, and the same for the Entry type. You'll get something like this:

If you run the report by now, you would get something like this.

Now, this is not new. Just a grouping, nothing more, nothing less.

But how do I add that bloody Document Map?

Well, just go back to your RDLC-layout design in Visual Studio, and go to the properties of the table, and to the Groups-tab:

Edit a group. There you'll find the "Document Map Label"-property. Here, you have to fill in the expression of what your label should be in the document map. I want it to be exactly the same as my Location Code, or Entry Type, so I use that value. Just copy the expression into the Document map:

Do this for both Location Code and Entry Type.

When finished, save the layout, and run your report again:

On the left you'll see a treeview, which is your document map. Just click on the value's and it will navigate you through the resulting report.

How cool is that? :-)

If you would think it would stop here ... you're wrong. Just export your report to Excel or PDF. You'll find your document map again. Here is a screenshot of Excel, where it creates a separate sheet "Document Map" with hyperlinks to the resulting report:

While in PDF it creates bookmarks to the position in the document:

Only issue here is that you don't see the indentation anymore ... but I can live with that :-).

Enjoy!

Ps, you can download my report here. Nothing fancy, just to show you the basics of the Document Map possibilities.

Posted: 2010-3-4 21:32 by waldo | with 10 comment(s) |
Filed under: ,
Bookmark and Share

Comments

# re: NAV 2009 Reporting: Document Map

Thanx, Waldo.

Friday, March 05, 2010 8:50 AM by Luc van Vugt

# re: NAV 2009 Reporting: Document Map

Another great blog, thx Waldo.

Friday, March 05, 2010 9:08 AM by Frank Neeckx

# re: NAV 2009 Reporting: Document Map

Very very cool! I love RDLC :)

Friday, March 05, 2010 9:36 AM by Marq

# re: NAV 2009 Reporting: Document Map

Gladly done :-).  I love RDLC as well .. for reports.  I don't recommend it for documents (but that's another discussion).

Friday, March 05, 2010 9:56 AM by waldo

# re: NAV 2009 Reporting: Document Map

Nice post I have added a link to it from this page on the Dynamics NAV blog: blogs.msdn.com/.../how-to-enable-document-map-in-a-report.aspx

Regards,

Claus

Thursday, March 18, 2010 11:23 AM by Claus Lundstrøm

# re: NAV 2009 Reporting: Document Map

Oh-my-god ... sorry for that .. didn't know :-/ .  You already posted this subject.. sorry ... .

I seem to be making that "mistake" more then once.  I recently finished a blog article about web services.  When finished, I was browsing Freddy's blog, and same story ... he already posted about the same subject.

I'm still going to post the blog anyway, but will refer to it ... to make the effort worth it ;°)

Thursday, March 18, 2010 11:36 AM by waldo

# re: NAV 2009 Reporting: Document Map

No problem I think your post about Document Map is better than mine :-)

Thursday, March 18, 2010 7:35 PM by Claus Lundstrøm

# re: NAV 2009 Reporting: Document Map

Thanx, Waldo

Monday, August 23, 2010 10:14 AM by Sagar

# re: NAV 2009 Reporting: Document Map

To get indentation in a PDF just add an empty string to the "Document Map Label" field for the grouping only i.e.

= "    " + Fields!<FieldName>.Value

and add a normal document label to a textbox/label just above the grouping

Tuesday, July 31, 2012 4:37 AM by flash

# re: NAV 2009 Reporting: Document Map

thanks for the tip!

Tuesday, July 31, 2012 9:58 AM by waldo

Leave a Comment

(required) 
(required) 
(optional)
(required)