sql server reporting services:
Custom assembly call in footer looses property values.
I have a custom assembly that uses a method in the body to pass in a data
field. When I fetch the data in the body I get my data back. When I do the
same in the footer I don't get any data. I have an active call in with
Microsoft so will also post there. I thought
we had working code, I was declaring the module scoped variable as static,
but that ends up with other peoples data on occassion when several people
are running reports. MS Support told me don't use static variables, but if
I don't then I can't access my properties in the footer.
I built a sample report and custom assembly to try to figure this out.
In the report I have something like this:
Body:
=Code.DataInFooter_NonStatic.ExpSet_MyData(First(Fields!LoginID.Value))
=Code.DataInFooter_NonStatic.MyData()
Footer:
=Code.DataInFooter_NonStatic.MyData()
What is displayed:
Body:
expected value
Footer:
empty and this is the problem.
Is it an execution order issue?
Here's my sample code:
using System;
using System.Collections.Generic;
using System.Text;
namespace DataInFooter_NonStatic
{
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
Unrestricted = true)]
public class DataInFooter_NonStatic
{
private string _MyData;
public string MyData
{
get
{
return _MyData;
}
set
{
_MyData = MyData;
}
}
public void WriteToFile(string Input)
{
//throw new System.NotImplementedException();
}
public string ExpSet_MyData(string Input)
{
_MyData = Input;
return _MyData;
}
}
}
Steve MunLeeuw