选择要在报告中使用的数据

选择要在报告中使用的数据

本文介绍了选择要在报告中使用的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了以下代码以使用visual basic打开报告,但我想要做的是选择一系列日期,我想将其用作报告的样本。我尝试了一个选择语句,并尝试将其输入到报告中但得到了数据集错误。



如果有人帮我解决这个问题会很棒!



I wrote the following code to open a report using visual basic, however what I would like to do is select a range of dates in which I want to use as the sample for the report. I tried a select statement and tried feeding that into the report but got a dataset error.

If anyone would help me out that would be great!

Dim reportDataSource As New ReportDataSource
Try
    With Me.ReportViewer1.LocalReport
        .ReportPath = "C:\CallReport.rdlc"
        .DataSources.Clear()
    End With
    Dim ds As New OCTCADataSet
    Dim da As New OCTCADataSetTableAdapters.CallDataTableAdapter
    da.Fill(ds.CallData)

    reportDataSource = New ReportDataSource("DataSet1", ds.Tables("CallData"))
    Me.ReportViewer1.LocalReport.DataSources.Add(reportDataSource)
    Me.ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.Normal)
Catch ex As Exception
    MsgBox("Could not compile and open that report.")
End Try

推荐答案


这篇关于选择要在报告中使用的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 16:37