One Report viewer and multiple reports

  • Thread starter Thread starter monskie
  • Start date Start date
M

monskie

Hello to all,

I have a problem which could be trivial to you guys. This
concerns opening several crystal reports on the a crystal
viewer on an ASPX page by calling window.open.

My application.
1.) 2 webforms
- 1 main web form that filters that dataset
- 1 reportviewer web form that displays the filtered dataset.
2.) 5 crystal reports have different report formats.

Tools:
1. VS.NET 2003
2. Crystal professional 10


a.) I launched my asp.net application. From the main page,
I generate a dataset. The user can perform data filters and the
page generates a new dataset/datatable based on the new filter.
b.) the dataset from the main.aspx is saved into a Session object
using a unique name (via GUID object).
c.) The user selects a report format then presses the generate
report button.
d.) The button code behind opens a new browser calling
reportviewer.aspx with a querystring (via javascript call to
window.open).
This query string contains the name of the session where the dataset
is saved.
e.) The reportviewer.aspx page_init code retrieves the session object
containing the dataset and pushes the data to the crystal report.
The report is displayed flawlessly.

Now this is the problem:
f.) Now i have two browsers opened on my desktop. One is the main page,
and
the other containing the report.
g.) I now go back to the main.aspx page and perform again a new set of
filter
and choose a new type of report (following steps a to e above)
i.) The main.aspx page open a new browser window containing the new
report format
and data. (now i have three browser window opened, the main page, the
previous report
and the new report)
j.) Now, if I am to go back to the 1st report and press the "NEXT"
icon/button from the
crystal reports toolbar, the report format or layout of that report
CHANGES to the
second report format which I just created. Now, i have two report
browser windows containing the same report.

I am still new to asp.net and crystal 10. I've checked the net for
possible
answer or directions as what to have caused this behavior. I've checked
sessions states,
and cookies, but I could find answers.

Your thoughts are highly appreciated.

mon
 
Wow, that stinks.


First, your architecture is pretty sound.


(while not pertinent to this exactly, you might want to check my 10/24/2005
blog entry at http://spaces.msn.com/sholliday/)

Ok..back to your issue.

I'm going from memory so bear with me.

The viewer is a generic viewer,,which accepts a MyCrystalReport object,
correct?

MainViewer.Report = new MyCrystalReport1();

OR

MyCrystalReport.Report = new MyCrystalReport2();

....

Crystal may be doing some mojo on the backend you don't know about ... which
is what seems to be happening.

Its almost saying "only 1 report at a time", which stinks.

Can you create a fresh instantation of the VIEWER on the page_load of each
report page?
Aka, I don't know how your drag a viewer onto a webpage...but perhaps you
need to go to a more "code" route.


Page_Load
{

CRViewer crv1 = new CRViewer();
this.Page.Controls.Add (crv);//something like that, i haven't done that in a
while

}

That code won't work of course, but Im suggesting dynmaically adding the
crystal report viewer to the page..instead of the old "drag and drop"
routine.


Its just a suggestion.....I have no idea if it'll work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top