Passing recordset to Crystal report thru TTX file
Hello everybody
I am trying to pass a recordset to Crystal report using a TTX file. The recordset is created by executing Stored procedure. I created the TTX file from the recordset, using the Active Driver Function CreateFieldDefFile(). but when i run the code the report does not get populated with the records. I am SQL Server2000 as the database. What am I doing wrong here? Please advise.
Thanks in advance
Dim CrAppl As New CRPEAuto.Application
Dim CrRep As CRPEAuto.Report
Dim CrDB As CRPEAuto.Database
Dim CrTables As CRPEAuto.DatabaseTables
Dim CrTable As CRPEAuto.DatabaseTable
Private Sub UserForm_Activate()
Dim oRSRate As New ADODB.Recordset
Dim oCmd As New ADODB.Command
Dim oParam As New ADODB.Parameter
Dim oConn As New ADODB.Connection
Dim sStr As String
oConn.Open sConn
Set oCmd.ActiveConnection = oConn
oCmd.CommandText = "sp_get_total_qty_rate"
oCmd.CommandType = adCmdStoredProc
Set oParam = oCmd.CreateParameter("customerid", adChar, adParamInput, 15, "AI")
oCmd.Parameters.Append oParam
Set oParam = oCmd.CreateParameter("datefrom", adDate, adParamInput, , "2003/01/01")
oCmd.Parameters.Append oParam
Set oParam = oCmd.CreateParameter("dateto", adDate, adParamInput, , "2003/01/20")
oCmd.Parameters.Append oParam
'open the ADO recordset
oRSRate.Open oCmd, , adOpenDynamic, adLockBatchOptimistic
'open the report
Set CrRep = CrAppl.OpenReport("D:\Report1.rpt")
'set the database object to the reports database
Set CrDB = CrRep.Database
'set the databaseTables object
Set CrTables = CrDB.Tables
'set the databaseTable object to the first table in the report
Set CrTable = CrTables.Item(1)
'sets our ADO recordset as the data for the first table
CrTable.SetPrivateData 3, oRSRate
'Preview the report with the ADO recordset as the data
CrRep.Preview
oRSRate.Close
End Sub
CR 7.0- ADO- 'Unable to access first record!' error
Using CR 7.0.0.0, CRW32 7.0.1.192.
Trying to run a report that is based on ADO (driver pdsmon.dll).
If there are no records in the query set that is used by the report, I receive the error 'Unable to access first record!' followed by 'SQL Server error'. I searched and saw that some others had received this error, but I think their situations were different.
Anyway, this report is based on a query, not a stored proc. It is run against either SQL Server or MSAccess. Any ideas on how to get around this error; i.e. just display the report with no records.
1 Attachment(s)
Crystal Report information
Hello !
I know just a little bit about Crystal Report. I am a VB developper and I am lokking for a report engine. I know that Crystal Report is a good one but I have certain specification I want from a report engine.
I want a report engine having a lot of kind of pagination. For example, 2 pages by sheet... I will explain me...
If you want to print a book with 2 pages by sheet and recto-back, so on one sheet, I will have 4 pages (2 on recto, 2 on back). The problem is if I have document of 8 pages, I will need 2 sheet. I will show you with a picture (see below).
So, my question is: Do you know if Crystal Report can build that kind of report (with this pagination). If no, do you know another report engine that can do this.
Thank you very much ! :)
Patrick.
Email notification on success/fail scheduled reports for CE8.0
Hi all,
Does anyone know how to enable the CE8.0 to sent out email notification on the success or failure of a particular report that has been scheduled?
Our aim is to write a CSP that pass the parameters to the CE8.0 to enable this.
We hope to do this without having to upgrade to CE8.5. Has anybody done this? Please share with us. Many thanks.
best regards
Tony
How to write a csp/VB for CE8.0 to export to diff file format?
Hi everybody,
Another question on CE8.0.... Is there a place where sample code can be found for writing a CSP to export scheduled rpts to diff file formats??
Can I assume that the following is relevant...
cr.Destination
cr.PrintFileName
cr.PrintFileType
If so where can I find the syntax for using them? Many thanks.
best regards
Tony
How to schedule a rpt for a specific weekday repeatably?
Hi,
Does anyone know how to trigger the CE8.0 to ran repeatably for a particular weekday? e.g. rpt to be generated on every monday...
we interested to know the methods avaiable to a CSP for the above...
Thanks in advance.
regards
Tony.
crystal report - changing the sql query text
This is not a reply but a new thread directly to Shri K Babu.
Hi,
I am using VB6 and Crystal report for my application. While designing the report using report expert, I have used ADO with Jet 3.51 and for data I have an sql statement linking three tables from my Access database.
After designing the report, I am not able to modify the sql statement, if i want to add any more fields from the tables. When i try to modify the sql statement using verify command, i get an error message. As a result, if I want to modify my report adding some additional fields, I have to redo the entire design.
I am using CR8.
Can you help me where I am going wrong ???
thanx
Re: crystal report - changing the sql query text
Don't change the sql select fields in cr, instead of this you can create query at access database whatever you need select fields names.
Then use the query from your access database to cr as a table.
Quote:
Originally posted by jojys
This is not a reply but a new thread directly to Shri K Babu.
Hi,
I am using VB6 and Crystal report for my application. While designing the report using report expert, I have used ADO with Jet 3.51 and for data I have an sql statement linking three tables from my Access database.
After designing the report, I am not able to modify the sql statement, if i want to add any more fields from the tables. When i try to modify the sql statement using verify command, i get an error message. As a result, if I want to modify my report adding some additional fields, I have to redo the entire design.
I am using CR8.
Can you help me where I am going wrong ???
thanx