HV-Lima Peru

Offshore your .NET/SQL Development to Latin America! Languages: en-de-es

How to call static Class Libraries’ Functions in your RDL

All depends on the chosen Namespace.

The above class library is called Test, containing a VB-Class RetStrings.
The namespace has been configured as follows:

It follows the class:

When you receive a foreign Assembly (DLL), then have a look inside it with ILDASM:

The output of ILDASM shows, that "reflect" is a C#-static- (VB-shared-) method which returns a string.
You see also the whole namespace, so you know now, after this inspection, how to reference it in SSRS, like in the following picture.
Calling this static (shared) method is that simple, after you became it to know:
(Apodo is nickname in Castellano, which is in this case an SSRS parameter)


How to set the Report User Language OnInit depending on the Client’s Culture?

Create a Workinglanguage Parameter with default value of =code.getLanguage(user!Language)

Create the following User Code:

Public initLanguage As String

Protected Overrides Sub OnInit()
    initLanguage = Report.User!Language
End Sub

Public Function getLanguage(ByVal userLang As String) As Integer
    If instr(userLang, "en") Then Return 1
    If instr(userLang, "de") Then Return 2
    If instr(userLang, "fr") Then Return 3
    If instr(userLang, "it") Then Return 4
    Return 1
End Function

How to forcibly split long running Matrix rows

Problem: if the first Matrix column contains thousands of rows it doesn’t help to set any InteractiveHeight parameter in BIDS.
This problem exists since SSRS 2000 and persists up to the newest SQL Server 2005 SP2 (Feb. 2007).
In IE-clients (IE 6 and IE 7) this leads to a long waiting time for the first page and almost unresponsive behavior because of too much UI-redrawing.
For Winform Apps that use the freely redistributable MS ReportViewer-Control (this includes the newest SP1 as of March 2007) this leads to a total SOAP time-out and hanging IIS (100% and easily 300 MB of occupied memory on the Reporting Server).

So: In the following picture a matrix is embedded into a list.
The first column (u ) will be forced to break with the hbu-matrix-brute-pagebreak pattern.

Set grouping to a user defined function code.setRowAggregate()

Insert the following function in user code:
This will insert a hard-break on any 100 input rows.

Function setRowAggregate() As Integer
    Static Dim a As Integer = 0
    Static Dim b As Integer = 1
    If a < 100 Then
        a += 1
        a = 1
        b += 1
    End If
    Return b
End Function