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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data missing after refreshing

Status
Not open for further replies.

SUSANNE

Programmer
May 30, 2001
15
DE
I designed a very complex report. It includes about 20 subreports and lots of formulas.
My Problem:
The report shows all the data exactly. When I click on the refresh-button, sometimes - depends on which page I'm at - data from a subreport is missing! When I go to another page an click the refresh button again a go back to the page where data was missing, data is there again... Is it a bug?

Please help!
 
I have only seen this type of behavior in reports that have saved data. What version of CR are you using? Does this ever happen if you refresh on page one and then page through the report? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I nearly solved the problem now, I suppose.
This report is based on only one table in the database, which is a table that logs each action of a user. In that report I want to show every action a user has made, like

SCHMIDT
Monday, 01.01.2002
12:03:50
The risk "x" has been renamed to 'y'.
12:03:51
The description of risk "x" has been changed from "ccc" to "aaa".
........

Therefore I have to walk through each recordset of that table. In a formula of the mainreport I store the ID and give it to other formulas in the subreports. I placed this ID-formula into the groupheader (date) of the mainreport.
I now put it into each group-footer (there are the subreports). -> it works!
But I now supressed all the ID-formulas in the groupfooters and now it doesn't work! When I refresh the data on a certain page, he sets the ID wrong...and that's why data is missing.
I use SCR 8.0
 
I am not sure what you are experiencing. I have trouble following your explanation. First, make sure any formula that uses variables starts with the following first line:

WhilePrintingRecords;

Are you sure that you need to use subreports?
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
The problem is the database. As I told you, the table logs each action a user makes in our programm. The table looks like this:

ID DATETIME USER TABLE_NAME Rec_Id ENTITY VALUE
5 date MEIER Risk 1 Risk Crash
6 date SMITH Measure 3 Measure mmmmm
7 date SMITH Measure 3 Descrip xxhfheeiie
8 date MEIER Risk 1 Risk Crash of...
and so on.

The report should be grouped by USER and DATE. Now I iterate through the table. The problem, why I use or need subreports is because I want to show the value before and after editing. In this case:

MEIER
date
A new risk was created, name 'Crash'
date+x
The risk 'Crah' was renamed, new name: 'Crash of...'

SMITH
date+x
.........

As you see, I have to check, whether the Risk with Rec_Id=1 in recordset with ID 5 exists before. also: is there a recordset with TABLE_NAME=&quot;Risk&quot;, ENTITy=&quot;Risk&quot;, Rec_Id=1 and ID<5.
If not, it was created. If yes, it just was renamed or maybe deleted. In this case I want to know, how the risk was named before and what changes have been made now. Therefore I created a subreport, which chooses only recordsets where TABLE_NAME=&quot;Risk&quot; and ENTITy=&quot;Risk&quot;, sorting them by Rec_Id and Id.

Is there maybe another possibility to get the data instead of using subreports?
I tried it, to put whileprintingrecords in each formula, but when I suppress the ID-formula, data is missing!

Thank you very much.

 
Rule number 1: any formula that uses a shared variable should start with WhilePrintingRecords. That is not something you 'try' but is what you do before you start troubleshooting.

Now, you say that &quot;when I suppress the ID-formula, data is missing&quot;.

Are you suppressing the formula object, or the section? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top