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

sessionState="StateServer"

16 Answers 377 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 29 Jan 2009, 10:52 PM
I posted a couple of weeks ago about a "No Parameterless constructor" error I was getting:

http://www.telerik.com/community/forums/reporting/telerik-reporting/no-parameterless-constructor.aspx

I was referred to a thread:

http://www.telerik.com/community/forums/reporting/telerik-reporting/binding-to-an-arraylist.aspx

On searching, I found a couple more:

http://www.telerik.com/community/forums/reporting/telerik-reporting/error-messages.aspx

http://www.telerik.com/community/forums/reporting/telerik-reporting/instance-variables-are-lost-when-using-stateserver-as-session-state-provider.aspx

http://www.telerik.com/community/forums/reporting/telerik-reporting/instance-variables-are-lost-when-using-stateserver-as-session-state-provider.aspx

The core of the problem is that when sessionState mode='StateServer' or mode='SqlServer' or mode='Custom', the Telerik reporting engine serializes the report, and then deserializes it using the derived class's parameterless constructor.

Now for us, using mode='inProc' is not an option.  I've got no great objection to passing the parameters to the derived report class in some other way.  But I'm at a loss as to what other way we can use.

We have a button click event on the page.  In it, we construct an instance of the derived report class, passing parameters to the constructor, and assign that object to ReportViewer.Report.  It does it's business, and the next time I'm in my own code is in the parameterless constructor of the derived report class.  But how do I access the parameters I used when I called the other constructor? 

I can't save them in member variables, because they aren't being saved and restored during serialization.

I'm not in a Page, so I have no access to Session.  (I thought for a moment that I might be able to access the page, through Report.Container, but it's null.)

So next, I thought that adding them to Report.ReportParameters.  But they're not being restored, either.

So where do I store them, so that I can restore them at the appropriate time?

16 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 30 Jan 2009, 11:52 AM
Hi Jeff,

As described in the threads you referenced, when you use an OutProc session state mode (SQLServer, StateServer), the Web report viewer would only store the report’s type in the ASP.NET session. This unfortunately leads to some unpleasant limitations:

  • The report class should have a default constructor.
  • It is impossible to use a constructor with parameters to customize the report.
  • All modifications to the report instance made outside the default constructor of the report are lost.
Unfortunately there is no easy workaround and as explained in this thread, we are already working on a solution for Q1.

Please excuse us for the inconvenience.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeff
Top achievements
Rank 1
answered on 30 Jan 2009, 01:57 PM
Is there some way to hook into the event chain after the report has been constructed using the default constructor, so as to restore the state that has been lost?

I tried restoring  the state in Page_PreRender(), but that was still too early - the deserialization and the call to the default constructor happened afterward.  I'm not aware of any mechanism for inserting code into the page after Page_PreRender, but I thought I'd ask.

At this point, it sounds like we're forced to use InProc, and hope that you can get a fix out before our site grows to where it will need clustered servers.  Or we find another report-generating tool.


0
Steve
Telerik team
answered on 30 Jan 2009, 04:23 PM
Hello Jeff,

We're putting a lot of efforts to get this to work and we hope that we would be able to overcome the problems we've hit for the Q1 release expected in the end of February. If/once we do, we would update the Reporting Roadmap with this info.

Sorry for the inconvenience once again.

Regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeff
Top achievements
Rank 1
answered on 30 Jan 2009, 06:14 PM
OK, I knew there had to be a work-around for this.

You can access the session from HttpContext.Current, and store and retrieve parameters from the session.

I've only started to play around with this, but it seems to be working.  If there are scenarios where this wouldn't work, please let me know.

The skeleton of an example, without any kind of error checking or handling:
public partial class ReportPage: System.Web.UI.Page 
   ... 
 
   protected void btnRun_Click(object sender, EventArgs e) 
   { 
      ReportViewer.Report = new TestReport(dropdownList.SelectedValue); 
   } 
 
partial class TestReport 
   #region Component Designer generated code 
   ... 
   #endregion 
 
   private Telerik.Reporting.TextBox txtContents; 
 
using System.Web; 
using System.Web.SessionState; 
 
public partial class TestReport : Telerik.Reporting.Report 
   public TestReport(string reportParameter) 
   { 
      HttpSessionState session = HttpContext.Current.Session; 
      if (session.Mode == SessionStateMode.InProc) 
         generateReport(reportParameter); 
      else 
          session.Add("TestReport_parameter", reportParameter); 
   } 
 
   public TestReport() 
   { 
      HttpSessionState session = HttpContext.Current.Session; 
      string reportParameter = (string)session["TestReport_parameter"]; 
      generateReport(reportParameter); 
   } 
 
   private void generateReport(string parameter) 
   {
      InitializeComponent();
      txtContents.Value = String.Format("The report had a parameter of {0}", parameter); 
   } 
}

0
Steve
Telerik team
answered on 02 Feb 2009, 12:51 PM
Hello Jeff,

Keeping your parameters in session has already been suggested in this thread. This might not be working for scenarios where you have more than one viewer showing the same report or you work with the same report on different pages but with the same session (pages are in different tabs on the same browser).

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeff
Top achievements
Rank 1
answered on 02 Feb 2009, 03:30 PM
I see that you did recommend storing the parameters in HttpContext.Current.Session.

I appreciate your pointing out situations in which this might not work.  I think we can avoid those situations in our current application.
0
Jon Kaneshiro
Top achievements
Rank 1
answered on 03 Mar 2009, 10:00 PM
Has the fix for this been released yet?
I saw that there was a release at the beginning of February, but was not sure if it included this fix.
I could not tell from the release notes.


Thanks,
0
Steve
Telerik team
answered on 04 Mar 2009, 08:00 AM
Hi Jon,

The fix would be part of the Q1 release scheduled for mid March.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
antoniodlp
Top achievements
Rank 2
answered on 25 Mar 2009, 09:10 AM
Bad news, :( Still 'No parameterless construction' for me after updating to Q1 2009
0
Chavdar
Telerik team
answered on 25 Mar 2009, 02:02 PM
Hi raindogmx,

The latest release (Q1 2009) still works in the old way. We found some issues with the new implementation which have to be fixed before it is released. Hopefully we should make it for the Q1 2009 SP1.

Greetings,
Chavdar
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Jon Kaneshiro
Top achievements
Rank 1
answered on 08 May 2009, 01:39 AM

I just found out that there is another release and was wondering if it fixed the issue related to sessionstate being sqlserver.
I could not find a mention of this issue having been addressed in the release note.

Thanks,
0
Steve
Telerik team
answered on 08 May 2009, 06:44 AM
Hello Jon,

You can review the following KB article elaborating on the matter: Design Considerations for Out-Proc Session State. We consider that this is the best option for the time being.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
rd
Top achievements
Rank 1
answered on 28 May 2009, 09:35 AM
Hi.

I have implemented a Report solution where the session state is put in a SQLServer.

<sessionState mode="SQLServer" sqlConnectionString="uid=sa;pwd=*******;data source=MJERONIMOS10\MSSQLSERVER2005" cookieless="false" timeout="100" />

The tables ASPStateTempApplications and ASPStateTempSessions are being written with session information.

But instead of my iis process (w3wp.exe) maintains his memory level, it grows up until an SystemOutOfMemoryException is thrown.

Is there any additional configuration (IIS,ReportViewer,etc) that I must do to put this working?

Regards

Manuel Jerónimo



0
Steve
Telerik team
answered on 28 May 2009, 12:09 PM
Hello Ricardo,

SystemOutOfMemory exception problems might be due to very heavy reports and this should not be dependent on the session state you use. Please verify if you're having problems with inproc session state and in such case elaborate on the machine configuration and your report - how many records are shown, how many fields, how many pages are generated etc.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
rd
Top achievements
Rank 1
answered on 28 May 2009, 01:11 PM
Hi again.

Thanks for the quick response.

Indeed that my reports are, sometimes, very heavy. They do not have heavy graphic details (simple lists with 5-6 columns tops), but they have many records. Most of the times, over 20000-30000 records.

Is the number of records a limitation in Telerik Reporting?

Thanks again.
0
Steve
Telerik team
answered on 29 May 2009, 01:55 PM
Hi Ricardo,

We do understand how important performance with large amounts of data is, and I can assure you that we are working constantly in this direction. We nevertheless have to keep in mind that handling large reports usually requires additional resources in terms of powerful CPUs, and enough memory to handle all the operations. As far as the processing time and consumed memory is concerned, the complexity of the report layout, the complexity of the data calculations (aggregates, conditional formatting),  the rendering media, the size of the generated document (in pages), and the capabilities of the underlying machine are crucial.
The current version of the reporting tool would experience performance problems with more than 10,000 , but fixing this will require time. We will also have to take into consideration all other feature requests for the product and leverage the benefit that our clients will get from any improvement, be it performance or new functionality. On top of all this, we are playing catch-up with all vendors on the market, who more or less have very similar performance problems.

Here are a few things you can try. We recommend to avoid using PageCount because it requires an additional pass to count all pages before the actual report rendering (i.e. it renders the report in the memory in order to count all pages). Another option is to reconsider the size of the data you need to display at once (by using parameters and/or filters rather than to show all the raw data from the data source). In contrast to Grid controls, where usually a small subset of data records are displayed, the reporting engines need all the data to layout the pages depending on the selected media (output format). So if your main goal is to show this data for web presentation only, we can suggest a web grid control instead, moreover our RadGrid control exposes API for pdf, csv, word, excel exporting.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Jeff
Top achievements
Rank 1
Answers by
Steve
Telerik team
Jeff
Top achievements
Rank 1
Jon Kaneshiro
Top achievements
Rank 1
antoniodlp
Top achievements
Rank 2
Chavdar
Telerik team
rd
Top achievements
Rank 1
Share this question
or