Friday, February 24, 2012

C# Custom Assembly

Greetings,
I am new to custom assemblies with reporting services and have followed
along a simple MSDN artcile found below but am unable to get it working.
Please Help...
Running:
- Windows XP
- SRS 2000 sp2
Steps:
1.) Create report <- works fine
2.) Right click in design view, go to report properties
3.) Under References click the elipse (...) and then browse to and select my
custom assembly
4.) Without calling the assembly through an expression or anything I go into
preview and receive the following error:
"Error while loading code module: â'ReportAssembly, Version=1.0.2116.24452,
Culture=neutral, PublicKeyToken=nullâ'. Details: File or assembly name
ReportAssembly, or one of its dependencies, was not found."
Any ideas?
The code inside the C# assembly looks like this:
--
using System;
namespace ReportAssembly
{
public class ReportFns
{
public ReportFns()
{
}
public static decimal Divide(decimal nom , decimal denom)
{
if (denom > 0)
{
return nom/denom;
}
else
{
return 0m;
}
}
}
}
--
Thanks!Hi Ben,
1) Try to set the fuction as static.
2) You need to set the AllowPartiallyTrustedCallers in the AssemblyInfo.cs
to true
3) You need also to change the policy config file.
Read this article :
http://www.codeproject.com/dotnet/CustomAssemblies.asp
I have problem running the assebly under the SSRS
Good Luck.
"Ben Sullins" <BenSullins@.discussions.microsoft.com> wrote in message
news:55B46B71-0407-4D2E-8B87-B3CD00388C8C@.microsoft.com...
> Greetings,
> I am new to custom assemblies with reporting services and have followed
> along a simple MSDN artcile found below but am unable to get it working.
> Please Help...
> Running:
> - Windows XP
> - SRS 2000 sp2
> Steps:
> 1.) Create report <- works fine
> 2.) Right click in design view, go to report properties
> 3.) Under References click the elipse (...) and then browse to and select
my
> custom assembly
> 4.) Without calling the assembly through an expression or anything I go
into
> preview and receive the following error:
> "Error while loading code module: ?ReportAssembly, Version=1.0.2116.24452,
> Culture=neutral, PublicKeyToken=null?. Details: File or assembly name
> ReportAssembly, or one of its dependencies, was not found."
> Any ideas?
>
> The code inside the C# assembly looks like this:
> --
> using System;
> namespace ReportAssembly
> {
> public class ReportFns
> {
> public ReportFns()
> {
> }
> public static decimal Divide(decimal nom , decimal denom)
> {
> if (denom > 0)
> {
> return nom/denom;
> }
> else
> {
> return 0m;
> }
> }
> }
> }
> --
> Thanks!|||From reading that article I found I just didn't have the .dll in the correct
folder locally...works perfect now...Thanks!
"Liz Matyas" wrote:
> Hi Ben,
> 1) Try to set the fuction as static.
> 2) You need to set the AllowPartiallyTrustedCallers in the AssemblyInfo.cs
> to true
> 3) You need also to change the policy config file.
> Read this article :
> http://www.codeproject.com/dotnet/CustomAssemblies.asp
> I have problem running the assebly under the SSRS
>
> Good Luck.
>
> "Ben Sullins" <BenSullins@.discussions.microsoft.com> wrote in message
> news:55B46B71-0407-4D2E-8B87-B3CD00388C8C@.microsoft.com...
> > Greetings,
> >
> > I am new to custom assemblies with reporting services and have followed
> > along a simple MSDN artcile found below but am unable to get it working.
> > Please Help...
> >
> > Running:
> > - Windows XP
> > - SRS 2000 sp2
> >
> > Steps:
> > 1.) Create report <- works fine
> > 2.) Right click in design view, go to report properties
> > 3.) Under References click the elipse (...) and then browse to and select
> my
> > custom assembly
> > 4.) Without calling the assembly through an expression or anything I go
> into
> > preview and receive the following error:
> >
> > "Error while loading code module: â'ReportAssembly, Version=1.0.2116.24452,
> > Culture=neutral, PublicKeyToken=nullâ'. Details: File or assembly name
> > ReportAssembly, or one of its dependencies, was not found."
> >
> > Any ideas?
> >
> >
> > The code inside the C# assembly looks like this:
> > --
> > using System;
> >
> > namespace ReportAssembly
> > {
> > public class ReportFns
> > {
> > public ReportFns()
> > {
> >
> > }
> >
> > public static decimal Divide(decimal nom , decimal denom)
> > {
> > if (denom > 0)
> > {
> > return nom/denom;
> > }
> > else
> > {
> > return 0m;
> > }
> > }
> > }
> > }
> > --
> >
> > Thanks!
>
>

No comments:

Post a Comment