Re: I am a noob to CR 9.0...
I design my reports outside the RDC. You can try something like this (I use SQL server SPROC to populate the report with data):
VB Code:
Option Explicit
Dim crxApplication As New CRAXDRT.Application
Dim crxReport As CRAXDRT.Report
Private Sub Form_Load()
Set crxApplication = New CRAXDRT.Application
Set crxReport = crxApplication.OpenReport("C:\MyReport.RPT")
'-THIS IS FOR THE MAIN REPORT
With crxReport.Database.Tables(1).ConnectionProperties
.Item("Provider") = "SQL"
.Item("Data source") = "SRV"
.Item("Initial Catalog") = "NEW"
.Item("User ID") = "USER"
.Item("Password") = "USER"
End With
' crxReport.PrinterSetup (0) '<-- THIS BRINGS UP THE PRINTER DIALOGUE BOX
CRViewer91.ReportSource = crxReport
CRViewer91.ViewReport
End Sub
Private Sub Form_Resize()
With CRViewer91
.Top = 0
.Left = 0
.Width = Me.ScaleWidth
.Height = Me.ScaleHeight
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set crxReport = Nothing
Set crxApplication = Nothing
End Sub
Re: I am a noob to CR 9.0...
Hi there ARPRINCE. Thank you very much for the reply. I am kinda confused by a couple things though :
When you say you 'design your reports outside the RDC', does that mean you design from within CR application itself? I am assuming this is the case, and you use the database connection to build the report in design mode.
Also, I was kinda confused by you saying you were using an SPROC. I dont see the SPROC named anywhere in your example code, or is it just embedded in the report at design time? Or is this line for it -
VB Code:
With crxReport.Database.Tables(1).ConnectionProperties
I am kinda confused on the Tables(1) part.
I am not sure how I would pass parms if that is the case.
Anyways, thanks for the response.
Re: I am a noob to CR 9.0...
Quote:
Originally Posted by ILJester
When you say you 'design your reports outside the RDC', does that mean you design from within CR application itself? I am assuming this is the case, and you use the database connection to build the report in design mode.
YES
Quote:
Originally Posted by ILJester
Also, I was kinda confused by you saying you were using an SPROC. I dont see the SPROC named anywhere in your example code, or is it just embedded in the report at design time?
YES
Try this one...
Quote:
Originally Posted by ILJester
I am not sure how I would pass parms if that is the case.
Once you call the report from within your VB application, the report opens up a parameter pop-up automatically.
Hope this helps.