报告查看器钻取 [英] Report viewer drillthrough

查看:67
本文介绍了报告查看器钻取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好......我正在使用报告查看器钻取事件我通过文本框搜索显示第一个报告数据并在该记录上应用钻取。点击第一个报告列我得到了第二个报告但我又要去第一个
报告它显示第二个报告,其中包含空值,而我想再次显示第一个报告。如果有人可以帮助我......请立即请...

Hello everyone...I am using report viewer drillthrough event I am displaying first report data through text box search and applying drillthrough on that record.on clicking first report column I am getting second report but again I want to go to first report it displays second report with null values rather I want to display first report again.how this can be achived can anybody help me....immediately please

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SEARCH_Button1.Click
        con.ConnectionString = "Data Source=ADMIN-PC\SQLEXPRESS;Initial Catalog=ADMIN;Integrated Security=True"
        con.Open()
        Dim cmd As SqlCommand = New SqlCommand("select * from Table_3 where name='" + TextBox1.Text + "'", con)
        Dim reader As SqlDataReader = cmd.ExecuteReader
        Dim dt As New DataTable
        dt.Load(reader)
        ReportViewer1.LocalReport.DataSources.Item(0).Value = dt
        ReportViewer1.RefreshReport()
        con.Close()
    End Sub

    Private Sub ReportViewer1_Drillthrough(ByVal sender As Object, ByVal e As Microsoft.Reporting.WinForms.DrillthroughEventArgs) Handles ReportViewer1.Drillthrough
        Dim drillvalues As ReportParameterInfoCollection = e.Report.GetParameters
        For Each d As ReportParameterInfo In drillvalues
            TextBox2.Text = d.Values(0).ToString
        Next
        Dim local As LocalReport = e.Report
        con.Open()
        Dim cmd As New SqlCommand
        cmd.Connection = con
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "namewise"
        cmd.Parameters.Add("@name", SqlDbType.VarChar)
        cmd.Parameters("@name").Value = TextBox2.Text
        Dim adapter1 As SqlDataAdapter = New SqlDataAdapter(cmd)
        adapter1.Fill(Me.ADMINDataSet.Table_4)
        Dim source As ReportDataSource = New ReportDataSource("DataSet1", Table_4BindingSource)
        local.DataSources.Clear()
        local.DataSources.Add(source)
        local.Refresh()
        con.Close()
    End Sub




推荐答案

报告查看器应该给你一个按钮,在drilthrough报告上自动回到父级,如下所示

The reportviewer should give you a button, back to parent automatically on a drilthrough report, as you see below


这篇关于报告查看器钻取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆