No underline shown on links, Action, Hyperlink, Drillthrough in Reporting Services R2 and Denali

If you’re using the ReportViewer 8.0 web control for Reporting Services 2005 in your web application and pointing at Report Server version R2 or Denali then you may see this bug – some font properties such as Color and TextDecoration do not render on an Action element (used for BookmarkLink, Hyperlink and Drillthrough). To get round this you can turn your property values to expressions e.g. change:

<TextDecoration>Underline</TextDecoration>

to:

<TextDecoration>="Underline"</TextDecoration>

Thanks to JhonnyGaleano for the tip-off on msdn forums

Here’s the full, fixed RDL for a Textbox with Action and Drillthrough:

<TextboxName=section_0_FullName>

<Style>

  <BorderColor>

   <Default>#2F5098</Default>

  </BorderColor>

  <BorderStyle>

   <Default>Solid</Default>

   <Right>None</Right>

  </BorderStyle>

  <BorderWidth>

   <Default>0.1mm</Default>

  </BorderWidth>

  <BackgroundColor>=IIF(RowNumber(Nothing) Mod 2, “#ffffff”, “#faf9f7″)

  </BackgroundColor>

  <FontStyle>=”Italic”</FontStyle>

  <FontFamily>=”Tahoma”</FontFamily>

  <FontSize>=”8pt”</FontSize>

  <FontWeight>=”Bold”</FontWeight>

  <Format />

  <TextDecoration>=”Underline”</TextDecoration>

  <TextAlign>Right</TextAlign>

  <Color>=”#00ff00″</Color>

  <PaddingLeft>1mm</PaddingLeft>

  <PaddingRight>1mm</PaddingRight>

  <PaddingTop>0.5mm</PaddingTop>

  <PaddingBottom>1mm</PaddingBottom>

</Style>

<Action>

<Drillthrough>

  <ReportName>/RSinteract Samples/Orders by Category</ReportName>

  <Parameters>

   <ParameterName=FullName>

    <Value>=Fields!FullName.Value</Value>

   </Parameter>

   </Parameters>

  </Drillthrough>

</Action>

<Value>=Fields!FullName.Value</Value>

<CanGrow>true</CanGrow>

<DataElementName>FullName</DataElementName>

</Textbox>

As this problem doesn’t affect reports viewed through Report Manager on Denali I’m guessing it only affects earlier versions of ReportViewer – if so, you may find it easier to upgrade your web application to use the latest ReportViewer control.

If you want help updating large numbers of existing reports then please get in touch below or through our contact form – we have plenty of code we could put together to create a mass report-update tool…

Passing parameters to a report

Lately we’re getting more and more interest from multitenancy SaaS providers and OEM partners who want to integrate RSinteract into their web applications. A really useful feature of RSinteract is the ability to link to a report from a 3rd party application and pass filter values and UI parameters on the URL.

To do this with a report based on a SQL Server or Oracle data source:

For a report based on an Analysis Services OLAP data source:

  • Create a report with filters, or use this sample report which comes with RSinteract: http://localhost/RSinteract/?/RSinteract+Samples%2fSales+by+Country+(OLAP)
  • Open the report and hover over the parameter in the left hand sidebar
  • Note the RDL field: Date_Fiscal
  • Hold ctrl and double click on the empty bit of sidebar below the Filters panel, click OK to hide the popup message and you’ll see the Reporting Services toolbar at the top of your report
  • Note the parameter value {[Date].[Fiscal].[Fiscal Year].&[2004]}
    • Remove the braces { }
    • Change ampersands to %26
    • Change [ to %5b
    • Change ] to %5d
    • Separate the parameters with &
    • Replace any spaces with %20
    • Parameter names are case-sensitive
  • Put your new URL together by adding: &Date_Fiscal=%5bDate%5d.%5bFiscal%5d.%5bFiscal%20Year%5d.%26%5b2003%5d
  • Try your new URL …Sales+by+Country+(OLAP)&Date_Fiscal=%5bDate%5d.%5bFiscal%5d.%5bFiscal%20Year%5d.%26%5b2003%5d

Notes:

  • Any errors in the report frame are probably due to invalid parameters – if you’re not sure about your parameter values then paste them directly into the Reporting Services toolbar and hit the “View Report” button
  • You don’t need to pass all of a report’s filter parameters on the URL, those not passed will use the normal report defaults.
  • If your Filters tab has the ‘Always Ask’ option ticked you’ll need to add “&rsi:noq=1” to the URL to tell RSinteract not to show the question screen.
  • The rsi:noq=1 option only works if all parameters in the report have a default value or a value is passed on the URL.
  • Make sure you keep everything case sensitive.

The XML page cannot be displayed

I’m just setting up RSinteract on a client’s 64 bit server which has Windows 2003 and SQL 2008. With most RSinteract installations IIS is installed as a prerequisite to Reporting Services but IIS isn’t needed for Reporting Services 2008. I guess this will become a common sticking point with SQL 2008 installations so here’s the solution…

The first problem I got was in the RSinteract installer (whoops, should have copied the error message) so we installed IIS and then RSinteract. When I hit the site I got this error:

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


A name was started with an invalid character. Error processing resource ‘http://myserver/RSinteract’. Line 1, Positio…

<%@ Page EnableViewState="false" Language="c#" ValidateRequest="false" AutoEventWireup="True" Codebehind="Main.aspx.cs" I…

I guess this is because IIS isn’t configured for ASPNET by default so I ran:

%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe –i

Which gave me the following error:

The error indicates that IIS is in 64 bit mode, while this application is a 32 bit application and thus not compatible.

So I made a slight change to point to the 64 bit .NET folder:

%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i

After an iisreset I was now getting a 404 error from aspx pages, the final step was to open IIS (type inetmgr at the command prompt) and go to the “Web Service Extensions” node and enable ASP.NET v2.0.50727. Another iisreset for good measure and we’re now up and running:)

Obsolete Attribute and XML Serialization

   1: public class MyClass
   2: {
   3:     private string _internalProperty;
   4:     private string _newProperty;
   5:
   6:     [Obsolete("This is no longer required, but needed for backwards compatability")]
   7:     public string Property
   8:     {
   9:         get { return _internalProperty; }
  10:         set { _internalProperty = value; }
  11:     }
  12:
  13:     public string NewProperty
  14:     {
  15:         get { return _newProperty; }
  16:         set { _newProperty = value; }
  17:     }
  18:
  19: }

 

This is an interesting little anomaly in the way XML Serialization handles the “Obsolete” attribute on class properties when serializing to and from XML. The attribute is treated as an “XmlIgnore” attribute, meaning that the property is not serialized. It is well documented that adding the aforementioned attribute to a property in .NET 3.5 will cause this behavior, however, it is not mentioned in the same MSDN page for .NET 2.0 on the same subject.

This one caught me out. Apparently the only two ways to fix it are: to take the attributes off or use the “ShouldSerializeX” method constructs as demonstrated below…

 

   1: public bool ShouldSerializeProperty()
   2: {
   3:     return true;
   4: }

 

Follow

Get every new post delivered to your Inbox.