I am new to the crystal report and i am going through some tutorial (link : http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-stepbystep.htm) which explains step by step procedure od the crystal report working. I am doing as exactyly
given in the tutorial but i am not getting the same result in the case of Multiple string method. I am pasting my code behind here, can any one tell me what might be the problem. The only change i have made is instead of stored procedure i am using configured
server database.
Code behind:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
namespace CrstalReportTest
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("C:\\Users\\Public\\Documents\\Visual studio testing\\CrstalReportTest\\CrstalReportTest\\MultipleString.rpt");
ParameterFieldDefinitions crParameterFieldDefinitions ;
ParameterFieldDefinition crParameterFieldDefinition ;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
Thank you. Your link is quite resourcefull, But my problem is that i want to sort dynamically according to the data given in the text box, thats not working. Can you help me on this.
Member
8 Points
57 Posts
Crystal report basic testing conflict
Mar 23, 2012 10:41 PM|Harsha Bhat|LINK
Hi,
I am new to the crystal report and i am going through some tutorial (link : http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-stepbystep.htm) which explains step by step procedure od the crystal report working. I am doing as exactyly given in the tutorial but i am not getting the same result in the case of Multiple string method. I am pasting my code behind here, can any one tell me what might be the problem. The only change i have made is instead of stored procedure i am using configured server database.
Code behind:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
namespace CrstalReportTest
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("C:\\Users\\Public\\Documents\\Visual studio testing\\CrstalReportTest\\CrstalReportTest\\MultipleString.rpt");
ParameterFieldDefinitions crParameterFieldDefinitions ;
ParameterFieldDefinition crParameterFieldDefinition ;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
crParameterDiscreteValue.Value = txtString.Text;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["customername"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
CrystalReportViewer1.ReportSource = cryRpt;
CrystalReportViewer1.RefreshReport();
}
}
}
Star
7768 Points
1794 Posts
Re: Crystal report basic testing conflict
Mar 24, 2012 06:29 AM|amit.jain|LINK
refer crystal reports in asp.net
amiT jaiN
ASP.NET C# VB Articles And Code Examples
Member
8 Points
57 Posts
Re: Crystal report basic testing conflict
Mar 24, 2012 08:38 AM|Harsha Bhat|LINK
Hi amit.jain,
Thank you. Your link is quite resourcefull, But my problem is that i want to sort dynamically according to the data given in the text box, thats not working. Can you help me on this.
Regards
Harsha
Star
7768 Points
1794 Posts
Re: Crystal report basic testing conflict
Mar 25, 2012 08:30 AM|amit.jain|LINK
refer crystal report with parameters
amiT jaiN
ASP.NET C# VB Articles And Code Examples