I have installed Crystal Reports and am using it in Visual Studio 2005.
Can anyone help me as to how i can开发者_如何学Python use SQL Server 2000 to generate reports using Stored Procedures.
Im not sure i have understood the question. if you want SPs to write the RPT file for you then I cant answer.
What i have done for years is use Stored Procedures to do the heavy-lifting for the report. Simply create an sp with parameters. When you create your crystal report and adding data definitions in make sure that stored procedures are included. Then add parameters to the report which are inserted into the SP paramaters at runtime.
Using Views is also a good way to put all the data massaging work back onto the db server instead of the client. Send parameters from crystal to return a filtered dataset back to your report for printing.
Crystal Reports: Tutorials and Sample Code http://msdn.microsoft.com/en-us/library/ms227881%28VS.80%29.aspx
Google search of "Crystal Reports Visual Studio Tutorial" returned that as the top result.
Start by creating a data source type of OLE DB, and choose your SQL Server Native Client. This option will be there for a new report, or if you set the data source; note that if you set a different data source for an existing report, your existing data fields may disappear from the report. Using integrated security is nice because you can control access to the data in the report in SQL Server.
Then in your database expert, click "Add Command", where you can call the shared procedure, add SQL, select your fields, etc.
精彩评论