?
Solved

MS report viewer

Posted on 2011-02-12
5
Medium Priority
?
497 Views
Last Modified: 2012-06-27
I face a trouble to find a sample to how create or use Ms report viewer with .rdlc and reportviewer by wpf vb code.

I know how to create rdlc report but not how to conneced with ms report viewer in WPF enviroment usng Vb code and how to pass parameter to it.


Could by please provide me the sample.


Thanks
0
Comment
Question by:abdallah1973
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 

Author Comment

by:abdallah1973
ID: 34899736
The sample is not useful

I tried to do it but I can't

I am looking for basic sample to how run Ms report viewe by WPF form.
I have report and I need just to show it in the form and code by vb.net
0
 

Accepted Solution

by:
abdallah1973 earned 0 total points
ID: 34900461
I done the below
<Window x:Class="reports"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

       
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:viewer="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
xmlns:dalsi="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"

    Title="reports" Height="300" Width="300" Name="Window1">
    <Grid  Height="266">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="81*" />
            <ColumnDefinition Width="4*" />
            <ColumnDefinition Width="126*" />
            <ColumnDefinition Width="89*" />
        </Grid.ColumnDefinitions>
        <WindowsFormsHost Margin="0,34,0,0" Grid.ColumnSpan="4">
            <viewer:ReportViewer x:Name ="reportViewer1" />
        </WindowsFormsHost>
    </Grid>
</Window>

 and it's can use the control of report viewer but how to show my rdlc report

0
 

Author Comment

by:abdallah1973
ID: 34901274
Not it's work  I done this code
but it's now not show data

it's show report without data

 Private taCust As New OMSDataSetTableAdapters.CustomerTableAdapter '.CustomerTableAdapter ' CustomerDataSetTableAdapters.CustomerTableAdapter
    Private taManager As New OMSDataSetTableAdapters.TableAdapterManager
    Private View As CollectionView

    Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
        Me.taCust.Fill(Me.CustomerData.Customer)

        'Dim x33 As New ReportDataSource(Me.CustomerData.Customer)

        'Dim OMSDataSet As class_sample2.OMSDataSet = CType(Me.FindResource("OMSDataSet"), class_sample2.OMSDataSet)
        ''Load data into the table Customer. You can modify this code as needed.
        'Dim OMSDataSetCustomerTableAdapter As class_sample2.OMSDataSetTableAdapters.CustomerTableAdapter = New class_sample2.OMSDataSetTableAdapters.CustomerTableAdapter()
        'OMSDataSetCustomerTableAdapter.Fill(OMSDataSet.Customer)
        'Dim CustomerViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("CustomerViewSource"), System.Windows.Data.CollectionViewSource)
        'CustomerViewSource.View.MoveCurrentToFirst()

        Dim my1 As String = "C:\Users\HP\Desktop\2010\first lessaon\2D\class_sample2\class_sample2\report1.rdlc"
        'AppDomain.CurrentDomain.BaseDirectory.ToUpper & "report1.rdlc"


        Me.reportViewer1.LocalReport.ReportPath = my1
        Dim x222 As New System.Data.DataTable("customerdataset")

        ' Me.reportViewer1.LocalReport.DataSources.Add(x33)
        Me.reportViewer1.LocalReport.DataSources.Clear()
        Me.reportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("customerdataset", x222))
        Me.reportViewer1.RefreshReport()

        'x33.Value = "tcust"


        'reportViewer1.LocalReport.DataSources.Add()
        'Me.reportViewer1.RefreshReport()
        '        'Dim report111 As New Microsoft.Visual
        '        'Me.WindowsFormsHost1.Child().add()
        '        WindowsFormsHost windowsFormsHost = new WindowsFormsHost();


        '        Dim reportviewer As New reports
        ',
        '        reportviewer.Show()

        'reportViewer = new ReportViewer(); windowsFormsHost.Child = reportViewer;
        'this.Viewer = windowsFormsHost and in the View I am using a ContentPresenter to display it, by binding to the Property that holds the WindowsFormsHost.

        ' <ContentPresenter Content="{Binding Viewer}" ...
    End Sub



and the xaml

<Window x:Class="reports"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

       
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:viewer="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
xmlns:dalsi="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"

    Title="reports" Height="300" Width="300" Name="Window1">
    <Grid  Height="266">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="81*" />
            <ColumnDefinition Width="4*" />
            <ColumnDefinition Width="126*" />
            <ColumnDefinition Width="89*" />
        </Grid.ColumnDefinitions>
        <WindowsFormsHost Margin="0,46,0,0" Grid.ColumnSpan="4">
            <viewer:ReportViewer x:Name ="reportViewer1" />
        </WindowsFormsHost>
    </Grid>
</Window>
0
 

Author Closing Comment

by:abdallah1973
ID: 37956119
good
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question