473,498 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Failed to display .rpt in ASP.NET web with Crystal Reports Server XI

7 New Member
Hi, I have a problem with loading .rpt in my ASP.NET application. I'm using .Crystal Reports Server XI as my report repository. My development machine is using Windows XP SP2 and the production server is using Windows Server 2003. My application works fine in development machine but I got "Database logon failed" message in production server. I have set database login & access rights, web.config and data source location in my .rpt to match the target machine so I don't how this can be happened. I have tried using Windows authentication too but it didn't work

Here is my code:

Expand|Select|Wrap|Line Numbers
  1. // InfoStoreConnectionHelper is a custom class to handle connection with Infostore
  2. // the report id is passed from another page
  3. ReportApplicationServer.InfoStoreConnectionHelper helper = new ReportApplicationServer.InfoStoreConnectionHelper();
  4. using (helper)
  5. {
  6.     //get client document by reportId
  7.       CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument doc = helper.GetClientDocumentByID(id);
  8.     if (doc != null)
  9.       {
  10.            CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag props = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBagClass();
  11.            CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos info = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos();
  12.            CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo ci = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfoClass();
  13.            props.Add("Data Source", ConfigurationManager.AppSettings["report_servername"]);
  14.            props.Add("Initial Catalog", ConfigurationManager.AppSettings["report_dbname"]);
  15.            ci.Attributes = props;
  16.            ci.UserName = ConfigurationManager.AppSettings["report_username"];
  17.            ci.Password = ConfigurationManager.AppSettings["report_password"];
  18.            info.Add(ci);
  19.  
  20.          CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag pb = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBagClass();
  21.            CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag lpb = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBagClass();
  22.            lpb.Add("Data Source", ConfigurationManager.AppSettings["report_servername"]);
  23.            lpb.Add("Initial Catalog", ConfigurationManager.AppSettings["report_dbname"]);
  24.            lpb.Add("Provider", "SQLOLEDB");
  25.  
  26.            pb.Add("Database DLL", "crdb_ado.dll");
  27.            pb.Add("QE_DatabaseType", "OLE DB (ADO)");
  28.            pb.Add("QE_LogonProperties", lpb);
  29.            pb.Add("QE_SQLDB", "true");
  30.  
  31.            CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo nci = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfoClass();
  32.            nci.UserName = ConfigurationManager.AppSettings["report_username"];
  33.            nci.Password = ConfigurationManager.AppSettings["report_password"];
  34.            nci.Kind = CrystalDecisions.ReportAppServer.DataDefModel.CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
  35.            nci.Attributes = pb;
  36.            foreach (CrystalDecisions.ReportAppServer.DataDefModel.Table tbl in doc.Database.Tables)
  37.            {
  38.                    tbl.ConnectionInfo = nci;
  39.            }
  40.  
  41.            crViewer.ReportSource = doc;
  42.     }
  43. }
  44.  
Please help me.
Apr 8 '08 #1
0 1435

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1907
by: sztonix | last post by:
Hi all, I encountered a crystal report deployment problem. I make reports with Crystal Report for Visual Studio .NET 2003. It works fine in the development machine. And then make setup...
1
334
by: Michael O'Donnell | last post by:
Hi All Am having major problem with crystal reports...Have designed my report no problem, its when I try to run and display ther report that I am getting a "Login Failed" message. At first I...
4
1891
by: Rey | last post by:
Howdy all. Using VSNet 2003 on an XP Pro SP2 boox. Trying to use Crystal Reports to access an mdb file with access security/workspace. Simple report of customers but after spending mucho time...
2
3867
by: Karun Karunakaran | last post by:
Hi, I am using the Crystal Enterprise .NET assemblies to generate and display a crystal report in a webform. This report connects to an SQL server (running locally) using a specific username and...
1
2017
by: andy lim | last post by:
Hello all, I'm developing a web application using ASP.NET/VB. I have problem in viewing my CR reports. It returns following exception when I tried to view any CR report. ...
3
15016
by: Milan Todorovic | last post by:
Hello, I need help. I have experience in ASP.NET programming, but this is my first dealing with Crystal Reports. I'm trying to make the most basic report purely for testing purposes: connect to...
2
3280
by: Jeff_Mac | last post by:
Hi there. I'm a bit of a newbie, and I would appreciate any help that anyone can give me on an error I'm getting with Crystal Reports. Every time I attempt to view a report using the Crystal...
19
4347
by: Michael O'Donnell | last post by:
Hi All Am having major problem with crystal reports...Have designed my report no problem, its when I try to run and display ther report that I am getting a "Login Failed" message. At first I...
2
3723
by: Vijayakumar .Y | last post by:
Hello, My desktop application is developed using vb.net 2005 and uses crystal reports for .net 2005. I am now suffering complaints from the clients that when opening report in their machine, most...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.