Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing the SQL Server report viewer control in WPF
    primarykey
    data
    text
    <p>I have tried to do use the report viewer that comes with VS2010 in WPF. I created the report and tested the same with a windows application it works. Then I used the same RDLC file in the WPF with the same set of parameters but it fails. The code I'm using is as below MainWindow.xaml.cs</p> <pre><code>public MainWindow() { ObjectModel DataObject = new ObjectModel(); DataObject.SetEPSDetails(); WindowsFormsHost host = new WindowsFormsHost(); ReportViewer RptViewer = new ReportViewer(); host.Child = RptViewer; Grid HostGrid = this.FindName("GrdRow") as Grid; HostGrid.Children.Add(host); RptViewer.ProcessingMode = ProcessingMode.Local; RptViewer.LocalReport.ReportEmbeddedResource = "RDLWPF.PrintPreview.rdlc"; RptViewer.LocalReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter("Payer", DataObject.Payer)); RptViewer.LocalReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter("ValueDate", DataObject.ValueDate)); RptViewer.LocalReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter("FileName", DataObject.FileName)); RptViewer.LocalReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter("Description", DataObject.Description)); RptViewer.LocalReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter("PrintedDate", DataObject.PrintDate)); RptViewer.LocalReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter("FileLastUpdated", DataObject.FileLastUpdated)); RptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("FileDetails", DataObject.EPSDetails)); RptViewer.RefreshReport(); } </code></pre> <p>The Xaml is as below Mainwindow.Xaml</p> <pre><code>&lt;Window x:Class="RDLWPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:viewer="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms" Title="MainWindow" Height="350" Width="525" AllowsTransparency="False" &gt; &lt;Grid x:Name="GrdRow"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;/Grid&gt; </code></pre> <p>I just getting the empty XAML window. The report control is also not displayed. I know I'm doing a mistake but could not find what it is. Is there some on who can correct this for me. Also if some one could send me a code sample in MVVM appraoch that would also be great</p> <p>Thanks and regards Venkatesh</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload