2017-04-20 83 views

回答

1

您需要修改您的Visual Studio: This image explains how do it.
這個你可以看到的ReportViewer在Visual Studio之後。

0

它在visual studio 2015中爲我工作。右鍵單擊解決方案資源管理器&選擇解決方案的管理NuGet包並搜索Microsoft.ReportViewer.WinForms.VS2015.WinForms並安裝它。安裝後,在.xaml頁面中添加名稱空間xmlns:rv =「clr-namespace:Microsoft.Reporting.WinForms; assembly = Microsoft.ReportViewer.WinForms」。拖動&將WindowsFormsHost控件拖放到.xaml頁面上。並添加按照您的.xaml頁

 <Grid> 
     <WindowsFormsHost> 
      <rv:ReportViewer x:Name="_reportViewer"/> 
     </WindowsFormsHost> 
    </Grid> 
+0

讓我知道如果你需要任何幫助 –

+0

你有沒有試過上面的代碼? –

0

如果您已成功並執行以下步驟:

打開控制面板>程序>程序和功能,併爲您的Microsoft Visual Studio版本的入門在我們的例子中,它是Microsoft Visual Studio Enterprise 2015. 單擊程序列表上方頂部欄上的「更改」按鈕。 啓動畫面後,將打開一個窗口。按下「修改」按鈕。 選擇Windows和Web開發> Microsoft SQL Server數據工具,然後選中它旁邊的複選框。 按下窗口右下角的「更新」按鈕。 安裝完成後,打開您的Visual Studio版本。在加載新的.dll文件之後,應該重新實現報告功能,並且您應該能夠訪問所有相關的表單,控件和對象。

如果您已經安裝:

  1. Microsoft.ReportViewer.VS2015.WinForms
  2. Microsoft.ReportViewer.VS2015.WebForms 3 Microsoft.ReportViewer.2015.Runtime

  3. Microsof報表查看器2015(從管理Nuget Packeges for Solution或在這裏獲取 https://www.microsoft.com/en-us/download/details.aspx?id=45496

而且您無法創建報告,請嘗試以下步驟:

啓動Visual Studio。在表單設計模式中,轉到控件工具箱並右鍵單擊它。 選擇「選擇項目...「

後>點擊瀏覽和

c選擇元素:\ WINDOWS \裝配\ GAC_MSIL \ Microsoft.ReportViewer.Common \ 12.0.0.0__89845dcd8080cc91