Generating report using C#, ReportViewer and RDL file
<p>I'm trying to generate a report using C# and a RDL file. I have followed examples but I can't get it going. I get the error:</p>

<p>"The path of the item 'sample.rdl' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. (rsInvalidItemPath)". I have tried prepending a slash to the path with no success.</p>

<p>My Reporting Server is in <strong>Native</strong> mode. My two main questions are:</p>

<ol>
<li>Do I need parameters?</li>
<li>Where should my RDL file be stored?</li>
</ol>

<p>Right now I am storing my RDL file within my project. (I don't think this is right)</p>

<p>Here's a code snippet:</p>

<pre><code>const string path = "sample.rdl";
string url = "http://localhost/ReportServer";
string format = "PDF";

var rsReports = new Microsoft.Reporting.WebForms.ReportViewer
{
    ProcessingMode = ProcessingMode.Remote,
    ShowParameterPrompts = false
};
rsReports.ServerReport.ReportServerUrl = new Uri(url);
rsReports.ServerReport.ReportPath = Path.Combine("\\" + Environment.CurrentDirectory, path);
rsReports.ServerReport.Refresh();
byte[] report = rsReports.ServerReport.Render(format.ToUpper());

return report;
</code></pre>