Passing parameters to Crystal reports

D

Dan Aldean

Hi,

To create a Crystal Reports I use a ReportViewer.
How can I pass parameters to the report which is based on a stored
procedure.
Please provide some code.

Thanks
 
S

sloan

I would recommend using the "Push" model instead.

Create a strong dataset.
Build the report based on the dataset or xsd schema.
populate an instance of the dataset.
Use the SetDataSource method.

Google
"Crystal Reports" push pull
for more info.
 
D

Dan Aldean

Thank you for the reply.

How can I bind the report to the dataset, thru the datasource or viewer
object?

Thanks
 
C

Cor Ligthert [MVP]

Dan,

Very simple as you know it. (only the essential part for which I have too
searched very long)

foreach (CrystalDecisions.CrystalReports.Engine.Table table in
TheDoc.Database.Tables)
{
table.Location = "TheDataBase.TheStoredProcedure;1";
}

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top