Hi
I am using vb.net and crystal report . I want to pass one text (say company name) directly to report (not through any database field)
Could you please tell me how it is possible
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
sanjeet kumarPosted Nov 16, 2006, 6:12 AM
1.In the rpt file create a new Parameter let say :"sample"
2.Drag this field in the detail section where you want to see.
3. Now include the following code aspx file
using
CrystalDecisions.Shared;using
CrystalDecisions.CrystalReports.Engine;using
CrystalDecisions.ReportSource;using
CrystalDecisions.Web;//write these command on Button click event
{
ParamReport param=
new ParamReport();//making the object of rpt fileParameterValues currentParameterValues = new ParameterValues();
ParameterDiscreteValue parameterDiscreteValue =
new ParameterDiscreteValue();parameterDiscreteValue.Value = TextBox1.Text;//
currentParameterValues.Add(parameterDiscreteValue);
ParameterFieldDefinitions parameterFieldDefinitions = param.DataDefinition.ParameterFields;//
ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions["sample"];
//parameter field name
parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
CrystalReportViewer1.ReportSource = param;
}hope this code will help you .