all groups > sql server reporting services > september 2005 >
You're in the

sql server reporting services

group:

getting started with custom assemblies


getting started with custom assemblies Peter Nolan
9/17/2005 12:14:36 PM
sql server reporting services:
Hi All,
I've decided to try developing some custom assemblies for performing
calculations like variance to keep the code in the report simpler.

On page 154 of the WROX RS book it says that RSReportDesigner.config
and RSReportServer.config should have entries in them that are
commented out for <CustomAssemblies>...

But when I look at my two files there are no such xml tags..

Should I just add them? Can I do any damage? Or have customassemlies
been turn on by default?

Thanks

Peter
Re: getting started with custom assemblies Peter Nolan
9/17/2005 12:41:54 PM
In case it helps get me (and others) started..

I created a simple class..

Public Class IBIRSClass


Public Shared Function CalcVariancePercentage(ByVal Plan As Double,
ByVal Actual As Double) As Double

Dim Variance As Double

Variance = 0

If Plan = 0 Or Actual = 0 Then
Return 0
Else
Variance = (Plan - Actual) / Plan
Return Variance
End If


End Function

End Class

I copied the dll across to \Reporting Services\ReportServer\bin

I added the reference by going into report->options->references and
browsing to \Reporting Services\ReportServer\bin to put the new class
into the report.

I put the following text into a cell...

=IBIRSCustomClass.IBIRSClass.CalcVariancePercentage(sum (
Fields!resp_tot_plan_amount.Value ) , sum(
Fields!resp_tot_act_amount.Value ) )

And when I build I get

Error while loading code module: 'IBIRSCustomClass,
Version=1.0.2086.34706, Culture=neutral, PublicKeyToken=null'.
Details: File or assembly name IBIRSCustomClass, or one of its
dependencies, was not found.
The value expression for the textbox 'textbox131' contains an
error: [BC30451] Name 'IBIRSClass' is not declared.
Build complete -- 2 errors, 0 warnings

Of course, there may be a few problems..

Firstly, what is the data type of a number passed to a function like
this? Is it really double?

And do I need to put the xml tags mentioned above into the config files
to make this work...I haven't yet...

Thanks

Peter
Re: getting started with custom assemblies Ben Sullins
10/17/2005 3:47:01 PM
Peter,

I am having the same problem. I have been able to find some MSDN articles on
this, but none explaining why it fails.

I am using a C# assembly, is that the same as yours?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_rdl_4lps.asp



[quoted text, click to view]
Re: getting started with custom assemblies Peter Nolan
10/31/2005 6:11:46 AM
Hi Ben,
I am using vb.net...I got this to work without the changes to the
config files......in the end all I am doing is putting the custom
assemblies into the correct directories on the new CTP...I can dig out
the correct names as they are on a different PC..

Peter
AddThis Social Bookmark Button