Results 1 to 3 of 3

Thread: Report Viewer - Simple Difficulty!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Report Viewer - Simple Difficulty!

    A really simple problem here but one that I can't see to get my head around.
    I have an MS report created in VS as an embedded resource within my application. I have a form with a report viewer on it. To put it simply, how to do I get the blasted thing to display in the report viewer!

    This is my code:

    Code:
    ReportViewer1.LocalReport.ReportPath = Application.StartupPath & "Report1.rdlc"
            ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout)
    At runtime,the report viewer displays:

    "An error occurred during local report processing. The report definition has not been specified. Could not find file."

    I am confused on two counts as surely I should not need to give a file path name anyway as it is an embedded resource? This must be straightforward, any help would be great. PS: It doesn't contain any data at the moment just an image with some text.

    Jord

  2. #2
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Report Viewer - Simple Difficulty!

    Why dont you just assign it directly in the UI and not in code?
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  3. #3
    Lively Member
    Join Date
    Feb 2012
    Posts
    90

    Re: Report Viewer - Simple Difficulty!

    Quote Originally Posted by intraman View Post
    A really simple problem here but one that I can't see to get my head around.
    I have an MS report created in VS as an embedded resource within my application. I have a form with a report viewer on it. To put it simply, how to do I get the blasted thing to display in the report viewer!

    This is my code:

    Code:
    ReportViewer1.LocalReport.ReportPath = Application.StartupPath & "Report1.rdlc"
            ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout)
    At runtime,the report viewer displays:

    "An error occurred during local report processing. The report definition has not been specified. Could not find file."

    I am confused on two counts as surely I should not need to give a file path name anyway as it is an embedded resource? This must be straightforward, any help would be great. PS: It doesn't contain any data at the moment just an image with some text.

    Jord
    You forgot to add a backslash before "Report1.rdlc" try "\Report1.rdlc" instead

    Pat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width