|
-
Mar 5th, 2012, 10:51 AM
#1
Thread Starter
Hyperactive Member
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
-
Mar 5th, 2012, 01:40 PM
#2
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
-
Mar 6th, 2012, 09:41 AM
#3
Lively Member
Re: Report Viewer - Simple Difficulty!
 Originally Posted by intraman
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|