English 中文(简体)
如何在晶体报表中将文本框值作为参数?
原标题:How to textbox value as a parameter in crystal report?

如何在 asp. net C# 中将文本框值作为晶体报告参数通过?

I want example which shows steps to passparamter I have tried many examples but no output.. I want as in below link http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-string-parameter.htm But no data is displaying

Pls 帮助

最佳回答

我希望这将有助于:

ReportDocument cryReportDocument = .......;
cryReportDocument.SetDatabaseLogon("userName", "password");
cryReportDocument.SetParameterValue("parameterName", yourTextBoxName.Text);
CrystalReportViewer1.ReportSource = cryReportDocument;    
问题回答

尝试此代码

  ReportDocument reportDocument = new ReportDocument();

    ParameterFields paramFields = new ParameterFields();


    ParameterField paramField = new ParameterField();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
    paramField.Name = "@CustomerName";
    paramDiscreteValue.Value = TextBox1.Text.ToString();
    paramField.CurrentValues.Add(paramDiscreteValue);
    paramFields.Add(paramField);


    CrystalReportViewer1.ParameterFieldInfo = paramFields;
    reportDocument.Load(Server.MapPath("CrystalReport.rpt"));
    CrystalReportViewer1.ReportSource = reportDocument;




相关问题
1099r IRS form instal Report

我们需要从申请中产生1099r份IRS报告,我们已决定用晶报告编写这份报告。 很奇怪的是,任何人都这样做了,如果是,可以......

How to split a Crystal Reports subreport across a page break?

I m using Visual Studio 2005 and writing in VB.NET. I have a subreport in a Crystal Reports report consisting of a list of log entries. Sometimes the list of log entries is long enough that it would ...

Adding Crystal Reports support into LAMP product

We have a newly documented feature request, from sales and support, to integrate Crystal Reports into our LAMP product. (It s more like LAPP, really, with Postgres and PHP.) I have to admit, ...

Crystal Report value Convertion?

i have to crystal report made from Dataset,and we have to one formula field i wrote Add() but that formula field show cancatination like 10+20=1020 i realize they need to convert that field in sight ...

How to Hyperlink to a Business Objects Report in Infoview

Is there a way to craft a hyperlink that connects to a Crystal Report or Webi within Infoview? Ideally, unauthenticated users would be challenged with Infoview security and then redirected to the ...

Crystal Report XI trouble with big XML data file

I have a big xml file (65 Mo) that I need to feed to a Crystal Report XI. My problem is that I tried running the report and it takes forever to display a single page (about 15 minutes a page). I still ...

Transferring Crystal report

I have created a crystal report in VS 2005 using the wizard. In the report I have created an OLE DB connection to a server which has a database student . Now I need to run this report on another ...

热门标签