简体   繁体   中英

Crystal Report - Set Selection Formula

When I pass a report to a CrystalReportViewer, I can pass a selection formula:

dim viewer as new CrystalReportViewer

viewer.ReportSource = rpt
viewer.SelectionFormula = <some query string>

In some cases, I do not wish to display the report, instead i want to export directly to PDF file:

Dim file As Stream = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

How do you pass the SelectionFormula in this instance?

For reference, i get the following error at the moment:

ParameterFieldCurrentValueException was caught

Missing parameter values.

好的,所以我自己回答了这个,解决方法是:

rpt.RecordSelectionFormula = <some query string>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM