PDA

Click to See Complete Forum and Search --> : I am a noob to CR 9.0...


ILJester
Jul 7th, 2005, 01:51 PM
Hello everyone,

It has been years since I have used CR. The last version I was on was 8.5 I believe, maybe it was the intrinsic version that came with VB 4 or 5. Its been awhile, lets put it that way.

My company just purchased CR 9.0 for me to use with VB 6.0. Can anyone point me to a place where I can find a simple tutorial of just dragging the CR control onto a form and then run a sql query for a pre-built report.

All the samples that come with it, use the designer? Huh, I am not familiar with this at all. I just want to run some simple reports on the fly with sql queries. It really should not be this diffucult.

Thanks.

ARPRINCE
Jul 7th, 2005, 04:02 PM
I design my reports outside the RDC. You can try something like this (I use SQL server SPROC to populate the report with data):


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

ILJester
Jul 11th, 2005, 09:25 AM
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 - 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.

ARPRINCE
Jul 11th, 2005, 04:11 PM
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
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... (http://www.vbforums.com/showthread.php?p=1921358#post1921358)

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.