Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Creating reports in run-time from .net?

$
0
0

Hi,

Is it possible to create in run-time one RDLC report? I suppose so such as we can create a SSIS package and launch whenever we want.

In my case from my WPF app I use WindowsFormsHost way to call them, once it has been created manually

XAML:

<Window x:Class="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"
    Title="MainWindow" Height="468.382" Width="787.5"><Grid Name="nine" Margin="0,0,18,10"><Grid.ColumnDefinitions><ColumnDefinition Width="500*"/><ColumnDefinition Width="17*"/></Grid.ColumnDefinitions><WindowsFormsHost Margin="29,10,0,28" ><rv:ReportViewer x:Name="_reportViewer"/></WindowsFormsHost></Grid></Window>

Code-behind:

   AddHandler _reportViewer.Load, AddressOf altre

  Public Sub altre(sender As Object, e As EventArgs)


Dim reportDataSource1 As New Microsoft.Reporting.WinForms.ReportDataSource()

        Dim WpfApplication4DataSet As New TalleresDataSet1


        WpfApplication4DataSet.BeginInit()

        reportDataSource1.Name = "DataSet2"

        reportDataSource1.Value = WpfApplication4DataSet.Talleres_Articulos


        _reportViewer.LocalReport.DataSources.Add(reportDataSource1)


        _reportViewer.LocalReport.ReportPath = "../../Report2.rdlc"


        WpfApplication4DataSet.EndInit()

        Dim accountsTableAdapter As New TalleresDataSet1TableAdapters.Talleres_ArticulosTableAdapter
        accountsTableAdapter.ClearBeforeFill = True

        accountsTableAdapter.Fill(WpfApplication4DataSet.Talleres_Articulos)

        _reportViewer.RefreshReport()

        _isReportViewerLoaded = True



TIA,


Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF/SilverLight projects.


Viewing all articles
Browse latest Browse all 10045

Trending Articles