vb.net - 如何使用 SQL 在报表查看器中添加图像
问题描述
我正在使用带有 SQL Server 的 VB.Net 2013
我的代码有什么问题?有什么遗漏吗?
当我尝试选择位置时,它会在表单中显示名称、位置和图像。
一切看起来都很好,唯一的问题是报表查看器中的图像没有改变。
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
图片在附件!
解决方案
推荐阅读
- database - 如何在 mongoDB 中查找数组
- java - 将值从一个非静态方法传递到另一个从main?
- java - “应用程序启动方法 java.lang.reflect.InvocationTargetException 中的异常”
- c++ - 如何在其中初始化类的数组实例?
- java - 如何避免“接口抽象类错误”?
- macos - 如何在 OS X 中显示加载的 shell 文件?
- javascript - JavaScript 助手 | startsWith( ) 不是函数
- java - 使用 Optional.orElseGet 做一些日志记录逻辑是个好主意吗
- javascript - 使用 API Gateway 在 Lambda 请求中不断收到 502。请求的资源上不存在“Access-Control-Allow-Origin”标头
- python - 用该列中的类标记绘图图例