Dynamics AX 2009: Business Intelligence – Adding Links (via URL Drill Through) to Reports
In this post we are going to learn how to make reports that have links in them.
As always, I start with some sample data. In this case, it will be a list of my favorite blogs.
START WITH THE DATA
First, I create a new Data Method
This is the source code for that Data Method
[DataMethod(), AxSessionPermission(SecurityAction.Assert)]
public static System.Data.DataTable DataMethod1()
{
var favorite_blogs = new []
{
new {
Name="Visio Guy",
Url ="http://www.visguy.com/"},
new {
Name="Greg's Cool [Insert Clever Name] of the Day",
Url ="http://coolthingoftheday.blogspot.com/"},
new {
Name="DisplayBlog",
Url ="http://www.displayblog.com/"}
};
var datatable = Isotope.Data.DataUtil.DataTableFromEnumerable(favorite_blogs);
return datatable;
}
You can see from this example how easy it is to create a quick dataset via anonymous types.
And then create a new Data set …
And set the properties as appropriate to point to the Data Method
CREATE A DESIGN
Now just drag the Data Set into the Designs node and assign some style templates and preview…
The column layout isn’t perfect (we’ll correct that later).
So far what we have is just text. If you move the mouse over the URLs they are not treated as URLs but plain text. You can see from the screenshot below that although the cursor is right over the URL that the mouse retains it’s Arrow shape which indicates that this is just plain text.
Our next step will be to make them clickable.
ADD A URL DRILL THROUGH ACTION
Expand the design and find the Data > Url field and right click and select URL Drill Through Action
A new node will appear …
Examine its properties. We need to set the Expression value to something useful.
Click on that field and select “=Fields!Url.Value”
Now preview the report and move the mouse over a URL
As you can see, the cursor now has a hand shape. If you click a new window will launch to that URL
At this point we have the basics done. Let’s optimize the report.
HIDING THE RAW URLS
We don’t want to show the URLs in the report – we want the user to click on the NAME of the blog and that should go to the appropriate URL. This is simple to achieve.
Delete the Url from the design
Only the Name field will remain in the design. Right-Click on the Name field and add a URL Drill Through Action

You can see the new node is created.
Examine its properties. And set the Expression value to =Fields!Url.Value
The thing to notice here is that although the Url field has been deleted from the design (what is shown) of the report, the Url field from the data set that is bound to the report.
Now preview the report
As expected there is only one column. The URLs are not visible.
Now move the mouse cursor over on of the links…
And click…
Perfect. the link now goes to the correct place.
IMPROVING THE LAYOUT
Let’s make the Name column wide enough so that the blog names don’t span multiple lines.
Select the Name column.
And examine its properties. You can see that the Display Width property controls the width of the column
Let’s change this to 4 inches
And preview the report.
LINKS THAT LOOK LIKE LINKS
One final problem remains: Although the links work – they don’t look like links. They still look like plain text.
A straightforward way of fixing this problem is to again look at the properties of the Name field. There’s a section called Style
If you expand that node … you can see there are more options available.
Also, you’ll notice the button on the right with the ellipsis. Click on that.
And you’ll get a special dialog called the Cell Style editor
Set the color to Blue

And the Decoration to Underline
And click OK.
Now preview the report.
Done. We have a report that has simple clickable links.
SOURCE CODE
You can get it here: http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-12%7C6?view=details