Hi Leandro,
IMHO CR has a LOT to improve regarding the exception it throw, everything
is "Logon Failed" error :(.
I have done what you want and basically this is the steps/code I use.
1- I never load the report from a file, I always compile it as an embedded
resource ( the default by the way ). this avoid the need to load the report
at runtime.
2- I use this code for initialize the report, the most important thing I
believe is give it the correct info to each of the tables:
// Collection of the logon info for each of the tables of the report
TableLogOnInfos crTableLogonInf os = new TableLogOnInfos ();
//Create the report object
reportDocument1 = new OpenRecords();
//This is used to contain the connection info for the tables
ConnectionInfo crConnectionInf o = new ConnectionInfo( );
crConnectionInf o.ServerName = "127.0.0.1" ;
crConnectionInf o.DatabaseName = "CTP";
crConnectionInf o.UserID = "CTPWeb";
crConnectionInf o.Password = "CTPApp";
// Now assign it to each of the report table
foreach (CrystalDecisio ns.CrystalRepor ts.Engine.Table table in
reportDocument1 .Database.Table s)
{
TableLogOnInfo crTableLogonInf o = new TableLogOnInfo( );
crTableLogonInf o.TableName = table.Name;
crTableLogonInf o.ConnectionInf o = crConnectionInf o;
crTableLogonInf os.Add( crTableLogonInf o);
table.ApplyLogO nInfo( crTableLogonInf o);
}
//Assign the report and the logon info collection to the viewer
CrystalReportVi ewer1.LogOnInfo = crTableLogonInf os;
CrystalReportVi ewer1.ReportSou rce = reportDocument1 ;
Merry X-Mas,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Ing. Leandro Pérez Guió" <lp****@holguin .copextel.com.c u> wrote in message
news:uH******** ******@TK2MSFTN GP10.phx.gbl...
hello:
I made a webform with a CrystalReportVi ewer. In the event page_load, i try
to fill it with a Report, some like this...
CrystalReportVi ewer1.ReportSou rce =
MapPath("localh ost/quejasweb")+\\R pt\\My.rpt;
and i receive Load report failed.
If the database is SQL server...what am i doing wrong?
I tried using dataset, direct sql tables, etc...and nothing works just
Load report failed.
How can i do?
Thanks in advanced.
Leo