Skip to content

ArcherPoint Dynamics NAV Developer Digest – vol 39

The ArcherPoint technical staff—made up of developers, project managers, and consultants – is constantly communicating internally, with the goal of sharing helpful information with one another.

ArcherPoint’s technical staff pose questions, find answers, and share new discorveries about Microsoft Dynamics NAVAs they run into issues and questions, find the answers, and make new discoveries, they post them companywide on Yammer for everyone’s benefit. We in Marketing watch these interactions and never cease to be amazed by the creativity, dedication, and brainpower we’re so fortunate to have in this group—so we thought, wouldn’t it be great to share them with the rest of the Microsoft Dynamics NAV Community? So, the ArcherPoint Microsoft Dynamics NAV Developer Digest was born. Each week, we present a collection of thoughts and findings from the ArcherPoint staff. We hope these insights will benefit you, too.

Question on setting the default column widths in Visual Studio 2012:

Where does Visual Studio 2012 get its defaults for new column widths and heights from? Is there a setting or a configuration file somewhere that I can adjust? It's currently making all new columns 1 inch wide, and I need it to be much smaller. Otherwise, I continually have to modify every tablix column's size width/height values.

Suresh Kulla:

I don't think it maintains those properties anywhere, as far as I remember it depends upon which column you are on when you create a new column and the new column will take that column width and height.

Faithie Robertson:

I thought that was the case too, because that's how it works with text boxes - they inherit the current size when copied. But it continues to add them at 1" wide regardless. That's why I'm thinking it must be tied to a default value somewhere - because it's always exactly 1".

Kyle Hardin:

The settings are stored here: C:\Users\%username%\Documents\Visual Studio 2012\Settings, but it's some nasty XML. I didn't see anything obvious in there.

Faithie Robertson:

EWE! Yes Kyle that is some nasty XML! Surely there's a way to read it without having to read the raw XML. I'm looking for a tool now! :)

Faithie Robertson:

Ok, I see that it "might" be part of an XML class called TablixColumnWidth, but I cannot find that class in the settings file. It's inherited from ReportItems class, but it's not in there either.

Faithie Robertson on report layouts in Visual Studio 2012:

Visual Studio 2012...I'm working with a report layout that includes underlines that span wider than the length of an expression (to make it "look" like the page is a form with typed in entries). "Easy enough to do", I thought, "I'll just add a text box to the left and right of the expression text box, and then set the bottom border of all three text boxes to show a bottom line." Well... it worked on the first report I tried it on, but not the next! The solution, should you be trying to add borders and not see them, is to do things in order.

First, change the color of the border from the default "LightGray" (why is that the default?) to "BLACK". Then add the line. If you try to add the line first, and then change the color, VS 2012 will show the line in the preview window, but it will not appear in your report layout. I kid you not! :( Lesson learned!

 Screenshot of Visual Studio 2012 Text Box Properties

Michael Wong on modifying a custom report with a running subtotal:

So I recently had to modify a custom report where the client requested a running subtotal in the footer of each page. Unfortunately, this report had been designed without that logic in place. So for any of you in the same situation here's what I did:

1. Go to the report properties and in the Code section add the following:

Public Shared RunningTotal As Decimal
Public Shared Function SetRunningTotal(ByVal Amount As Decimal)
RunningTotal = RunningTotal + Amount
End Function

Public Shared Function GetRunningTotal(ByVal PrintFooter As Boolean) As Decimal
dim ReturnAmount as Decimal
ReturnAmount = RunningTotal

if PrintFooter then
RunningTotal = 0
end if
Return ReturnAmount

End Function

2. Create a new column in the tablix on the right hand side and set its visibility to hidden.

3. In the same row as the item that needs to subtotaled add this to the cell's expression in your new hidden column:

=Code.SetRunningTotal(Fields![Whatever your subtotal Field is].Value)

4. Rename this cell to something you will remember like RunningTotal.

5. In the footer add a new text field and call it SubtotalValue.

6. In the expression of this text field add the following:


and that's it! The report will subtotal all the lines until the PrintFooter value is set to true, then reset the subtotal for the next invoice. There is a prerequisite for the PrintFooter boolean to be present in the dataset, but you can look at any standard NAV invoice report for information on how to include this.

Suresh Kulla:

I believe this is similar to transheader and transfooter in Classic. The Microsoft Team provided a solution for this, please check below blog

Transfooter and Transheader functionality in RDLC (SSRS) reports

Michael Wong:

Yes, it is similar, however, the RunningValue function will not reset if the client prints multiple invoices in a single batch. In RDLC you'd would have to define a custom group for each invoice number so that the subtotal would reset.

Blog Tags: 


martonn's picture


Hi, the solution which NAV is using when you create a new report layout is stored here : "c:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\ReportLayout\" so maybe you can set the default column widths here. This is an annoying problem anyway if you've found the solution please share it



I looked at that file, and all others in that directory.  I'm afraid I don't see anything there to change.  I know somewhere in the config/settings/css/something there's a setting that VS is defaulting to for column width and height.  But none of my searches are turning up the location.  I'd appreciate any further help you can offer.  This really is a pain in the proverbial hiney!

- Faithie

Read ArcherPoint's Blog Follow us on Twitter Follow us on Facebook Follow us on LinkedIn Link to our RSS feed Watch us on YouTube
Get Help Now