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

When i edit my report i dont see changes

Status
Not open for further replies.

djsuperz

IS-IT--Management
Jan 25, 2004
37
US
When users update our database, in the report viewer it doesnt show changes. I'm using a vb6 and ms sql database with a CRViewer. The database updates but the report doesnt. Another thing i found was. When i text, i can see the changes in my report. The fields that are not updating are formula fields. I can edit all my text fields. I have 50 forumlas, i use them for check boxes. Here is a sample of a formula:
if {Page6cont.edemayes} = TRUE
then "<font face = wingdings> þ"
else "<font face = wingdings> o"

When i refresh data does it refresh my formula fields as well?

and yes i do have save data with report unchecked and crviewer1.refresh in my code
 
Has the data in your database changed, or is it the database structure itself that has changed?

Anytime you change a database field such as renaming it, making it longer, changing the data type, adding or changing fields, etc., refreshing the report is not going to pick up these changes. You need to verify your database in order for crystal to read the changes to your database structure.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
The formula hasnt changed but the data is. What happens is, the user edits an entry, then stores it in the sql server database. Then the user views the report via crviewer. It will only show the old data. I check the database and the new database has been stored. I have save data with report unchecked and added .discardsaveddata and .refresh already to my code. any suggestions?
 
The only thing that is changing is my data. In my database the data is correct. But when i try to view my report via crviewer the data is incorrect. Its the old data. I have unchecked save data with report, added discard saved data and refresh to my code. And it still doesnt show the new data changes. Any suggestions?
 
Have you verified that the report is pointing to the correct database at runtime?

It would also help if we knew what version of Crystal you're using, and what method you're using the access the Crystal Print Engine (OCX, RDC, Automation Server, etc.).

-dave
 
I'm sure its pointing to the correct database because when i edit non-forumula fields the edit fine. I'm running crystal reports 10, visual basic 6 and i view my reports via active x report viewer.
 
when i edit non-forumula fields the edit fine

What does this mean ?

your description is very unclear

If you run the report and leave the viewer open, tnen change some data in the database what happens if you press the refresh button on the viewer,

is the whole report fields and formulas showing the old data ?

does the field data show the new data but the formulas still show the old data ?

if you close the viewer and rerun the report again do you see the new data ?

Is this problem only with the viewer or does it occur in the designer as well.




Gary Parker
MIS Data Analyst
Manchester, England
 
If i run the report and leave the viewer open, tnen change some data in the database and i press refresh the data still stays the same.

does the field data show the new data but the formulas still show the old data ? you are exactly correct

if you close the viewer and rerun the report again do you see the new data ? only in the field data
 
Is this problem only with the viewer or does it occur in the designer as well.

what version of CR are you using ?

post one of the formulas that are not updataing ?

Gary Parker
MIS Data Analyst
Manchester, England
 
Crystal reports 10
Error occurs in both viewer and designer
All 50 of my formulas look like this, and they do not update.

if {Page6cont.edemayes} = TRUE
then "<font face = wingdings> þ"
else "<font face = wingdings> o
 
Was there a specific point when they stopped working, i.e. did something change (upgrade, db modification, etc.)?

-dave
 
Can you send me a copy of the report to take a look at

gary dot parker at k2group dot co dot uk

Gary Parker
MIS Data Analyst
Manchester, England
 
I never could update. Is there a limit on the number formulas used, i have about 50 formulas? I dont think i can send you the report, its about 340 megs, and my upload is really slow.
:-(
 
Try creating a new report containing just one of the formula fields and limited field data and let us know what happens.

I've written reports with more than 50 formulas in the past and they work fine.

Gary Parker
MIS Data Analyst
Manchester, England
 
I've created a few reports before this with the formulas i have and they work fine. Its driving me nuts trying to figure out what i did diffrent. I'm going to first try what you seggested Gary.
 
Ok the designer is showing the data correctly but the activex viewer in my vb6 program isnt. What do you guys suggest?
 
Could i be my code? well here it is:

Dim crRep As CRAXDRT.Report
Dim crApp As New CRAXDRT.Application


Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.EnableExportButton = True
CRViewer1.EnableCloseButton = True
Set crRep = crApp.OpenReport(App.Path & "\oasis.rpt")
crRep.Database.Tables(1).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(2).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(3).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(4).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(5).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(6).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(7).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(8).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(9).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(10).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(11).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(12).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(13).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(14).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(15).ConnectionProperties("Password") = "lalala"
crRep.Database.Tables(16).ConnectionProperties("Password") = "lalala"
crRep.DiscardSavedData
CRViewer1.ReportSource = crRep
crRep.VerifyOnEveryPrint = True
crRep.RecordSelectionFormula = "{trackingsheet.PatientID} = '" & PatId & "'"
CRViewer1.SearchForText PatId
CRViewer1.ViewReport
CRViewer1.Refresh
crRep.PrintOut True, 1, False, 1, 14

Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth

End Sub
 
Most of your code looks fine although I would try it with a few lines removed and see what happens.

crRep.VerifyOnEveryPrint = True - not sure why you would need to do this

CRViewer1.SearchForText PatId - why are you doing a text search before the report has been viewed

CRViewer1.Refresh - this isn't needed if your report has no saved data.

Let me know how you go on

Gary Parker
MIS Data Analyst
Manchester, England
 
I did what you said and it still shows the incorrect data, the old data.
 
If my activex viewer displays the old data, doesnt that mean my viewer has already saved the old data? Is there a way to clear all data before viewing my report? is .discardsavedata the only way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top