none
Using one reportviewer for multiple reports RRS feed

  • Question

  • I have a from called APP0002 that contains a treeView that has a list of all my reports that users can run. When a node is clicked, it captures the path of the report and name to passes it to APP0003 which is the form that actually contains the reportViewer.

    The problem I'm running into, is that I'm getting an error code that says: "An error occurred during local report processing. The report definition for report 'EMP0002' has not been specified. Could not find file "C:\..\bin\Debug\Modules\Reports\Employees\EMP0002.rdlc'.

    Code from APP0002

    private void radTreeView1_NodeMouseClick(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
            {
                if (e.Node.Text.Equals("Employee Information"))
                {
                    APP0003 frm = new APP0003(@"\Modules\Reports\Employees\EMP0002R.rdlc", "Employee Information");
                    frm.Show();
                }
    
                if (e.Node.Text.Equals("Customer Information"))
                {
                    APP0003 frm = new APP0003(@"..\Modules\Reports\Employees\EMP0002R.rdlc", "Customer Information");
                    frm.Show();
                }
            }

    Code from APP0003

            public APP0003(string reportPath, string reportName)
            {
                InitializeComponent();
    
                string path = System.Reflection.Assembly.GetExecutingAssembly().Location;
                string fullReportPath = Path.Combine(path, reportPath);
    
                reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
                reportViewer1.LocalReport.ReportPath = fullReportPath;
    
                reportViewer1.LocalReport.DisplayName = reportName;
    
                this.Text = "APP0003 - Report Viewer - " + reportName;
            }
    
            private void APP0003_Load(object sender, EventArgs e)
            {
                this.reportViewer1.RefreshReport();
    
            }
    Can anyone see why I'm getting this error and how to fix it?

    Sincerely, Justin Adkins

    Wednesday, May 1, 2013 11:21 PM

All replies

  • Justin,

    Obvious question : does the .rdlc file exist in the directory ? Your bin/Debug directory has subdirs ??

    Thursday, May 2, 2013 12:05 PM
  • Yes, the file does exist. And yes, it does have sub directories, I have everything organized into folders.

    Sincerely, Justin Adkins

    Thursday, May 2, 2013 8:40 PM