Reporting Server - What are the caveats with hyperlinks in fields?

N

Nathan

I'm trying to use a LocalReport in a ReportViewer and make a couple fields
in the report show up as hyperlinks so I can navigate to other pages after
running the report. The hyperlinks themselves are not showing up at all
unless I use something simple like, http://www.msnbc.com. When I use
something more complicated like a relative path with a querystring, they
just simply don't appear as hyperlinks at all, just flat text.

Here's an example of the link I'm trying to use. The querystring values are
concatenated in an expression on the field.
http://localhost:1314/CarDashboard/Pages/CRM/CustomerDashboard.aspx?GlobalCustomerID=1235456

If a relative path would work it would look something like this:
.../../Pages/CRM/CustomerDashboard.aspx?GlobalCustomerID=12354566

Any ideas?

Thanks in advance.
-Nathan
 
N

Nathan

To add to this, I also have inspected the rendered html from this report and
when it does work it generates this:
<td class="a115">
<div class="r11">
<a target="_top" style="text-decoration: none; color: Black;"
href="http://www.msnbc.com/">firstname lastname</a>
</div>
</td>

The navigation expression is actually this:
="http://www.msnbc.com"

I also found that it only renders the anchor if i'm using a fully qualified
url and not just a relative path. The error I was having before was caused
by not using .ToString() on my int value in the querystring and also that I
was using a relative path.

In a perfect world, I'd like to be able to change the target frame or remove
it completely so it uses the current frame. I would also like it to use a
relative path, but that's something I can just work around.

ideas?

Thanks,
Nathan
 
N

Nathan

I answered my own question. But hopefully someone can find this useful.

I solved all of this by using a Bookmark. I defined a bookmark navigation
link to be the customer id. Then on the page containing the ReportViewer, I
subscribed to the ReportViewer.BookmarkNavigation event. Inside the handler,
I cancelled the bookmark navigation and then parsed the id form the bookmark
id and used that in a redirect to the page I wanted. This succesfully used
the same frame I was in and allowed me to use relative urls. It also allowed
my PDF output docs to remove the links from the bookmarks. It gave me the
best of all worlds, but it's a little kluge.

Nathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top