Crystal Report page count increases by an increment of the number of pages across debugs?

I am using Crystal Reports in Visual Studio 2005.  I am loading my data via datasets.  I have a 3 page report.  The issue is that every time I open my report in a report viewer, the page count goes up by those 3 pages.  Those 3 added pages are duplicates of the first 3.  When I say open the report, I even mean across debugs.  So even after I close the application and re-run it, I have 3 more pages.  My crystal report is embedded into the application.  The report must be storing the report's state and just appending to it each time.  Is there some sort of way to clear the report?  I tried to load it manually, reset it manually, and I also tried closing the report manualy upon exit via the report's member functions.

  So my page count is now up to 321.  The next time I open it, my page count will be 324 and the 3 added pages will be the same as the first 3.

Any Suggestings?
bb3177Asked:
Who is Participating?
 
bb3177Author Commented:
SOLUTION:

  My database has multiple tables.  All but one use a "ReportID" as a primary key.  The one that does not have a primary key is because I only need one row on that table which will constantly change.  The goal was to shove a dynamic image into that table and display it on my report.  This means that it was not related to the other tables in any way, meaning I did not need to link them with a primary key.

  It turns out that it was this unrelated data that was causing the report to flip out.  It makes no sense how data from an unrelated table can cause some sort of cacheing issue across debug sessions.

  The way that I fixed this was to go in and add a primary key to this table which links it to the other tables.  The downfall is that instead of replacing the images on one row, the rows will now accumulate and bloat my database.  To get around this, I stuff the images in the row with the same ReportID as the current report that I am working on.  I then show those images on the report.  When I leave the report viewer, I go in and set the image fields to null.  Now I still have a row for each ReportID but it is not bloated with images that I do not need.

  There may be a better work around, but this was how I managed to do it.
0
 
OutinCommented:
First let me say I have no knowledge whatsoever of programming Crystal Reports in Visual Studio 2005 :-)

- Are you sure the problem is in the report, and not in the datasets? E.g. your datasets do not contain more records every time you run the app?
- What about recordcount of your report, does that one increase too? You could put special field 'recordnumber' on your report if you can't find an other way to check that.

--
Outin
0
 
bb3177Author Commented:
Well... I do have many records in my dataset.  I choose the record that I want by passing in a number which is the primary key of the record that I want.  I then set my selection expert to select my record based on that number.  Because of this, the number of records in the dataset should be irrelevant right?

Just to be thourough, the recordset is exactly the same every time.
0
 
OutinCommented:
So I guess the problem is not in the dataset then...
Have you tried adding the recordnumber to the report?
When you add the special field 'record selection formula' to the report, does that one show you what you'd expect?

If the above doesn't lead you to a solution, I'll try to get the attention of some of the other experts...

--
Outin
0
 
OutinCommented:
bb3177 solved the problem himself.
No objection to PAQ/Refund

--
Outin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.