|
-
Oct 1st, 2001, 10:38 AM
#1
Thread Starter
Fanatic Member
Crystal Reports Preview in VB
Hi,
I am using the following code to set the Data Source for a crystal report to a disconnected recordSet created in VB. This works perfectly when printing the report, but is there a way to get a preview window of the report? Thanks for any ideas.
VB Code:
Private Sub cmdReport_Click()
Dim CRXApplication As New CRAXDRT.Application
Dim CRXReport As CRAXDRT.Report
Set CRXReport = CRXApplication.OpenReport(App.Path & "\retention.rpt", 1)
Dim CRXDatabase As CRAXDRT.Database
Set CRXDatabase = CRXReport.Database
CRXDatabase.SetDataSource RS, 3, 1
CRXReport.PrintOut
End Sub
-
Oct 1st, 2001, 10:45 AM
#2
Addicted Member
Do you have the "Crystal Report Smart Viewer" added to your project? Once you add that component to it's own form, you can show the user a preview....
Look in your list of Components AND REFERENCES. Add and and experiment with it a bit....should be pretty easy if you're familiar with CR.
Hopefully that answered you question....
If you can think it....you can code it....
-
Oct 1st, 2001, 10:53 AM
#3
Thread Starter
Fanatic Member
Thanks Sibby. I guess the biggest problem is that I am just learning Crystal Reports on my own. If I create an access table in VB and point the Crystal report to the database, I can use the CRViewer control to get a preview.
But, I was trying to find a way that I could create a disconnected ADO recordset in VB instead of needing to build the access table.
Should I be able to pass a recordSet that is built on the fly to the CRViewer?
Thanks.
-
Oct 1st, 2001, 11:11 AM
#4
Addicted Member
<inhale through teeth> oooooo, don't know if that's possible. I have used CR in a few projects, but by no means am an expert. Have you searched the forums thoroughly on this? I would think you COULD do what you're describing...but at the same time CR are really touchy, and pretty lame at sometimes on it's limitations. Hopefully a CR guru will step forward and take the reins on this one......sorry jbart....
If you can think it....you can code it....
-
Oct 1st, 2001, 11:22 AM
#5
Inserting on line should do it for you. Try:
CrystalReport1.Destination = crptToWindow
Change CrystalReport1 to the name you have for your Crystal Report control.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|