使用VB.NET和Crystal Reports的两个日期参数 [英] Two Date Parameters using VB.NET and Crystal Reports
本文介绍了使用VB.NET和Crystal Reports的两个日期参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用DateTimePicker作为日期参数,这是我的代码:
I am using DateTimePicker as date parameter and here is my CODE:
Option Strict Off
Option Explicit On
Friend Class frmListofCollection3
Private Sub frmListofCollection3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dtpBegDate.Value = Today
dtpEndDate.Value = Today
End Sub
Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOk.Click
With frmReport1
.strReport = "List of Collections"
.strWhere = "{qry_FSEBtable.DateOfPayment} IN #" & dtpBegDate.Value.Date.ToString("MM/dd/yyyy") & "# TO #" & dtpEndDate.Value.Date.ToString("MM/dd/yyyy") & "#"
frmReport1.ShowDialog()
End With
End Sub
End Class
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data.OleDb
Imports System.Data
Imports VB = Microsoft.VisualBasic
Public Class frmReport1
Public strWhere As String
Public strReport As String
Private mReport As ReportDocument
Private Sub frmReport1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mReport = New ReportDocument()
Dim mParam As New ParameterFields()
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Select Case strReport
Case "List of Collections"
mReport.Load("C:\FSES System\FSES System\Reports\rpt_ListofCollections.rpt")
mParam = mReport.ParameterFields
mReport.RecordSelectionFormula = strWhere
mParam.Item(1).MinimumValue.Add(frmListofCollection3.dtpBegDate.Value)
mParam.Item(2).MaximumValue.Add(frmListofCollection3.dtpEndDate.Value)
Case "Issuance of FSIC"
mReport.Load("C:\FSES System\FSES System\Reports\IssuanceofFSIC.rpt")
mReport.RecordSelectionFormula = strWhere
End Select
For Each tbCurrent In mReport.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "C:\FSES System\FSES System\BFPFSESDatabase.mdb"
.UserID = ""
.Password = "bfpphilippines"
.DatabaseName = "C:\FSES System\FSES System\BFPFSESDatabase.mdb"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
myCrystalReportViewer.ReportSource = mReport
End Sub
End Class
mParam.Item(1).MinimumValue.Add(frmListofCollection3.dtpBegDate.Value)
mParam.Item(2).MaximumValue.Add(frmListofCollection3.dtpEndDate.Value)
这些错误出现并且没有响应。
推荐答案
检查这个
C#Crystal Reports - 迄今为止的日期 [ ^ ]
这篇关于使用VB.NET和Crystal Reports的两个日期参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文