on 01-24-2011 2:16 PM
I use Crystal Reports for Visual Studio 2010 Production Release with MVC 2 web aplication and SQL Server 2008 database server. When I compile/run from VS 2010 it running well, but when deploy it on Windows Server 2008, when load certain report (Not All report) face the following exception message:
Database logon failed
Stack Trace is as the following:
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) at SequisLife.Controllers.ReportController.run_report(String report_name, IDictionary`2 dic_param)
InnerException:
System.Runtime.InteropServices.COMException (0x8004100F): Database logon failed. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
run_report method is as the following:
private ActionResult run_report(string report_name, IDictionary<string, string> dic_param)
{
string ls_respon = "";
try
{
get_sqllogin();
ReportClass rptH = new ReportClass();
rptH.FileName = Server.MapPath(VirtualPathUtility.ToAbsolute(report_name));
rptH.Load();
rptH.Refresh();
Database crDataBase;
Tables crTables;
TableLogOnInfo crTableLogOnInfo;
ConnectionInfo reportConnectionInfo = new ConnectionInfo();
reportConnectionInfo.ServerName = server;
reportConnectionInfo.DatabaseName = database;
reportConnectionInfo.UserID = login_user;
reportConnectionInfo.Password = login_pass;
crDataBase = rptH.Database;
crTables = crDataBase.Tables;
foreach (Table crTable in crTables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = reportConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}
ParameterFields lpf_parameters = rptH.ParameterFields;
if (lpf_parameters.Count > 0)
{
foreach (ParameterField lpf_param in lpf_parameters)
{
var llst_tmps = dic_param.Where(d => d.Key == lpf_param.Name);
foreach (var param in llst_tmps)
{
if (param.Key == lpf_param.Name)
{
if (lpf_param.ReportName == "")
{
rptH.SetParameterValue(lpf_param.Name, param.Value);
}
else
{
rptH.SetParameterValue(lpf_param.Name, param.Value, lpf_param.ReportName);
}
}
}
}
}
Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
return File(stream, "application/pdf");
}
catch (Exception ex)
{
ls_respon += ex.Message;
ls_respon = " - "ex.StackTrace;
ls_respon += " - " + ex.InnerException;
ls_respon += " - " + ex.Source;
ls_respon += " - " + ex.Data;
return Content(ls_respon);
}
}
Please any body hepl me...
Thank's in advance
If it's only certain reports, then compare the reports:
Connection type (OLE DB, ODBC, etc.).
Is it reports with subreports only? If so, check the above and log on to the subreports.
Check other differences. parameters? Tables vs. Stored Proc, etc., etc.
- Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ludek,
I'm trying to use Crystal Report for Visual Studio 2010 in a PC Windows XP, then I deploy a ASP.NET web site with CrystalReportsViewer in a Windows 2008 Server, where I installed Crystal Reports 2013 trial version (that I use for report development) and Visual Studio 2010 Runtime (64 bit).
When I try to open a simple report (without any DB access) I can display it in ASP.NET page, but when I try to add DB access (I tryed to configure both Oracle Server and OLEDB with oracle driver in Expert Database dialog, Crystal Reports 2013), I get a connection database error..
I tryed to use same connection code posted by Sugi Ardana.
I have to use 32 bit runtime instead 64 bit in Windows 2008 Server?
I have to made some changes in configuration?
Thank you in advance,
Guglielmo
Hello,
If your app is complied for 64 bit then you need the 64 bit client installed and configured. If your app is running in 32 bit mode the you need the 32 bit client installed and configured.
Thank you
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am using CR with visual studio 2010 in windows 7 box 64bit box. using a ADO.net data source. And I need to export .rpt as pdf.The solution works fine in my dev box. by when i try to deploy in a windows server 2008 R2 box (64bit) it fails . Both my dev box and deplyment box uses sql server 2008 DB . Also i am using .Net framework 4.0 (not client profile)
installed the following things in deployment box:
1. CRRuntime_64bit_13_0_1.msi in
2. Also copied the CRforVS_mergemodules_13_0_1 in C:\Program Files (x86)\Common Files\Merge Modules
I get the following error in my Box:
CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName) at Tesco.Instore.PickingControl.ReportController.PrintDriverDocumentation(String driverDocumentation, Int32 vehicleTripId)] 20/10/2011 08:08:41 PCS Critical Classic .NET AppPool Error running End of Van [Logon failed.
Error in File temp_31b3196f-fd25-45c8-b657-5d9cd7c9dccb {4F74290C-D56E-4FC4-8DEF-371BB5C5B10B}.rpt:
Unable to connect: incorrect log on parameters.]
I also verified the database connection is upto date. while creating the solution
the project build is set to anyCPU.
is there anything else i have to install ?? Please help me ..I am trying this thing from last one week and have not got any proper solution till now
Set the project to 32 bit CPU.
When you set the project to Any CPU and deploying it to 64 bit OS, th eproject will be looking for 64 bit runtime, and 64 bit DB client.
If this is a 32 bit app, compile as 32 bit, make sure you have 32 bit datasource and client.
If this does not work, please create a new thread as this one is mrked as "answered".
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]
User | Count |
---|---|
75 | |
10 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.