?
Solved

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

Posted on 2007-07-30
7
Medium Priority
?
487 Views
Last Modified: 2013-11-26
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?
0
Comment
Question by:bb3177
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:Outin
ID: 19598261
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
 

Author Comment

by:bb3177
ID: 19600106
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
 
LVL 9

Expert Comment

by:Outin
ID: 19600293
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
 

Accepted Solution

by:
bb3177 earned 0 total points
ID: 19601039
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
 
LVL 9

Expert Comment

by:Outin
ID: 19606662
bb3177 solved the problem himself.
No objection to PAQ/Refund

--
Outin
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
How to increase the row limit in Jasper Server.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question