Tuesday, March 20, 2012

Crystal Reports - Refresh Problems

Using VB6. New to Crystal. Our app opens a report and shows it. When
we change the underlying database, every time the report is viewed,
even if no fields that affect the report are changed, report was not
opening at all. im calling report from my VB application with few
parameters.

When im opening the report manually from Report Designer (8.5 Dev
edition) and using the option VERIFY DATABASE, its showing the message
("The database is now up to date"). and report working properly and
update info is ther in reports.

How can I get Crystal to just do it automatically? How can I do it in
code so end users see their reports despite changes in the database?

(i'm using VB 6.0, Ms Access 2000 and Crystal Report 8.5 Dev edition)Hi Sekhars

try this out
1. set the database property at form load event.
CrystalReport1.Database(0)="C:\mydb.mdb"
CrystalReport1.ReportFilename="c:\Report.rpt"

2, On the button_Click event
CrystalReport.Action=1

Try this out if it works rate me|||Hi Fundooo,

I'm using crystal report control to call my report created seperatly in report designer. im calling my report from vb application.

in your reply you suggested to use as below

crystalreport1.database(0) = "c:\mydb\test.mdb"
crystalreport1.reportfilename = "C:\myrept\test.rpt"

but im not able get DATABASE method, crystalreport1.database not working with me..... saying "AUTOMATION FAILED/ NOT SUPPORTED" -

still im fighting with this problem.....

regards
Sekhar|||do you know how to declare and instantiate a report object in VB??
eg in general declarations at top of form code area:
Dim objPrintApp As CRAXDRT.Application
Dim objReport As CRAXDRT.Report

and then, in a sub or function:
Set objPrintApp = New CRAXDRT.Application
Set objReport = objPrintApp.OpenReport(strReportSourcePath & strSourceFile)

If you're getting an automation error, you probably haven't done your declare and instantiation properly.

dave|||This is my Code
-------

Rem Reference to Crystal Report Object.
Rem DDReport = Crystal Report Object Name
Rem All required properties are set to DDReport object.

Private sub CmdPrt_Click()

On Error GoTo errhand

DDReport.ReportFileName = "c:\Reports\DDRpt.rpt"
DDReport.PrintReport
DDFavList = False
Unload Me
Exit Sub
errhand:
DDFavList = False
MsgBox Err.Description, vbInformation, "Error"
Exit Sub
end sub

No comments:

Post a Comment