惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
T
Tor Project blog
T
Threat Research - Cisco Blogs
Microsoft Azure Blog
Microsoft Azure Blog
M
MIT News - Artificial intelligence
V
Vulnerabilities – Threatpost
Project Zero
Project Zero
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Register - Security
The Register - Security
Latest news
Latest news
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Hacker News
The Hacker News
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
T
Tenable Blog
H
Hacker News: Front Page
B
Blog
宝玉的分享
宝玉的分享
C
Check Point Blog
美团技术团队
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
G
GRAHAM CLULEY
Google Online Security Blog
Google Online Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
GbyAI
GbyAI
酷 壳 – CoolShell
酷 壳 – CoolShell
Hugging Face - Blog
Hugging Face - Blog
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Scott Helme
Scott Helme
L
Lohrmann on Cybersecurity
量子位
A
About on SuperTechFans
V2EX - 技术
V2EX - 技术
T
The Exploit Database - CXSecurity.com

博客园 - loway

必须掌握的八个DOS命令 [转] asp免费源代码 ASP 中 Split 函数的实例 - loway ASP:Recordset对象方法 ASP错误编码大全 实用网页代码 - loway - 博客园 ASP各种存储过程使用指南 - loway - 博客园 翻页的存储过程 纯ASP上传图像文件到数据库的最佳例子 - loway - 博客园 禁止右键、选择、粘贴、shift、ctrl、alt..... - loway - 博客园 弹出式说明窗口---JavaScript的使用 asp之fso操作大全代码奉送 JS的正则表达式 在ASP中轻松实现记录集分页显示 ASP开发中存储过程应用全接触 数据库设计 正则表达式语法 经典水晶报表设计——国际销售合同! .NET环境下水晶报表使用总结
水晶报表参数编程示例代码
loway · 2006-03-04 · via 博客园 - loway

水晶报表参数编程示例代码
Imports CrystalDecisions.Shared
    Imports CrystalDecisions.CrystalReports.Engine

    Private Const RPT_NAME As String = "CustomerOrders.rpt"
    Private Const PARAMETER_FIELD_NAME As String = "CustomerID"

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码

        ' 设置报表源
        report = New ReportDocument()
        report.Load(GetReportPath(RPT_NAME))

        ' 设置参数
        crvOrders.ParameterFieldInfo = GetParameterInfo(CType(Session("list"), ListItemCollection))

        crvOrders.ReportSource = report

        ' 显示报表
        crvOrders.DataBind()

    End Sub
   
    '----------------------------------------------------------------
    ' Function GetParameterInfo:
    '   从复选框列表获取参数字段信息
    ' Returns:
    '   参数字段
    ' Parameters:
    '   [in]  list: 复选框列表
    ' Throws:
    '  
    ' PreConditions:
    '  
    '----------------------------------------------------------------
    Private Function GetParameterInfo(ByVal list As ListItemCollection) As ParameterFields

        Dim item As ListItem
        Dim isEmpty As Boolean = True
        Dim itemCount As Integer = 0

        ' 声明将参数传递给查看器控件所需的变量。
        Dim paramFields As New ParameterFields()
        Dim paramField As New ParameterField()
        Dim discreteVal As New ParameterDiscreteValue()

        ' 参数是具有多个值的离散参数。

        ' 设置参数字段的名称,它必须和报表中的参数相符。
        paramField.ParameterFieldName = PARAMETER_FIELD_NAME

        For Each item In list
            If item.Selected Then
                isEmpty = False
                itemCount += 1

                ' 设置一个离散值并将其传递给该参数
                discreteVal.Value = item.Value
                paramField.CurrentValues.Add(discreteVal)
                ' 新建一个离散值
                discreteVal = New ParameterDiscreteValue()
            End If
        Next

        If isEmpty Then
            For Each item In list
                ' 设置一个离散值并将其传递给该参数
                discreteVal.Value = item.Value
                paramField.CurrentValues.Add(discreteVal)
                ' 新建一个离散值
                discreteVal = New ParameterDiscreteValue()
            Next
        End If

        ' 将该参数添加到参数字段集合。
        paramFields.Add(paramField)
        GetParameterInfo = paramFields

    End Function