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 April 19th, 2004, 08:10 AM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default stored procedure urgent help required

dear all,
i am using crystal reports for vs.net 2002, infact i want to set my report datasource as dataset. i am using AddCommand to reterive required fields. problem is that when i set report data source as dataset it shows all those reocrds on report that are retrived by AddCommand not by my
here is my code

private DataSet myDs()
{
 SqlConnection nwindConn = new SqlConnection("DataSource=localhost;Integrated Security=SSPI;Initial Catalog=testDB");
 SqlCommand selectCMD = new SqlCommand("testPorcedure",nwindConn);
 selectCMD.CommandType = CommandType.StoredProcedure;
 selectCMD.CommandTimeout = 30;
 SqlDataAdapter custDA = new SqlDataAdapter();
 custDA.SelectCommand = selectCMD;
 nwindConn.Open();
 custDA.Fill(custDS);
 nwindConn.Close();
 return custDS;
}

override protected void OnInit(EventArgs e)
{
 InitializeComponent();
 base.OnInit(e);
 this.ConnectionString();
 CrystalReport1 oReport = new CrystalReport1();
 oReport.SetDataSource(this.myDs());//dataset that is filled by my sp
 crTableLogonInfos = new TableLogOnInfos();
 crTableLogonInfo = new TableLogOnInfo();
 crConnectionInfo = new ConnectionInfo();
 crConnectionInfo.ServerName = server;
 crConnectionInfo.DatabaseName = database;
 crConnectionInfo.UserID = user_id;
 crConnectionInfo.Password = password;
 crTableLogonInfo.ConnectionInfo = crConnectionInfo;
 crTableLogonInfo.TableName = "Command";
 crTableLogonInfos.Add(crTableLogonInfo);
 CrystalReportViewer1.LogOnInfo = crTableLogonInfos;

 CrystalReportViewer1.ReportSource = oReport;
 CrystalReportViewer1.DataBind();
}
any body kindly help me i realy stuck
thanks in advance





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: Oralce Stored Procedure ramuis78 ASP.NET 2.0 Basics 6 September 18th, 2007 10:06 AM
required urgent help deb_kareng C# 1 September 5th, 2006 08:49 AM
Urgent help required! mani84 ADO.NET 1 May 19th, 2006 02:34 AM
Urgent help required AMP - Max Current BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 December 20th, 2004 11:26 PM
urgent reply required ham General .NET 36 August 30th, 2004 02:58 AM





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