|
-
Oct 6th, 2003, 10:09 AM
#1
Thread Starter
Fanatic Member
record sets
Does anybody now how to create a report using a record set instead of a database.
-
Oct 6th, 2003, 12:45 PM
#2
Lively Member
Are you using Crystal Reports? If so, you can use a data definition file (.ttx). Once you define the data structure, you can use vb code to pass a recordset to the report and display it. If you are using Crystal Reports, let me know, and i'll give you some more specifics.
-
Oct 6th, 2003, 12:49 PM
#3
Thread Starter
Fanatic Member
Yes, i'm using Crystal Reports.
-
Oct 6th, 2003, 02:08 PM
#4
Lively Member
Im just going by memory here so my details may not be exact.
In crystal reports, if you hit Add Database... choose Other Data Sources, Active Data Sources, Definitions Only - No Data (I believe that is right). This will allow you to create a ttx file to define your recordset.
Once you have defined your structure...
Before your CrystalReports1.PrintReport or CrystalReports1.ACTION = 1, do a
CrystalReports1.SetPrivateTable 1, rsYourRecordSet, 3
The 1 is telling the report that the recordset you are passing it is for the 1st defined database in the report. I don't remember what the 3 does, but anytime I have done this, it has been a 3.
So basically your code would be something like this...
Dim RS as adodb.recordset
set RS = new adodb.recordset
rs.open "SELECT * FROM tblTABLE", objConnection
crystalreports1.setprivatetable 1, RS, 3
crystalreports1.printreport
I don't have CR on this computer, so I can't check that, but it should give you enough to work with.
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
|