📄 awemployees.aspx.vb
字号:
Option Explicit On
Option Strict On
Imports System
Imports System.Data
Imports Microsoft.Reporting.WebForms
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack Then
Return
End If
'The following solves the "Failed to enable constraints" error for
'WinForms, but the property is missing in WebForms
'AdventureWorksDataSet.EnforceConstraints = False
'Thus, you must create new DataSet and TableAdapter instances
Dim dsAdvWorks As New AdventureWorksDataSet
Dim taEmployees As New AdventureWorksDataSetTableAdapters.AWEmployeesTableAdapter
dsAdvWorks.EnforceConstraints = False
taEmployees.Fill(dsAdvWorks.AWEmployees)
With Me.ReportViewer1
'Optionasl code
'.ProcessingMode = ProcessingMode.Local
'Dim strPath As String = "\ReportViewer\ReportWebSite\"
'Optionally, load the client report definition file (if new)
'.LocalReport.ReportPath = strPath + "AWEmployeesWin.rdlc"
.LocalReport.DataSources.Clear()
.LocalReport.DataSources.Add(New ReportDataSource("AdventureWorksDataset_AWEmployees", dsAdvWorks.Tables(0)))
'Refresh the report with the new data
.DataBind()
End With
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -