locked
Problem rendering a report RRS feed

  • Question

  • Hi All,
    I am having a difficult time rendering a localreport. I cannot seem to get the code correct. Visual Studio 2008 VB.Net, SQL Server 2005.
    In the click event, I have the following code:
            Me.rvApptRpt.LocalReport.ReportEmbeddedResource = "ReportingServicesLocal.Appointments.rdlc"
            Me.rvApptRpt.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("EmdIntData_AppointmentHistory", Me.EmdIntData.Tables(2)))
            Me.rvApptRpt.BringToFront()
            Me.rvApptRpt.Visible = True
            Me.rvApptRpt.Refresh()
    After the app executes, the report is blank except for a message stating: "The source of the report definition has not been specified". Is the source not defined in my code?
    If not, what exactly do I need to do.
    Your help is appreciated.
    Roy
    Tuesday, July 28, 2009 11:14 PM

All replies

  • I have the same issue.
    Did you find a solution?

    Duane Sanders
    Wednesday, September 2, 2009 2:53 PM
  • What I found was that when you create/define the rdlc you assign a datasource that you use for setting up the report. When adding your new datasource at runtime be sure that you use the exact same name of the datasource that you bound to your report. Don't know if this helps or not but it was a clue for me.
    • Proposed as answer by William Vaughn Thursday, March 4, 2010 5:20 PM
    Thursday, September 3, 2009 2:36 PM
  • Taxeon,

    I have heard this before and I have seen some code about it, but I am not understanding it.

    I did set up the rdlc with datasource1.

    So when I add a new datasource at runtime, I am supposed to use the same datasource1.
    I am missing something.   I want the report to use datasource2 (which is an in-memory dataset that I create in code).

    Do you have some code that I can look at? 
    Could you please explain the steps you used to create the report and the datasources?


    Duane Sanders
    Thursday, September 3, 2009 3:04 PM
  • Your in memory datasource must have the same name as the datasource used by your report at design time.
    (Sorry I know this probably comes way too late but for some reason I am not getting any notice when threads update even with Alert set on)

    Thursday, March 4, 2010 4:26 PM
  • Taxeon is right. The Data Source you provide must match by NAME. It does not have to have the same SELECT as long as the column NAMES are all the same and all present.

    See Chapter 14 of my 7th Edition--it's totally focused on the Report Viewer and it includes an example of generating a report from a selected RDLc file.

    hth

    __________________________________________________________________
    William Vaughn
    Mentor, Consultant, Trainer, MVP
    http://betav.com
    http://betav.com/blog/billva
    http://www.hitchhikerguides.net

    “Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)”

    Please click the Mark as Answer button if a post solves your problem!

    Thursday, March 4, 2010 5:23 PM

  • I got more deep understanding about this part, Many thanks to your description!
    Sunday, February 13, 2011 9:54 PM