title: Crystal Report Viewer in ASP.NET web app
body: <pre><code> /aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer4
  </code></pre>
  
  <p>We've an ASP.NET web application with the SAP Crystal Report Viewer inside to show Crystal reports that we have in the application. We are trying to determine if we have a problem with our Crystal Reports or with the Crystal Report Viewer. We created some reports with sub-reports in them, load them into our application. Whenever we try to run a report with sub-reports in the report viewer it gives errors and fails. This has never been a problem for any of our other reports without sub reports in them.</p>
  
  <p>We have created the reports with subreports where the procedures are external. We also tried embedding the sub-reports within the reports. We also tried having the sub-reports called or sending parameters to the sub-reports. None of them seem to help.</p>
  
  <p>Error#1 </p>
  
  <blockquote>
    <p>is that there are too many arguments in the stored procedure - but
    when we checked our application it has the same number of arguments.</p>
  </blockquote>
  
  <p>Error#2 was:</p>
  
  <pre><code>'C:\inetpub\wwwroot\Train\Reports\Rpt_PublicSafetyProposed.rpt' could not be loaded!  The error message is: Length cannot be less than zero. Parameter name: length#### at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at reportdisplay.ConfigureReportParameters() in C:\inetpub\wwwroot\Train\reportdisplay.aspx.vb:line 58 at reportdisplay.ConfigureCrystalReports() in C:\inetpub\wwwroot\Train\reportdisplay.aspx.vb:line 22 
  </code></pre>
  
  <p>The reports work on our developers machine running it out of Visual Studio as a Crystal Report Project. On two different machines. However, when we try to run it through the crystal report viewer in the application, <strong>they most often give Error#1</strong></p>