Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports & .NET Session Variables

Status
Not open for further replies.

JCruz063

Programmer
Feb 21, 2003
716
US
Hello all,
I have a .NET web application that allows the user to view Crystal 10 reports. I have about 15 reports, and my users view them, and they're happy.

But, here's a little problem. I'm using Session variables to store the reports so that I don't have to regenerate them after every postback. With that setup, I'm afraid I'm going to run out of memory on the server if many users attempt to print the reports at once. I might get about 50+ users at a time, and thus I'm worried.

I don't want to recreate the reports after each postback, though, because some of my reports take up to even 10 seconds. Recreating them after a post back might just take too long.

Can anyone think of any solution I might use for this?

Thanks.

JC

_________________________________
I think, therefore I am. [Rene Descartes]
 
Doesn't crystal reports allow you to save the file out to a PDF? You could just save the PDF and when a user runs the report, check if the PDF exists first...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks c8msn...

Hmmm... Well, I'm not sure if we're on the same page. Let me explain a bit better.

1 - The reports display dynamic content, based on user selections. A static pdf is not applicable. I use a pdf only when they select to download, in which case I write the report to disc, and then let the user's download it.

2 - Because the reports span multiple pages (even 50+ pages), I created vavigation buttons that allow the user to move from one page to the other in the report. The WebForms Viewer control has its own navigation buttons, but I needed to perform some other operations and so I created my own.

What I do is the following:

On Page_Load, I write the following C# code:
Code:
[blue]if[/blue] (!Page.IsPostBack)
{
  rprt = [blue]new[/blue] ReportDocument();
  ...
  [green]// store the report in the Session[/green]
  Session["report"] = rprt;
}
[blue]else[/blue]
{
  rprt = (ReportDocument)Session["report"];
  ...
}

The navigation buttons retrieve the report which is stored in the Session object and display the appropriate page. That's precisely what my concern is. If too many users attempt to view reports at onces, there will be too many reports on memory, and I was afraid they might crash my poor little server.

What do you think?

Thanks.

JC

_________________________________
I think, therefore I am. [Rene Descartes]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top