Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 30th, 2004, 10:00 AM
Authorized User
 
Join Date: Aug 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dataset and Store Procedure in CR

how to create report from multiple table using DATASET AND STORE PROCEDURE at runtime. Any one aware of good example!



 
Old October 7th, 2004, 03:34 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

I didnt get u but u can do it by creating a SP to select desired field(s) from desired table(s) (using join) & then fill ur DataSet & ...

Keep in touch.

Always:),
Hovik Melkomian.
 
Old October 7th, 2004, 10:12 AM
Authorized User
 
Join Date: Aug 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

  Dim rpt As tcotest = New tcotest
        Dim conn As SqlConnection
        Dim cmd As SqlCommand
        Dim param As SqlParameter
        Dim da As New SqlDataAdapter
        Dim ds As New DataSet
Dim connstr As string
connstr="server=sqlserver;uid=sa;pwd=;database=tco "
        conn = New SqlConnection(connstr)
        If conn.State = ConnectionState.Open Then conn.Open()
        Console.Write("Database Opened Succesfully:")
        cmd = New SqlCommand
        cmd.CommandText = "tcosp"
        cmd.Connection = conn
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.Add(New SqlParameter("@ccanbr", SqlDbType.Int))
        cmd.Parameters("@ccanbr").Value = txtccanbr.Text
        da.SelectCommand = cmd
        da.Fill(ds)
        rpt.Database.Tables(0).SetDataSource(ds)
        crv.ReportSource = rpt
        conn.Close()

Now how do I put this fields on the report? How to create reports?







Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Procedure called by CR ndID Crystal Reports 0 January 25th, 2008 02:18 AM
Get data from Store procedure into CR ndID .NET Framework 1.x 0 January 23rd, 2008 03:31 AM
Store Procedure sureshyuga SQL Server 2000 0 May 18th, 2007 01:49 AM
Create report using untyped dataset & CR XI ? vijaykumartaduri BOOK: Professional Crystal Reports for VS.NET 0 October 20th, 2005 10:12 AM
how to pass the data from dataset to CR? zouky Crystal Reports 0 November 8th, 2004 02:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.