-1

我需要在日期之间过滤的水晶报告中创建一个报告..从一个网页我必须能够选择两个日期“从”、“到”,然后生成一个报告,在这些日期之间从数据库向我发送数据。

4

2 回答 2

1

导入 CrystalDecisions.Shared 导入 CrystalDecisions.CrystalReports.Engine

将 crTableLogonInfos 调暗为新 TableLogOnInfos 将 crTableLogonInfo 调暗为新 TableLogOnInfo 将 crConnectionInfo 调暗为新 ConnectionInfo

Dim crTables As Tables
Dim crTable As Table

Dim crReport As CrystalDecisions.CrystalReports.Engine.ReportClass

Dim crReportDocuments As New YourReport(水晶报表) crReportDocuments.SetParameterValue("@Parameter", Parametervalue) .. ..

With crConnectionInfo ''(连接信息) .ServerName = ServerName .DatabaseName = DataBaseName If Uid <> "" Then .UserID = Uid .Password = pwd Else .IntegratedSecurity = True End If End With

        crTables = crReport.Database.Tables

        For Each crTable In crTables
            crTableLogonInfo = crTable.LogOnInfo
            crTableLogonInfo.ConnectionInfo = crConnectionInfo
            crTable.ApplyLogOnInfo(crTableLogonInfo)
        Next

        cry.ReportSource = crReportDocuments
于 2013-01-23T12:02:26.773 回答
0

首先,将开始日期和结束日期参数添加到报告中。然后在“选择专家”中,将其设置为让您的日期字段位于{@Start Date}{@End Date}参数之间。

您可能希望查看此内容以帮助在 .NET 和 Crystal 之间传递参数: Parameter to Crystal Report

于 2012-12-07T22:57:34.047 回答