none
How to make a report without using the wizard? RRS feed

  • Question

  • Hi,

    How to bind my reportviewer to my report.rdlc(i mean how can i make a report programatically using a reportviewer with using a wizard).

    I'm having trouble how to make a dataset programatically to use it in my report... i can do wizard but more efficient in programatically

    Best Regards,
    Ian

    noob vb programmer
    Monday, December 15, 2008 2:28 AM

All replies

  • Hi Pinoyz,
                For run-time report creation & deployement,you can go for Report Model Project .
    Hope it will help you.
    Aftab Ansari
    Friday, December 26, 2008 7:01 AM
  • if your not familiar with filling a dataset programatically, you may want to go read up on ADO.NET

    filling a dataset depends on a few factors,  what are you filling it with? The source of your data basically.

    If it is a database...what kind.  SQL?  if it's sql then you'll need to understand how to create a sql connection programatically,  how to build a sql command, and then how to execute that command and return the information to your dataset.

    That is the hard part actually.

    Once you've done all that, you simply give your report the dataset you just filled

    Dim myReportdata as New ReportDataSource
    myreportdata.Name = "theNameItHadWhenYouDesignedTheReport"
    myreportdata.Value = dsMyDataSetIFilled.Tables(0)

    ReportViewer1.LocalReport.Datasources.Add( myreportdata)
    Living my life at 123mph in 11.15 seconds
    Monday, December 29, 2008 2:22 PM
  • lets say i made a dataset programatically how about to show the data in the table and textbox?
    noob vb programmer
    Monday, January 12, 2009 5:46 AM
  • Hi pinoyz,

    This blog entry goes over how to set up the datasource programatically.

    http://blogs.msdn.com/magreer/archive/2008/10/16/setting-the-datasource-for-a-report-at-runtime.aspx

    It should cover most of what you are looking for. If not, just post back here again.


    http://blogs.msdn.com/magreer
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, January 12, 2009 8:43 AM
  •  I have a problem regarding rdlc.... i put some textbox in the textbox i put  this expression

    =Fields!Username.Value but i got an error.... and it doesn't recognize the textbox that i input.

    i haven't use the wizard to create a dataset.... i used progmatically

     Here's my code

    Imports System.Data.SqlClient
    Imports Microsoft.Reporting.WinForms
    Public Class Form3
        Dim conn As New SqlConnection("Server=Ian;database=mydb;user=sa;password=ianski;")
        Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            ReportViewer1.ProcessingMode = ProcessingMode.Local

            Dim local As LocalReport
            local = ReportViewer1.LocalReport

            local.ReportPath= Application.StartUp & "\Report2.rdlc"


            Dim com As New SqlCommand("Select * From Login", conn)
            Dim da As New SqlDataAdapter(com)
            Dim bind As New BindingSource
            Dim ds As New DataSet
            conn.Open()
            da.Fill(ds)
            bind.DataSource = ds.Tables(0)
            conn.Close()

            Dim rds As New ReportDataSource
            rds.Name = "Login"
            rds.Value = ds.Tables(0)
            

            ReportViewer.LocalReport.DataSource.Add(rds)
            Me.ReportViewer1.RefreshReport()
        End Sub
    End Class


    noob vb programmer
    Tuesday, January 13, 2009 3:14 AM