Pregunta

Am trying to load a rpt file using c#. I have used the following code.

using System;
using CrystalDecisions.CrystalReports.Engine;   
using CrystalDecisions.Shared;
namespace Report
 {  
     public partial class Report : Document    
  {    
   public void ReportLoad()    
   {        
     ReportDocument reportDocument = new ReportDocument();       
     string filePath = "D:\\crosstabReport.rpt";           
     reportDocument.Load(filePath);  
     crystalReportViewer.ReportSource = reportDocument; 

   } 

But am getting a error like ''The name 'crystalReportViewer' does not exist in the current context''.

Any suggestions???

Thanks in advance!!!!

¿Fue útil?

Solución

The name 'crystalReportViewer' does not exist in the current context'

It means that the variable crystalReportViewer isn't present in this scope. Check the name that you have declared and replace it here.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top