Solved

Crystal Reports The table could not be found.

Posted on 2009-07-16
1
1,762 Views
Last Modified: 2012-05-07
Am writting a general Crystal reports viewer in C#. The application works well with all reports designed using Crystal 2008 but for reports generated with Crystal Reports prior to this version (CR 9 /10 or XI)  I get a 'The table could not be found'. or an error message similar to the one below

Error in File Customer List, with Terms {C8B9B467-656D-4654-9FC2-E663561CD0AF}.rpt:
The table could not be found.

 I edit the same report with CR 2008 making sure I save with with the new version and the program works well. All these reports are designed for MS SQL and the 'Save data With Report' option is switched off always

Question 1. What is causing the 'Table could not be found' ?

Question 2. Can I determine in any way if the CR 2008 API exposes the version of the report in which is had been designed (ie. ver 8.5 9 10 or XI) - Am using a stand alone version..and all reports are external to the application ?
0
Comment
Question by:mprivitera
1 Comment
 

Accepted Solution

by:
mprivitera earned 0 total points
ID: 24870155
Solution

TableLogOnInfo logonInfo = new TableLogOnInfo();

foreach (Table table in objRepDoc.Database.Tables)
{
myTableLocation = table.Name;
logonInfo = table.LogOnInfo;
logonInfo.ConnectionInfo.AllowCustomConnection = true;
logonInfo.ConnectionInfo.ServerName = __PS_ODBC_DSN;
logonInfo.ConnectionInfo.DatabaseName = __PS_Database;
logonInfo.ConnectionInfo.UserID = API_FrontEnd_User;
logonInfo.ConnectionInfo.Password = API_FrontEnd_Password;
logonInfo.ConnectionInfo.Type = ConnectionInfoType.SQL;
logonInfo.ConnectionInfo.IntegratedSecurity = false;

table.ApplyLogOnInfo(logonInfo);

table.Location = __PS_Database + ".dbo." + myTableLocation;

}
INSTEAD OF
 TableLogOnInfo tb = new TableLogOnInfo();
    tb.ConnectionInfo.ServerName = __PS_ODBC_DSN.ToString();
    tb.ConnectionInfo.DatabaseName = __PS_Database.ToString();
    tb.ConnectionInfo.UserID = API_FrontEnd_User.ToString();
    tb.ConnectionInfo.Password = API_FrontEnd_Password.ToString();
    tb.ConnectionInfo.IntegratedSecurity = false;

    for (int ii = 0; ii < objRepDoc.Database.Tables.Count; ii++)
     {
     objRepDoc.Database.Tables[ii].LogOnInfo.ConnectionInfo.AllowCustomConnection = true;
     objRepDoc.Database.Tables[ii].ApplyLogOnInfo(tb);
     }
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now