This is a migrated thread and some comments may be shown as answers.

Error with SessionState mode="SqlServer"

5 Answers 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin Ayers
Top achievements
Rank 1
Kevin Ayers asked on 11 Dec 2010, 10:02 PM
To begin with, I've read the article on design considersations for the reports and tried to follow its suggestions. 

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.

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 13 Dec 2010, 02:13 PM
Hi Kevin,

We see in your download history that you have downloaded only the Q3 2010 version, yet in the stack trace you provided, it shows that you're using the Q2 SP1 version. The problem you report is a known one which has been fixed in the Q3 release, namely: An error occurs when using WCF Report Service with out-proc session state mode.

Kind regards,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Kevin Ayers
Top achievements
Rank 1
answered on 19 Dec 2010, 04:56 AM
I've upgraded our reports to Q3 and I'm no longer getting the serialization errors like I was before.  Now I'm getting the error "the expression contains object 'XXXXXX' that is not defined in the current context" for reports that worked fine before.  I've tried the built in datasource from the report designer, I've tried manually calling a stored procedure from the NeedDataSource event - which I'm not even sure is filing even though I deleted the datasource, set it to null, etc...  I know there are fields there and like I said the report was working before the upgrade\switch to sql server session.

And before you ask, I work for a group that has actually bought and downloaded all the software - controls and reports.  I created a seperate account so that I can post without bothering them.
0
Steve
Telerik team
answered on 20 Dec 2010, 02:56 PM
Hi Kevin,

We're glad that upgrading to Q3 resolved the initial issues you've encountered and thank you for the information about the product. Be aware that it is in your best interest to share with us which is the company your work for or contact the purchase person for that company and ask him to add you as licensed developer to his account. This way you would be entitled to using our support system and receive guaranteed replies according to your license.
As for the problems you describe with Q3, it would seem that you're using several Data Items in the same scope, which is an issue that slipped in Q3 and we addressed in internal build that is available for download in your account. Please upgrade and if you're still having problems, we would appreciate if you open support ticket and provide us with a sample runnable project showing the problem at hand.

Greetings,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Kevin Ayers
Top achievements
Rank 1
answered on 20 Dec 2010, 06:22 PM
I will ask that I be added as a licensed developer, in the meantime I am confused by your response.

The datasource is 1 sql statement returning 3-4 data elements that I am wanting to display on bound textboxes - there isn't anything crazy or there are no multiple datasources that we are using here.  We have similar reports that are doing similar items elsewhere without problem and its actually baffling us a little why these are different.  We reverted back to Q2 and the problem went away although the original session problem came back.

Also, upgrade to what?  If its an internal build are we supposed to have access to this?

Thanks,
Kevin
0
Steve
Telerik team
answered on 21 Dec 2010, 01:10 PM
Hello Kevin,

We were only guessing due to the fact that the problem mentioned leads to the same problems with reports that used to run in previous version. As for internal builds - their name means that they are meant for internal use by you i.e. not to be used for production environments. As previously mentioned, they are available for download in your account - see attached screenshots.

Regards,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
Kevin Ayers
Top achievements
Rank 1
Answers by
Steve
Telerik team
Kevin Ayers
Top achievements
Rank 1
Share this question
or