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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display columns from stored Procedure to rpt

Status
Not open for further replies.

thara123

Programmer
Mar 26, 2008
2
GB
i'm using a stored procedure to display the data on crystal report but since the SP is in a string
@sql='SELECT * FROM '+@tableName+'
i dont get the columns in the database fields under field explorer.
does anyone know a way around this?
 
Where is this string/sql being used?
In a crystal command, on a database view? In a web application?
 
In a web application...
i am really new to crystal reports so i might be missing out on something..so please let me know where i'm going wrong.
what i need is to build a dynamic query and display the details using crystal reports.

So what i did is created my sp 'SP_EXAMPLE1' in my database
@sql='SELECT * FROM '+@tableName+'
exec(@sql)
then in crystal under database expect i added my stored procedure.

option 2
i also tried to do it programmically
so i create a dataset DS with the data
then
mReportDocument.Load(Server.MapPath("Reports/testing.rpt"));
myReportDocument.SetDataSource(DS);
CrystalReportViewer.ReportSource = myReportDocument;
CrystalReportViewer.DataBind();

but still no joy :(

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top