By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

Unable to navigate Crystal Report

P: n/a
I am using Visual Studio 2005 Professional edition and built in CR version
10.2.3600.0 to create a web application.

The front-end to the report is written in C#. Basically Report.aspx creates
the datasets that the report needs then creates an instance of the strongly
typed report then passes the populated dataset to the report then sets the
report viewer to the report object.

When the application is run, the report is created just fine, but when I
click on any of the Crystal Reports toolbar functions such as next, print
....etc the page goes blank.

What should I do? Thanks in advance

Alex

Oct 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
We have an expression at work: "Yay, Crystal!"

The problem is that you are not storing the Crystal Report in a
session. One of the hardest thing to do is make sure the report stays
around between postbacks.

You essentially write your code so that it either pulls from the
session or it creates a new one. Once you create it, it is not such a
big deal.

But, yeah, they didn't make it easy to maintain the report across
postbacks. It would have been nice if the report viewer managed it for
you (or if it could be made AJAX-enabled).

private static object ReportSource
{
get
{
const string CRYSTAL_SOURCE = "___CRYSTAL_SOURCE_SESSION_ID";
if (HttpContext.Current.Session[CRYSTAL_SOURCE"] == null)
{
HttpContext.Current.Session[CRYSTAL_SOURCE"] =
getReportSource(); // gets your report source
}
return HttpContext.Current.Session[CRYSTAL_SOURCE"];
}
}

Then you can use it like this:

void Page_Load(object sender, EventArgs e)
{
crystalReportViewer1.ReportSource = ReportSource; // automatically
generates the report if necessary
}

Oct 19 '07 #2

P: n/a
Thank you very much.

"je**********@gmail.com" wrote:
We have an expression at work: "Yay, Crystal!"

The problem is that you are not storing the Crystal Report in a
session. One of the hardest thing to do is make sure the report stays
around between postbacks.

You essentially write your code so that it either pulls from the
session or it creates a new one. Once you create it, it is not such a
big deal.

But, yeah, they didn't make it easy to maintain the report across
postbacks. It would have been nice if the report viewer managed it for
you (or if it could be made AJAX-enabled).

private static object ReportSource
{
get
{
const string CRYSTAL_SOURCE = "___CRYSTAL_SOURCE_SESSION_ID";
if (HttpContext.Current.Session[CRYSTAL_SOURCE"] == null)
{
HttpContext.Current.Session[CRYSTAL_SOURCE"] =
getReportSource(); // gets your report source
}
return HttpContext.Current.Session[CRYSTAL_SOURCE"];
}
}

Then you can use it like this:

void Page_Load(object sender, EventArgs e)
{
crystalReportViewer1.ReportSource = ReportSource; // automatically
generates the report if necessary
}

Oct 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.