Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create report used by CR

Status
Not open for further replies.

yxbleaf

MIS
Oct 4, 2001
2
SG
I said say " ...can't pass a recordset to a report, unless it was created based on a recordset. Usually that means using the Active Driver to create the report. "

I create a SP ,and make it return a recordset by
a temp table .(use "select * from #temptable")
the temptable's column is dynamic .Then the recordset col
is dynamic, how to create create report base on
the dynamic recordset.
from you said ,Is that mean I can not create that report
use by CR?
(my CR ver is 8.5)

Thank you
 
Each time the report is given a recordset it would need to find the same number of columns, with the same data types, the same column names, and in the same order,

However, you can put whatever data you want into the columns. With SQL you can rename the columns to match what CR is expecting, as long as what the report sees looks the same.

What is it that changes each time? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
That table base on the user's selection .It has dynamic
Column.I write a Stored Procedure to generate the table.
and use "select * from #temp_table" return the
data to a recordset.

Dim adoRS As ADODB.Recordset
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = g_cn
cmd.CommandText = "sp_transform_table"
cmd.CommandType = adCmdStoredProc
cmd.Parameters("@Prod_no") = "01111"
Set adoRS = cmd.Execute


But I can not make the recordset to a report ,Even if
I use the
" Report.Database.AddADOCommand AdoRs.ActiveConnection, AdoRs.ActiveCommand"
System prompt a error.
But if the recordset is not come from a Stored Procedure,
is is come from a SQL "select * from tablename "
eveything is ok.
It puzzles me.

very thanks for your help.




 
I am sorry, I didn't follow all of that.
However, if you are using Select *.... and the columns are completely different each time, then you are going to have problems passing your recordset to the report. The report expects the same columns that it was designed against, especially data types.

You seem to be saying that it works if you don't use a stored procedure. That shouldn't matter to CR, since CR doesn't know where the recordset originates. The error might not be a CR error. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top