I've got a pretty simple report with a single parameter defined as long. When I switch to SQL Server session state I get the error:
Exception information:
Exception type: SerializationException
Exception message: Type 'Telerik.Reporting.Service.NameValueDictionary' in Assembly 'Telerik.Reporting.Service, Version=4.1.10.921, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' is not marked as serializable.
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer)
The datasource was a built in telerik datasource, but I've switched it to load on the event NeedDataSource event and I'm still getting the same error. The code behind is below:
public AddressList()
{
/// <summary>
/// Required for telerik Reporting designer support
/// </summary>
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
private void AddressList_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
DataTable allData = new DataTable();
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionName"].ConnectionString);
try
{
SqlCommand cmd = new SqlCommand("spReportAddressList", connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter() { Value=(Int64) report.Parameters["ParamName"].Value, ParameterName="ParamName" });
connection.Open();
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
adapter.Fill(allData);
connection.Close();
}
catch
{
connection.Close();
}
report.DataSource = allData;
}
We have a silverlight application as the hosting application. The report is super simple too - this is the 1st one we are trying to convert after the session state problem. We are doing this change beccause we are moving towards a server farm\multiple wp and telerik doesn't seem to work with that either without first moving the session over to some sort of central storage.
Please help as this is causing us serious issues.