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

crystal viewer is not launching

Status
Not open for further replies.

blocktl

Programmer
Jun 18, 2003
14
US
My code is:
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
'Declare a ReportSourceRouter object
Dim MultiReport As New CRVIEWERLibCtl.ReportSourceRouter


' Open the report
Set crxRpt = crxApp.OpenReport(App.Path & "\PrtPicTkt.rpt")

' Clear any saved data to force the report to read from the db
crxRpt.DiscardSavedData

' Set the connection for the report.
crxRpt.Database.Tables(1).SetLogOnInfo "Macola02", "Macola02", "administrator", "odyssey"

Do ' more than one report per run

' Create itemSelect

' Set up selection formula
crxRpt.RecordSelectionFormula = itemSelect
MultiReport.AddReport crxRpt

Loop

'Set the ReportSource of the Crystal Report Smart Viewer to the
'ReportSourceRouter object
CRViewer1.ReportSource = MultiReport
CRViewer1.ViewReport

It seems to be creating the multireport, but the viewer doesn't launch when i ask it to viewreport. Any ideas
 
Did you make a separate form for the viewer? It has to be on a form by itself and then you show the form like you would any other form. Example below:
With frmViewer2
.Show vbModal
.Refresh
End With
Unload frmViewer2

Then on your frmViewer you would have your code:
Private Sub Form_Load()
'Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = frmReports.Report
CRViewer1.ViewReport
End Sub

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

Cathy
 
Thanks Cathy for your input. I think this is a dll problem though. Dave, can you tell me where to get a copy of your dll. THe newest one I can find is 8.5.0.473
 
Cathy, you're a lifesaver. Your code worked perfectly. With your form and Dave's ReportSourceRouter, I finally have what the client wants. Thank you both ever so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top