on 07-23-2014 1:05 PM
hi,
i am developing web base report portal in asp.net (vs2012). my back end database is oracle 64bit under linux. i have deployed web base application in windows 2008 r2 64bit server. in that server i have installed oracle 11g 32 bit client, installed crystal report 2008 and also installed crystal report viewer ver 13 32bits. when i am previewing report in crystal report 2008 with jdbc connection there is no error and preview the report. but when try to run the report through asp.net, i am getting error "failed to load database information". i have tried to resolve by changing different viewer version, but to fail. is there any error in code? code is written as follows
if (Request.QueryString["cr"] != null)
{
reportPath = "c:\\rptreports\\" + Request.QueryString["cr"];
CrystalReportViewer1.ReportSource = reportPath;
ConnectionInfo crConnectionInfo = MyClass.ConInfo();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
crtableLogoninfos = CrystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo crtableLogoninfo in crtableLogoninfos)
{
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
}
}
public static ConnectionInfo ConInfo()
{
ConnectionInfo connInfo = new ConnectionInfo();
connInfo.ServerName = "orcl";
connInfo.DatabaseName = "ORCL";
connInfo.UserID = "uml";
connInfo.Password = "uml";
return connInfo;
}
can anybody help me to resolve error?
Keep in mind is that the CR designer is 32 bit and thus will only use a 32 bit client / datasource.
The CRVS runtime can be compiled as 32 bit, 64 bit or "Any CPU".
Thus an app compiled as 32 bit will look for a 32 bit datasource.
A 64 bit app will look for 64 bit datasource.
So, if your app is compiled as 32 bit and your datasource is 64 bit (back end database is oracle 64bit), then the report engine will throw the error you are seeing. You then have two options:
1) Compile the app as 64 bit
2) Install 32 bit datasource
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank u for suggestion. application has been compiled and setup as 32bit app in iis and work fine with oracle connection used in rpt file. But if i use jdbc connection it gives error. if open rpt and preview in crystal report 2008 using jdbc connection. it works fine. that means there is no compatibility issue with oracle back end database. i feel i am missing some setup in deployment part or in coding.
i have also tried with changing coding as follows, but raise same error, i am attaching snap shot report generated from CR 2008. it work fine and generate report.
reportPath = "c:\\rptreports\\" + Request.QueryString["cr"];
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(reportPath);
Tables CrTables = reportDocument.Database.Tables;
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
DbConnectionAttributes dbconn = new DbConnectionAttributes();
NameValuePairs2 pbag = new NameValuePairs2();
pbag.Set("Connection URL", "jdbc:oracle:thin:@192.168.2.2:1521:orcl");
pbag.Set("Database Class Name", "oracle.jdbc.driver.OracleDriver");
pbag.Set("Database DLL", "crdb_jdbc.dll");
pbag.Set("Server", "192.168.2.2");
pbag.Set("Trusted Connection", "false");
pbag.Set("Use JDBC", "true");
dbconn.Collection = pbag;
crConnectionInfo.ServerName = "192.168.2.2";
crConnectionInfo.DatabaseName = "ORCL";
crConnectionInfo.UserID = "uml";
crConnectionInfo.Password = "uml";
crConnectionInfo.Attributes = dbconn;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
CrystalReportViewer1.ReportSource = reportDocument;
it is working fine if i use oracle connection
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.