SSRS error in user code: expression expected

I use several custom functions to execute some statistics in SSRS. The code was built and tested in Visual Studio 2010, and it works great when I try and view a report. However, when I try to deploy the report to SSRS 2008R2, I get the error message:

There is an error on line 40 of custom code: [BC30201] Expression expected.

I searched high and low to solve this problem, but I have not found it yet. Here is the problematic code:

Public Function Avrg(c1 As Double, c2 As Double, c3 As Double, c4 As Double, c5 As Double, c6 As Double, c7 As Double, c8 As Double, NumQuarters As Integer) As Double
    Dim AV_Data As Double() =
    IIf(NumQuarters = 1, {c1, c2, c3, c4, c5},
    IIf(NumQuarters = 2, {c1, c2, c3, c4, c5, c6},
    IIf(NumQuarters = 3, {c1, c2, c3, c4, c5, c6, c7}, {c1, c2, c3, c4, c5, c6, c7, c8})))

    Dim stats = STDEV_Ave(AV_Data)

    Avrg = stats(2)
End Function

EDIT: line 40 seems to be a function declaration (first line is presented) ... although I can't find anything wrong with that.

8 , ( 1-4), . , . .

, if-elseif-else, , , IIF, SSRS VB- gimped.

!

+4
2

, , , , , .

, : http://www.sqlservercentral.com/blogs/dknight/2012/01/26/ssrs-custom-code-with-external-assemblies/

SSRS VB, 2008R2 , VS 2010. (EDIT, SEE: SSRS Visual Studio 2010) , Visual Studio . , .

Public Class ClassName
....<Other functions>
    Public Shared Function StdDevP(c1 As Double, c2 As Double, c3 As Double, c4 As Double, c5 As Double, c6 As Double, c7 As Double, c8 As Double, NumQuarters As Integer) As Double
    Dim ST_data As Double() = IIf(NumQuarters = 1, {c1, c2, c3, c4, c5}, IIf(NumQuarters = 2, {c1, c2, c3, c4, c5, c6}, IIf(NumQuarters = 3, {c1, c2, c3, c4, c5, c6, c7}, {c1, c2, c3, c4, c5, c6, c7, c8})))
    Dim stats = STDEV_Ave(ST_data)

    StdDevP = stats(1)
End Function
End Class

SSRS 2008R2, , : 3.5 , . , DLL !

.NET Version dll debug/bin ( ). , .

: dll :...\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\ Reporting Services\ReportServer\bin .

-: gacutil, dll C:\Windows\Assembly. ​​ VS, Visual Studio .

gacutil /i "ClassName.dll"

VS ( BIDS), CD , gacutil.exe, gacutil , Microsoft SDK , gacutil. Windows Server 2008 R2, .NET framework 4 Windows 7. , . gacutil (v , SDK ):

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

SSRS (, ReportServer) BIDS .

, , Class Library Class name . :

=ClassLibrary.ClassName.StdDevP(Fields!Column_1.Value,...)

, !

0

: , . , Switch, , , . .

, , , .

0

All Articles