Skip to Content
0
Former Member
Feb 04, 2016 at 02:53 PM

Invalid Table Number

134 Views

I have a bunch of reports that were being created in CR 2008 - Well, most of them came from really old CR versions - I'm validating these reports with the CR .Net, but I have one report that I do not really know what it is happening there. If I open the report in designer everything is ok. But if I just open the report using the next code, I receive an exception. I've open the report in designer and I've removed all the components there and the behavior is the same. We have a dll which is the bridge between CR and the application, this is the interface that handles the calls to the report and as we have a lot of reports, we used to convert this component from C++ to C++/CLI and we kept the .rpt files without conversion. If I open the .rpt file in the last CR designer version and save the file, the behavior is the same. I've done some research regarding this and I've not found anything that could help, because I'm receving the error when I'm trying to load the report. Once again, this is not regarding permissions because I'm able to load a lot of .rpt files.

I've just done a quick C# code in a simple windows form project and the behavior is the same, I've tried all these options without success. Am I missing something?

CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

report.Load(@"C:\arinvedtWtAmt.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy);

report.Load(@"C:\arinvedtWtAmt.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault);

report.Load(@"C:\arinvedtWtAmt.rpt");

report.ReportClientDocument.Open(@"C:\arinvedtWtAmt.rpt", 0);

Exception thrown in Load:

CrystalDecisions.Shared.CrystalReportsException was caught

HResult=-2146232832

Message=Load report failed.

Source=CrystalDecisions.CrystalReports.Engine

StackTrace:

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod)

at WindowsFormsApplication17.Form1.Form1_Load(Object sender, EventArgs e) in c:\Users\rmujica\Documents\Visual Studio 2012\Projects\WindowsFormsApplication17\WindowsFormsApplication17\Form1.cs:line 29

InnerException: System.Runtime.InteropServices.COMException

HResult=-2147483142

Message=

Invalid table number.

arinvedtWtAmt 40276_44480_{0B6283D9-4446-4EE7-A5F0-E14EAE5AD4D7}.rpt

Source=Analysis Server

ErrorCode=-2147483142

StackTrace:

at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

InnerException:

I really appreciate any advice here. Thanks!

Roberto M.

EDIT1: if I try the next code

this.crystalReportViewer1.ReportSource = @"C:\arinvedtWtAmt.rpt"

I have the attached alert from the Crystal Report Windows Forms Viewer.

EDIT2: I'm sending a copy of the report without any content just in case you are interested. Note that I've added the .txt. This file is .rpt.

Attachments

fail.rpt.txt.zip (5.5 kB)