Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > BOOK: Professional Crystal Reports for VS.NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old October 29th, 2007, 11:51 PM
Registered User
 
Join Date: Apr 2007
Location: New Delhi, Delhi, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to shashikantray
Default

http://www.dotnetspider.com/kb/Article3477.aspx
Reply With Quote
  #12 (permalink)  
Old October 29th, 2007, 11:53 PM
Registered User
 
Join Date: Apr 2007
Location: New Delhi, Delhi, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to shashikantray
Default

using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
   SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["aaa"]);
   Class1 dbc = new Class1();

   protected void Page_Load(object sender, EventArgs e)
   {
       CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.ServerName = "nic";
       CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.UserID = "sa";
       CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.Password = "sa";
       CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.DatabaseName = "abcde";
        ReportParameter();
   }
   private void ReportParameter()
   {
       CrystalReportViewer1.RefreshReport();
       ParameterFields paramFields = new ParameterFields();
       ParameterField pfItemYr = new ParameterField();
       pfItemYr.ParameterFieldName = "year"; //Crystal Report Parameter name
       ParameterDiscreteValue dcItemYr = new ParameterDiscreteValue();
       dcItemYr.Value = DropDownList1.SelectedValue;
       pfItemYr.CurrentValues.Add(dcItemYr);
       paramFields.Add(pfItemYr);
       CrystalReportViewer1.ParameterFieldInfo = paramFields;
   }
}
 or
http://www.dotnetspider.com/kb/Article3477.aspx
Reply With Quote
  #13 (permalink)  
Old November 19th, 2008, 06:54 AM
hu_yang
Guest
 
Posts: n/a
Default

Check the following link , it will pass the parameter dynamically to the crystal reports.

http://vb.net-informations.com/cryst...meter_date.htm

yang.


Reply With Quote
  #14 (permalink)  
Old April 15th, 2009, 01:34 AM
hu_yang
Guest
 
Posts: n/a
Default C# crystal report parameter

crParameterDiscreteValue.Value = parameterValue;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["paramaterField"];
crParameterValues = crParameterFieldDefinition.CurrentValues;

full source code you can get from here :

http://csharp.net-informations.com/c...-parameter.htm

yang.
Reply With Quote
  #15 (permalink)  
Old April 20th, 2009, 04:18 AM
hu_yang
Guest
 
Posts: n/a
Default C# crystal report parameter

ParameterFieldDefinitions crParameterFieldDefinitions ;
ParameterFieldDefinition crParameterFieldDefinition ;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

crParameterDiscreteValue.Value = paramVal;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["paramField"];
crParameterValues = crParameterFieldDefinition.CurrentValues;

http://csharp.net-informations.com/c...-parameter.htm

yang.
Reply With Quote
  #16 (permalink)  
Old April 25th, 2009, 02:32 AM
Authorized User
Points: 33, Level: 1
Points: 33, Level: 1 Points: 33, Level: 1 Points: 33, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default C# crystal report parameter

crParameterDiscreteValue.Value = value;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["Field"];
crParameterValues = crParameterFieldDefinition.CurrentValues;

http://csharp.net-informations.com/c...-parameter.htm

lee.
Reply With Quote
  #17 (permalink)  
Old November 19th, 2009, 05:26 AM
Registered User
 
Join Date: Apr 2007
Location: Pune, Maharastra, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

report.SetParameterValue(parameterName, parameterValue);
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report Parameter pass from c# shriji.1111 Crystal Reports 4 June 14th, 2011 11:38 AM
pass parameter in crystal report srivigdev C# 3 April 14th, 2008 12:11 PM
How to pass parameter to sub-report . azeerum Access 1 January 3rd, 2005 04:26 PM
How to Pass parameter to chart in crystal Report. simsimlhr C# 3 April 12th, 2004 11:04 AM
Pass parameter to store procedure & Crystal Report quinn Classic ASP Professional 0 March 10th, 2004 02:16 PM



All times are GMT -4. The time now is 03:16 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.