日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

RDLC系列之五 初试XAML

發布時間:2023/11/30 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 RDLC系列之五 初试XAML 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本章只講解xaml部分,其余都和winform下一樣

1.xaml代碼

<Window x:Class="RDLC.WPF.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"Loaded="Window_Loaded" Closed="Window_Closed" Title="MainWindow" Height="350" Width="525"><WindowsFormsHost Name="windowsFormsHost"><rv:ReportViewer x:Name="reportView" /> </WindowsFormsHost> </Window>

2.后臺代碼

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Microsoft.Reporting.WinForms;namespace RDLC.WPF {/// <summary>/// MainWindow.xaml 的交互邏輯/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}private void Window_Loaded(object sender, RoutedEventArgs e){//代碼區域this.reportView.RefreshReport();}private void Window_Closed(object sender, EventArgs e){this.reportView.LocalReport.Dispose();this.reportView.LocalReport.ReleaseSandboxAppDomain();}} }

?

3.DLL引用

MainWindow.xaml:

System.Windows.Forms

WindowsFormsIntegration? (.NET 4.0 才有,直接在程序集里面搜索)

MainWindow.xaml.cs:

Microsoft.ReportViewer.Common.dll、 Microsoft.ReportViewer.ProcessingObjectModel.dll、 Microsoft.ReportViewer.WebForms.dll和Microsoft.ReportViewer.WinForms.dll

注意:本次測試的Microsoft.ReportViewer的dll為版本號為11.0,試過使用9.0的,但是this.reportView.LocalReport.ReleaseSandboxAppDomain() 無法使用。

?

4.報表的工具欄

操作方法:在工具欄選擇或取消相應的屬性

例:不顯示刷新按鈕和導出按鈕

?<rv:ReportViewer x:Name="reportView" ShowRefreshButton="False" ShowExportButton="False"? />

?

轉載于:https://www.cnblogs.com/xcsn/p/4515179.html

總結

以上是生活随笔為你收集整理的RDLC系列之五 初试XAML的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。