Here is my code:
/************************************************** ************/
Table crTable;
TableLogOnInfo crLogOnInfo = new TableLogOnInfo();
ConnectionInfo crConnInfo = new ConnectionInfo();
foreach(Table tbl in ReportDoc.Database.Tables)
{
crConnInfo.ServerName = "cia_sql2000";
crConnInfo.DatabaseName = "cia";
crConnInfo.UserID = "sa";
crConnInfo.Password = "#ciasql";
crLogOnInfo = tbl.LogOnInfo;
crLogOnInfo.ConnectionInfo = crConnInfo;
tbl.ApplyLogOnInfo(crLogOnInfo);
tbl.Location = tbl.Location.Substring(tbl.Location.LastIndexOf(". ")+1);
}
/************************************************** *********************/
It always failed at the last statement no matter whether I explicitly
provided the location.
"Frank" <ra**@nowhere.com> wrote in message news:<er**************@tk2msftngp13.phx.gbl>...
Can you provide some code?
"anannj" <be*****@gmail.com> wrote in message
news:d7**************************@posting.google.c om... Hi everyone,
I have a Crystal Report with a subreport in a windows application,
which is to be exported to the pdf file. I followed the instructions
on http://support.crystaldecisions.com/...s/c2010275.asp
to set up the log on information. But I always got the exception at
the statement:
tbl.Location = ...;
The error message is listed below:
An unhandled exception of type
'CrystalDecisions.CrystalReports.Engine.InvalidArg umentException'
occurred in crystaldecisions.crystalreports.engine.dll
Additional information: Error in File C:\tmp2\rptMain.rpt:
Invalid table number.
Can anyone help me on this problem? Thank you so much in advance.
-- anannj
p.s. the datasets in the reports were created against views. But I
don't think this could cause any problem.