Solved

Crystal Reports The table could not be found.

Posted on 2009-07-16
1
1,757 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

13 Experts available now in Live!

Get 1:1 Help Now