如何使用SQL在报表查看器中添加图像

时间:2018-12-17 07:52:51

标签: vb.net

我正在将VB.Net 2013与SQL Server一起使用

我的代码有什么问题?缺少什么吗?

当我尝试选择位置时,它会在表单中显示名称,位置和图像。
一切看起来都不错,唯一的问题是报表查看器中的图像没有改变。

Imports System.IO
Imports Microsoft.Reporting.WinForms

Public Class Form1

    Private Sub Table_locationBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles Table_locationBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.Table_locationBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.KankonDataSet)

    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'KankonDataSet.Table_location' table. You can move, or remove it, as needed.
        Me.Table_locationTableAdapter.Fill(Me.KankonDataSet.Table_location)

        If NamelocationComboBox.Text = Nothing Then
            NamelocationComboBox.Text = "No thing"
        End If

        If IdlocationTextBox.Text = Nothing Then
            IdlocationTextBox.Text = "No thing"
        End If

        Dim Param1 As New ReportParameter("ReportParameterlocation", NamelocationComboBox.Text)
        ReportViewer1.LocalReport.SetParameters(Param1)
        Dim Param2 As New ReportParameter("ReportParameterwhere", IdlocationTextBox.Text)
        ReportViewer1.LocalReport.SetParameters(Param2)

        Me.ReportViewer1.RefreshReport()
    End Sub

    Private Sub ReportViewer1_Load(sender As Object, e As EventArgs) Handles ReportViewer1.Load
        Me.ReportViewer1.RefreshReport()
    End Sub

    Private Sub NamelocationComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles NamelocationComboBox.SelectedIndexChanged
        Dim Param1 As New ReportParameter("ReportParameterlocation", NamelocationComboBox.Text)
        ReportViewer1.LocalReport.SetParameters(Param1)
        Me.ReportViewer1.RefreshReport()
    End Sub

    Private Sub IdlocationTextBox_TextChanged(sender As Object, e As EventArgs) Handles IdlocationTextBox.TextChanged
        Dim Param2 As New ReportParameter("ReportParameterwhere", IdlocationTextBox.Text)
        ReportViewer1.LocalReport.SetParameters(Param2)
        Me.ReportViewer1.RefreshReport()
    End Sub
End Class

附件中的图片!

enter image description here

enter image description here

0 个答案:

没有答案