本文介绍了我应该在按钮事件中写些什么以显示两个日期之间的报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何通过一个参数显示记录.但是我应该在按钮事件中写些什么,以按两个参数显示记录?我创建了两个参数&我在公式工作室中将其写成{asst.dt} = {?fdt}和{asst.dt} = {?ldt}.现在我遇到了问题!我的表单中有一个带有两个文本框和一个报表查看器的按钮.在我写下面的代码之前.那我现在应该写什么?请帮帮我.

代码(我用它通过一个参数显示报表,其中表单有一个文本框,一个按钮和一个报表查看器).

I know how to show record by one parameter. But what should I write there in my button event to show record by two parameter? I have created two parameter & I have written it {asst.dt}= {?fdt} and {asst.dt} = {?ldt} there in formula workshop. Now I got a problem! I have a button there in my form with two text boxes with one report viewer. Before I had written following code. So what should I write now? Please help me.

Code(I have used it to show report by one parameter where form had one text box one button & one report viewer).

Code : Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form6
Inherits System.Windows.Forms.Form


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim cryRpt As New ReportDocument
cryRpt.Load(Application.StartupPath \CrystalReport5.rpt")
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()

Dim cryRpt As New ReportDocument
cryRpt.Load(Application.StartupPath \CrystalReport5.rpt")

Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue

crParameterDiscreteValue.Value = TextBox1.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item
crParameterValues = crParameterFieldDefinition.CurrentValues

crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
cryRpt.RecordSelectionFormula = {Button1}= TextBox1.Text
End Sub

推荐答案


这篇关于我应该在按钮事件中写些什么以显示两个日期之间的报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 16:31