ReportDocument.VerifyDatabase

Post Author: kumar_80no
CA Forum: Data Connectivity and SQL
Hi.. This is Kumar, running a small develoment shop in microsoft environment.. currently we are working on VB 2005, SQL Server 2000 & CR 10.. we used to design and develop crystal report externaly from .Net environment. like non embeded reports. we used to have OleDB ADO connection from CR 10 for the database.. just we call the report from the VB 2005 Report Viewer.. it works fine, but when we changed system to production environment.. the server and database names are changed.. we usually set logon information for the reportdocument in vb2005 before showing the reportdocument in Report viewer.. eventhough we set the logon information when we connect our application to the database in Production environment we found lot of problems..now the problem is that.. the report is not properly displaying in production environment but when we connect the database to the development environment where we developed the report is working fine.. when I use VerifyDatabase of Report document before showing it in report viewer then the system gives the first message that Logon failed and the second message it that "Invalid Mapping type value". already we are in deadline, we have to complete the project asap.. we have created nearly more than 200 reports. anyone please helpme out in this issuse.. thanks in advance.
-Kumar

Good morning
At this time, I'm not even sure if this report works anywhere? E.g.; does it work in the CR XI r2 designer on your development computer?
Re. what version to test this with. My assumption was that this works on your development computer, in code and in the designer(?).  
So, the sequence would be;
1) Get the report to work on your development computer in the CR designer (if you need help here, post to the [Report Design forum|SAP Crystal Reports;
2) If the report works in (1) above, get the report to work on your development computer from the app. Let me know if this does not work here. Make sure you have SP 6 for CR XI r2;
https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe
3) If it works in (1) and (2) above, try it from code on the deployed computer, ensuring you have used SP 6 for CR XI r2 runtime .
msm;
https://smpdl.sap-ag.de/~sapidp/012002523100000634042010E/crxir2sp6_net_mm.zip
msi;
https://smpdl.sap-ag.de/~sapidp/012002523100000633302010E/crxir2sp6_net_si.zip
4) If this works in (1) and (2) and not in (3), then this is where we want to try the designer on the deployed computer. Since you are using CR XI r2, download the CR XI r2 download from here;
http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
Ludek

Similar Messages

  • Reports fail when run against a different data source

    Hello,
    We have a VB.NET 2008 WinForms application running on Microsoft .NET 3.5. We are using Crystal Reports 2008 runtime, service pack 3 -- using the CrystalDecisions.Windows.Forms.CrystalReportViewer in the app to view reports. In the GAC on all our client computers, we have versions 12.0.1100.0 and 12.0.2000.0 of CrystalDecisions.CrystalReports.Engine, CrystalDecisions.Shared, and CrystalDecisions.Windows.Forms.
    Please refer to another one of our posted forum issues, u201CCritical issue since upgrading from CR9 to CR2008u201D, as these issues seem to be related:
    Critical issue since upgrading from CR9 to CR2008
    We were concerned with report display slow down, and we seemed to have solved this by using the Oracle Server driver (instead of either Microsoft's or Oracle's OLEDB driver).  But now we must find a resolution to another piece of the puzzle, which is:  why does a report break if one data source is embedded in the .rpt file is different than the one you are trying to run the report against, in the .NET Viewer?
    Problem:
    If you have a production database name (e.g. "ProdDB") embedded in your .rpt file that you built your report from and try to run that report against a development database (e.g. "DevDB") (OR VICE VERSA -- it is the switch that is the important concept here), the report fails with a list of messages such as this:
        Failed to retrieve data from the database
        Details:  [Database vendor code: 6550 ]
    This only seems to happen if the source of the report data (i.e. the underlying query) is an Oracle stored procedure or a Crystal Reports SQL Command -- the reports run fine against all data sources if the source is a table or a view).  In trying different things to troubleshoot this, including adding a ReportDocument.VerifyDatabase() call after setting the connection information, the Crystal Reports viewer will spit out other nonsensical errers regarding being unable to find certain fields (e.g. "The field name is not known), or not able to find the table (even though the source data should be coming from an Oracle stored procedure, not a table).
    When the reports are run in the Crystal Reports Designer, they run fine no matter what database is being used; but the problem only happens while being run in the .NET viewer.  It's almost as if something internally isn't getting fully "set" to the new data source, or something -- we're really grasping at straws here.
    For the sake of completeness of information, here is how we're setting the connection information
            '-- Set database connection info for the main report
            For Each oConnectionInfo In oCrystalReport.DataSourceConnections
                oConnectionInfo.SetConnection(gsDBDataSource, "", gsDBUserID, gsDBPassword)
            Next oConnectionInfo
            '-- Set database connection info for each subreport
            For Each oSubreport In oCrystalReport.Subreports
                For Each oConnectionInfo In oSubreport.DataSourceConnections
                    oConnectionInfo.SetConnection(gsDBDataSource, "", gsDBUserID, gsDBPassword)
                Next oConnectionInfo
            Next oSubreport
    ... but in troubleshooting, we've even tried an "overkill" approach and added this code as well:
            '-- Set database connection info for each table in the main report
            For Each oTable In oCrystalReport.Database.Tables
                With oTable.LogOnInfo.ConnectionInfo
                    .ServerName = gsDBDataSource
                    .UserID = gsDBUserID
                    .Password = gsDBPassword
                    For Each oPair In .LogonProperties
                        If UCase(CStr(oPair.Name)) = "DATA SOURCE" Then
                            oPair.Value = gsDBDataSource
                            Exit For
                        End If
                    Next oPair
                End With
                oTable.ApplyLogOnInfo(oTable.LogOnInfo)
            Next oTable
            '-- Set database connection info for each table in each subreport
            For Each oSubreport In oCrystalReport.Subreports
                For Each oTable In oSubreport.Database.Tables
                    With oTable.LogOnInfo.ConnectionInfo
                        .ServerName = gsDBDataSource
                        .UserID = gsDBUserID
                        .Password = gsDBPassword
                        For Each oPair In .LogonProperties
                            If UCase(CStr(oPair.Name)) = "DATA SOURCE" Then
                                oPair.Value = gsDBDataSource
                                Exit For
                            End If
                        Next oPair
                    End With
                    oTable.ApplyLogOnInfo(oTable.LogOnInfo)
                Next oTable
            Next oSubreport
    ... alas, it makes no difference.  If we run the report against a database that is different than the one specified with "Set Datasource Location" in Crystal, it fails with nonsense errors 

    Thanks for the reply, Ludek.  We have made some breakthroughs, uncovered some Crystal bugs and workarounds, and we're probably 90% there I hope.
    For your first point, unfortunately the information on the Oracle 6550 error was generic, and not much help in our case.  And for your second point, the errors didn't have anything to do with subreports at that time -- the error would manifest itself even in a simple, one-level report.
    However, your third point (pointing us to KB 1553921) helped move us forward quite a bit more.  For the benefit of all, here is a link to that KB article:
    Link: [KB 1553921|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333933323331%7D.do]
    We downloaded the tool referenced there, and pointed it at a couple of our reports.  The bottom line is that the code it generated uses a completely new area of the Crystal Reports .NET API which we had not used before -- in the CrystalDecisions.ReportAppServer namespace.  Using code based on what that RasConnectionInfo tool generated, we were able gain greater visibility into some of the objects in the API and to uncover what I think qualifies as a genuine bug in Crystal Reports.
    The CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable class exposes a property called QualifiedName, something that isn't exposed by the more commonly-used CrystalDecisions.CrystalReports.Engine.Table class.  When changing the data source with our old code referenced above (CrystalDecisions.Shared.ConnectionInfo.SetConnection), I saw that Crystal would actually change the Table.QualifiedName from something like "SCHEMAOWNER.PACKAGENAME.PROCNAME" to just "PROCNAME" (essentially stripping off the schema and package name).  Bad, Crystal...  VERY BAD!  IMHO, Crystal potentially deserves to be swatted on the a** with the proverbial rolled-up newspaper.
    I believe this explains why we were also able to generate errors indicating that field names or tables were not found -- because Crystal had gone and changed the QualifiedName to remove some key info identifying the database object!  So, knowing this and using the code generated by the RasConnectionInfo tool, we were able to work around this bug with code that worked for most of our reports ("most" is the key word here -- more on that in a bit).
    So, first of all, I'll post our new code.  Here is the main area where we loop through all of the tables in the report and subreports:
    '-- Replace each table in the main report with new connection info
    For Each oTable In oCrystalReport.ReportClientDocument.DatabaseController.Database.Tables
        oNewTable = oTable.Clone()
        oNewTable.ConnectionInfo = GetNewConnectionInfo(oTable)
        oCrystalReport.ReportClientDocument.DatabaseController.SetTableLocation(oTable, oNewTable)
    Next oTable
    '-- Replace each table in any subreports with new connection info
    For iLoop = 0 To oCrystalReport.Subreports.Count - 1
        sSubreportName = oCrystalReport.Subreports(iLoop).Name
        For Each oTable In oCrystalReport.ReportClientDocument.SubreportController.GetSubreportDatabase(sSubreportName).Tables
            oNewTable = oTable.Clone()
            oNewTable.ConnectionInfo = GetNewConnectionInfo(oTable)
            oCrystalReport.ReportClientDocument.SubreportController.SetTableLocation(sSubreportName, oTable, oNewTable)
        Next oTable
    Next iLoop
    '-- Call VerifyDatabase() to ensure that the tables update properly
    oCrystalReport.VerifyDatabase()
    (Thanks to Colin Stynes for his post in the following thread, which describes how to handle the subreports):
    Setting subreport connection info at runtime
    There seems to be a limitation on the number of characters in a post on this forum (before all formatting gets lost), so please see my next post for the rest....

  • Database Logon Failed which created by Crystal Report 2008

    this time i meet the famous error again which is database logon failed.
    i created a crystal report 2008 starting from blank report, then connect with odbc
    i use 2008 method
    objRpt.SetDatabaseLogon(db_username, db_password, odbc_name, database_name);
    2008 method will get database logon failed even set database location and verify database again
    then i use 8.5 method and try again for 2008 report. it said field name is unknown for one of formula
    then i drag field again for formula and set database location and verify database again
    it said the same error.
    then i uninstall 8.5 crytal report software in window 7 deployment machine, and do above again, it said the same error
    //'Create a new Stored Procedure Table to replace the reports current table.
            CrystalDecisions.ReportAppServer.DataDefModel.Procedure boTable = new CrystalDecisions.ReportAppServer.DataDefModel.Procedure();
            //'boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
            PropertyBag boMainPropertyBag = new PropertyBag();
            //'boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
            //'In the main property bag (boMainPropertyBag)
            PropertyBag boInnerPropertyBag = new PropertyBag();
            //'Set the attributes for the boInnerPropertyBag
            boInnerPropertyBag.Add("Connect Timeout", "15");
            //boInnerPropertyBag.Add("Data Source", "MyDataSource");
            boInnerPropertyBag.Add("Data Source", "10.1.1.191");
            boInnerPropertyBag.Add("DataTypeCompatibility", "0");
            boInnerPropertyBag.Add("General Timeout", "0");
            //boInnerPropertyBag.Add("Initial Catalog", "MyCatalog");
            boInnerPropertyBag.Add("Initial Catalog", database_name);
            boInnerPropertyBag.Add("Integrated Security", "False");
            boInnerPropertyBag.Add("Locale Identifier", "1033");
            boInnerPropertyBag.Add("MARS Connection", "0");
            //boInnerPropertyBag.Add("OLE DB Services", "-5");
            //boInnerPropertyBag.Add("ODBC", "-5");
            boInnerPropertyBag.Add("ODBC", "Cheque");
            boInnerPropertyBag.Add("Provider", "SQLNCLI");
            boInnerPropertyBag.Add("Tag with column collation when possible", "0");
            boInnerPropertyBag.Add("Trust Server Certificate", "0");
            boInnerPropertyBag.Add("Use Encryption for Data", "0");
            //'Set the attributes for the boMainPropertyBag
            boMainPropertyBag.Add("Database DLL", "crdb_ado.dll");
            //boMainPropertyBag.Add("Database DLL", "p2sodbc.dll");
            //boMainPropertyBag.Add("QE_DatabaseName", "VEPILOT");
            boMainPropertyBag.Add("QE_DatabaseName", database_name);
            //boMainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)");
            boMainPropertyBag.Add("QE_DatabaseType", "ODBC");
            //'Add the QE_LogonProperties we set in the boInnerPropertyBag Object
            boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
            boMainPropertyBag.Add("QE_ServerDescription", "MyServer");
            boMainPropertyBag.Add("QE_SQLDB", "True");
            boMainPropertyBag.Add("SSO Enabled", "False");
            //'Create a new ConnectionInfo object
            CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
            //'Pass the database properties to a connection info object
            boConnectionInfo.Attributes = boMainPropertyBag;
            //'Set the connection kind
            boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
            //'*EDIT* Set the User Name and Password if required.
            boConnectionInfo.UserName = db_username;
            boConnectionInfo.Password = db_password;
            //'Pass the connection information to the table
            boTable.ConnectionInfo = boConnectionInfo;
    CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables = objRpt.ReportClientDocument.DatabaseController.Database.Tables;
                CrystalDecisions.CrystalReports.Engine.Tables tables = objRpt.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
                    if (!string.IsNullOrEmpty(table.Name))
                        //boTable.Name = table.Name;
                        //boTable.QualifiedName = database_name + ".dbo." + table.Name;
                        //boTable.Alias = table.Name;
                        boTable.Name = "sp_ChequeIssueDetRpt";
                        boTable.QualifiedName = database_name + ".dbo.sp_ChequeIssueDetRpt";
                        boTable.Alias = "sp_ChequeIssueDetRpt";
                        objRpt.ReportClientDocument.DatabaseController.SetTableLocation(boTables[0], boTable);
                objRpt.VerifyDatabase();
    http://sourceforge.net/projects/aspchequesprint/files/ChequeIssueDet.rpt/download

    No subreport, only a stored procedure with final two lines are
    print @m_sql
    exec (@m_sql)
    After use generated code in the link above
    Error at boReportDocument.VerifyDatabase();
    Inner Exception : no error
    Message "Logon failed"
    ErrorID : CrystalDecisions.CrystalReports.Engine.EngineExceptionErrorID.LogOnFailed
    HelpLink : null
    stacktrace :  CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()\r\n   at viewReport.Page_Load(Object sender, EventArgs e) 於 d:
    Data
    My Documents
    Visual Studio 2008
    WebSites
    Cheques
    viewReport.aspx.cs: row 1302\r\n   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n   at System.Web.UI.Control.OnLoad(EventArgs e)\r\n   at System.Web.UI.Control.LoadRecursive()\r\n   於 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    TargetSite : {Void VerifyDatabase()}
    string reportPath = report_path + "ChequeIssueDet.rpt";
                boReportDocument = new ReportDocument();
                //**EDIT** Change the path and report name to the report you want to change.
                boReportDocument.Load(reportPath, OpenReportMethod.OpenReportByTempCopy);
                //Create a new Stored Procedure Table to replace the reports current table.
                CrystalDecisions.ReportAppServer.DataDefModel.Procedure boTable =
                new CrystalDecisions.ReportAppServer.DataDefModel.Procedure();
                //boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
                PropertyBag boMainPropertyBag = new PropertyBag();
                //boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
                //In the main property bag (boMainPropertyBag)
                PropertyBag boInnerPropertyBag = new PropertyBag();
                //Set the attributes for the boInnerPropertyBag
                boInnerPropertyBag.Add("Database", database_name);
                boInnerPropertyBag.Add("DSN", "Cheque");
                boInnerPropertyBag.Add("UseDSNProperties", "False");
                //Set the attributes for the boMainPropertyBag
                boMainPropertyBag.Add("Database DLL", "crdb_odbc.dll");
                boMainPropertyBag.Add("QE_DatabaseName", database_name);
                boMainPropertyBag.Add("QE_DatabaseType", "ODBC (RDO)");
                //Add the QE_LogonProperties we set in the boInnerPropertyBag Object
                boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
                boMainPropertyBag.Add("QE_ServerDescription", "Cheque");
                boMainPropertyBag.Add("QE_SQLDB", "True");
                boMainPropertyBag.Add("SSO Enabled", "False");
                //Create a new ConnectionInfo object
                CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo =
                new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
                //Pass the database properties to a connection info object
                boConnectionInfo.Attributes = boMainPropertyBag;
                //Set the connection kind
                boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
                //**EDIT** Set the User Name and Password if required.
                boConnectionInfo.UserName = db_username;
                boConnectionInfo.Password = db_password;
                //Pass the connection information to the table
                boTable.ConnectionInfo = boConnectionInfo;
                //Get the Database Tables Collection for your report
                CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables;
                boTables = boReportDocument.ReportClientDocument.DatabaseController.Database.Tables;
                //For each table in the report:
                // - Set the Table Name properties.
                // - Set the table location in the report to use the new modified table
                boTable.Name = "sp_ChequeIssueDetRpt;1";
                boTable.QualifiedName = database_name+".dbo.sp_ChequeIssueDetRpt;1";
                boTable.Alias = "sp_ChequeIssueDetRpt;1";
                boReportDocument.ReportClientDocument.DatabaseController.SetTableLocation(boTables[0], boTable);
                //Verify the database after adding substituting the new table.
                //To ensure that the table updates properly when adding Command tables or Stored Procedures.
                boReportDocument.VerifyDatabase();
                //**EDIT** Set the value for the Stored Procedure parameters.
                string m_curUser = "";
                int spid = Convert.ToInt32(Request.Cookies["login_cookie"]["spid"]);
                queryString = "select * from v_All_Session where SPID=" + spid.ToString();
                //string _connectionString = ConfigurationManager.ConnectionStrings["ChequeConnectionString"].ConnectionString;
                using (SqlConnection connection = new SqlConnection(_connectionString))
                    SqlCommand command = connection.CreateCommand();
                    command.CommandText = queryString;
                    connection.Open();
                    using (SqlDataReader datareader = command.ExecuteReader())
                        if (datareader.HasRows == true)
                            while (datareader.Read())
                                if (datareader["UserID"] != System.DBNull.Value)
                                    m_curUser = datareader["UserID"].ToString();
                        datareader.Close();
                    connection.Close();
                boReportDocument.SetParameterValue("@UserID", m_curUser);
                if (string.IsNullOrEmpty(Session["fm_CoCode"].ToString()))
                    boReportDocument.SetParameterValue("@fm_CoCode", Session["fm_CoCode"].ToString());
                if (string.IsNullOrEmpty(Session["to_CoCode"].ToString()))
                    boReportDocument.SetParameterValue("@to_CoCode", Session["to_CoCode"].ToString());
                if (string.IsNullOrEmpty(Session["fm_BankACNo"].ToString()))
                    boReportDocument.SetParameterValue("@fm_BankACNo", Session["fm_BankACNo"].ToString());
                if (string.IsNullOrEmpty(Session["to_BankACNo"].ToString()))
                    boReportDocument.SetParameterValue("@to_BankACNo", Session["to_BankACNo"].ToString());
                if (string.IsNullOrEmpty(Session["fm_BatchNo"].ToString()))
                    boReportDocument.SetParameterValue("@fm_BatchNo", Session["fm_BatchNo"].ToString());
                if (string.IsNullOrEmpty(Session["to_BatchNo"].ToString()))
                    boReportDocument.SetParameterValue("@to_BatchNo", Session["to_BatchNo"].ToString());
    Edited by: Mathew_666 on Jul 19, 2011 4:27 AM
    Edited by: Mathew_666 on Jul 19, 2011 4:28 AM

  • "Logon Failed" Exception with CR2008 SP1/SP2 on WIN2008 Server

    Hi,
    we have a problem running our .NET Application on a WIN2008 SP2 server. The code which works fine
    with all VISTA / WIN-XP / WIN7 or WIN 2003 OS. producese an exception when running on WIN2008:
    CrystalDecisions.CrystalReports.Engine.LogOnException: Fehler bei Anmeldung. ---> System.Runtime.InteropServices.COMException (0x80000000):
    Kein Fehler.
       bei CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.VerifyDatabase()
       bei CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.VerifyDatabase()
       bei CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()
       --- Ende der internen Ausnahmestapelüberwachung ---
    The problem is absulutely reproducable and occours with evrey report in rh application.
    The database is SQL2005.
    br
    Axel

    Easiest way to start to troubleshoot this is to install the CR designer on that server - just as a test. Then try to run the report in the designer. Does it work there? The next easiest way to start to troubleshoot this is to create a one line windows app (crystalreportviewer1.reportsource). Let the report prompt for the logon parameters. Does this win app works? In this way you at least start to determine if this is some runtime issue (CR, db client, etc.) or a permission issue.
    Ludek

  • From Crystal 11.5 app VB6 to VS2003 Crystal 2008

    We are converting a Crystal VB6 application into C# with Crystal 2008 (VS2003). We will be processing existing reports from versions 11.5 down to version 10.
    Here are some VB6 statements, what are the equivalent in the .NET Crystal 2008 api
    1) CRAXDRT.Report.VerifyOnEveryPrint = false
    they did this on VB because they did not wanted any addition report refresh or verification of the database
    I see that there is a EnableVerifyOnEveryPrint property, but it is not clear how to access it using the ReportDocument. The ReportOptions from the ReportDocument do not include VerifyOnEveryPrint.
    2) CRAXDRT.Report.EnableParameterPrompting = false
    Disable parameter prompting
    3) CRAXDRT.Report.EnableSelectDistinctRecords = true
    Thanks

    1. The ReportDocument.VerifyDatabase will check the database is available and that the logon information is correct.
    2. The closest equivalent will be the CrystalReportViewer.EnableParameterPrompt. The ReportDocument doesn't have the ability to prompt for parameters values.
    3. I wasn't able to find this one.
    All this information is available by reviewing the API Reference Guide [here|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm].

  • Log On Failed. COMException (0x80000000): No Error.

    Version of Crystal Reports Designer: 12.0.0683
    Visual Studio 2005
    OS Vista Ultimate
    I have designed a report that uses an XML file as a data source.  In the deigner, the connection I am using is XML and Web Serivces.  I specify the XML and the schema file.
    I have a Windows application that creates a dataset from an XML file and sets it as the report's data source. 
    After I run VerifyDatabase I get the following error:
    Log on failed., System.Runtime.InteropServices.COMException (0x80000000):
    No error.
       at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.VerifyDatabase()
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.VerifyDatabase()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()
    Here is my code:
            Try
                Dim PathToDB As String = mReportLog
                Me.crPrinterUse = New AXIARReports
                Dim ds As Data.DataSet = clsDataSet.ReportDataSet(PathToDB)
                Me.crPrinterUse.SetDataSource(ds)
                Me.crPrinterUse.Database.Tables(0).SetDataSource(ds.Tables(0))
                Dim SubReport As CrystalDecisions.CrystalReports.Engine.ReportDocument
                For i As Integer = 0 To Me.crPrinterUse.Subreports.Count - 1
                    SubReport = Me.crPrinterUse.Subreports(i)
                    SubReport.SetDataSource(ds)
                    SubReport.Database.Tables(0).SetDataSource(ds.Tables(0))
                Next
                Me.crPrinterUse.VerifyDatabase()
                Me.crv.ReportSource = Me.crPrinterUse
            Catch ex As Exception
                MessageBox.Show("Error setting report data: " & ex.Message & vbLf & "Check the log file for more details.", _
                    "Report Data Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                cGlobal.Log("Error setting report data: " & ex.Message & ", " & ex.InnerException.ToString)
                Throw New Exception(ex.Message)
            End Try
    I ran the modules appliacation and noticed that the development machine version is slightly different from the deployed machine.
    Version of file on the deployed machine: 12.0.0.840
    Could this be causing my porblem?  If so, how do I solve this?
    I also have VS 2008 installed on my machine.
    Thanks,
    Karen

    Thanks for your reply Ludek.
    I performed the steps in your blog.  Using the XML file that the data set creates with the embeded schema gives me no mapping errors.
    I simplifiied my report to the simplest form, just a few fields in the details. I simplified the XML source file to just two records and found that the report is loading the data file in the connection used at design time.  I have checked off Save Data with Report.  So there must be some step that I am missing so that the report at runtime accepts the data set as the new data an not attempt to connect.
    I will review my code again and see if there is something essential that I missed.  I will report back.
    Karen

  • Log on Failed error

    I've a report developed with DB2 9.7.5. It works fine in Crystal Report designer on my machine with local DB2 server with one of the database. It works fine from my ASP.NET application as long as I connect to same database. But if I chnage the database, I keep getting log on failed error. Then, if I change the report in crystal reports designer and connect to the other database and perform check dependencies, it starts working again.
    The report is developed using couple of stored procedures and it has multiple subreports. I verified that the stored procedures are exactly same on other database and the userID to connect to both databases has exact same privileges.
    Also, I get the same error when I try to connect another server with another copy of DB2 database. In this case, even if I use crystal reports designer to connect and save, it doesn't work.
    Following is my code when I try to connect. The interesting thing is call to subreport.VerifyDatabase() works fine. But call to m_rpt.VerifyDatabase() throws exception.
    ReportDocument m_rpt;
                    if (m_rpt.Subreports != null && m_rpt.Subreports.Count > 0)
                        foreach (ReportDocument subrpt in m_rpt.Subreports)
                            foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in subrpt.Database.Tables)
                                CrystalDecisions.Shared.TableLogOnInfo logInfo = tbl.LogOnInfo;
                                logInfo.ConnectionInfo.DatabaseName = m_strDBName;
                                logInfo.ConnectionInfo.ServerName = m_strDSN;
                                logInfo.ConnectionInfo.UserID = m_strDBUserID;
                                logInfo.ConnectionInfo.Password = m_strDBPassword;
                                tbl.ApplyLogOnInfo(logInfo);
                            subrpt.VerifyDatabase();
                    foreach(CrystalDecisions.CrystalReports.Engine.Table tbl in m_rpt.Database.Tables)
                        CrystalDecisions.Shared.TableLogOnInfo logInfo = tbl.LogOnInfo;
                        logInfo.ConnectionInfo.DatabaseName = m_strDBName;
                  logInfo.ConnectionInfo.ServerName = m_strDSN;
                        logInfo.ConnectionInfo.UserID = m_strDBUserID;
                        logInfo.ConnectionInfo.Password = m_strDBPassword;
                  tbl.ApplyLogOnInfo(logInfo);
                    m_rpt.VerifyDatabase();
    Edited by: kushalkaleshwari on Mar 5, 2012 5:54 PM

    Following is the exception:
    -          excep     {"Log on failed."}     System.Exception {CrystalDecisions.CrystalReports.Engine.LogOnException}
    +          [CrystalDecisions.CrystalReports.Engine.LogOnException]     {"Log on failed."}     CrystalDecisions.CrystalReports.Engine.LogOnException
    +          Data     {System.Collections.ListDictionaryInternal}     System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
              HelpLink     null     string
    -          InnerException     {"\rNo error."}     System.Exception {System.Runtime.InteropServices.COMException}
    +          [System.Runtime.InteropServices.COMException]     {"\rNo error."}     System.Runtime.InteropServices.COMException
    +          Data     {System.Collections.ListDictionaryInternal}     System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
              HelpLink     null     string
    +          InnerException     null     System.Exception
              Message     "\rNo error."     string
              Source     "Analysis Server"     string
              StackTrace     "   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.VerifyDatabase()\r\n   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.VerifyDatabase()\r\n   at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()"     string
    -          TargetSite     {Void VerifyDatabase()}     System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
    +          [System.Reflection.RuntimeMethodInfo]     {Void VerifyDatabase()}     System.Reflection.RuntimeMethodInfo
    +          base     {Void VerifyDatabase()}     System.Reflection.MemberInfo {System.Reflection.RuntimeMethodInfo}
              Attributes     FamANDAssem | Family | Virtual | HideBySig | VtableLayoutMask     System.Reflection.MethodAttributes
              CallingConvention     Standard | HasThis     System.Reflection.CallingConventions
              ContainsGenericParameters     false     bool
              IsAbstract     false     bool
              IsAssembly     false     bool
              IsConstructor     false     bool
              IsFamily     false     bool
              IsFamilyAndAssembly     false     bool
              IsFamilyOrAssembly     false     bool
              IsFinal     false     bool
              IsGenericMethod     false     bool
              IsGenericMethodDefinition     false     bool
              IsHideBySig     true     bool
              IsPrivate     false     bool
              IsPublic     true     bool
              IsSecurityCritical     true     bool
              IsSecuritySafeCritical     true     bool
              IsSecurityTransparent     false     bool
              IsSpecialName     false     bool
              IsStatic     false     bool
              IsVirtual     true     bool
    +          MethodHandle     {System.RuntimeMethodHandle}     System.RuntimeMethodHandle
    +          Non-Public members          
    +          Static members          
    +          Non-Public members          
              Message     "Log on failed."     string
              Source     "CrystalDecisions.CrystalReports.Engine"     string
              StackTrace     "   at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()\r\n   at WebUtilLib.ReportCacher2.ApplyLogonInfo(String strDSN, String strDBName, String strDBUserID, String strDBPassword, String strDBType)"     string
    +          TargetSite     {Void VerifyDatabase()}     System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
    +          Static members          
    +          Non-Public members

  • Supressing some parameters on the input dialog

    Should I be able to supress some parameters from showing up on the enter parameters values dialog?
    There are a number of parameters needed for the main report to run.  I have a sureport with 10 static parameters.  Each with default values assigned. 
    I would like the parameters from the subreport to be excluded from the main report's enter parameter dialog box.  I have tried the SetParameterValue method for all these static parameters on the subreport hoping that when they do have a value assigned the would not show up in the initial dialog, but they still appear.
    Should I be able to stop these parameters from showing up?  If so, how??
    CR2008 SP1
    VS2005
    Thanks,
    Karen

    Hello, Karen;
    You are correct. Passing a valid value to the parameter in code should stop the parameter field from prompting at runtime.
    ReportDocument.SetParameterValue("ParameterName", "ParameterValue", "SubreportName")
    There may be other reasons why it does not work.
    Do you logon to the database for main and subreport before passing the parameters?
    Do you use ReportDocument.VerifyDatabase after you set the parameter values? That will clear the values you have set.
    If you look at Help|About Microsoft Visual Studio and scroll down to the Crystal Reports line, what does it say there?
    Elaine

  • LogOnException with mixed runtimes.

    I have a complex application with multiple reports running in the one address space, loaded dynamically.   The issue I am having is that reports developed on the new version of crystal reports are failing.  When I assign the data table to the report it crashes with:
    CrystalDecisions.CrystalReports.Engine.LogOnException: Log on failed. ---> System.Runtime.InteropServices.COMException (0x80000000): No error. at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.VerifyDatabase() at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.VerifyDatabase() at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase
    If I run the report using the newer version first it runs correctly.  If I run the older version crystal reports,  then run the newer version of the report it fails with the above.    I am absolutely certain it is run time versions being loaded.   I have also found out the reverse is true,  load VS2010 versions then running VS2008 versions the VS2008 versions fail.
    My first question,   can all back level reports run on the newer versions of the runtime?
    Second question,  is there a way I can force the newer version of the run time to be the only one loaded?
    The new reports are written with VS 2010 and the older reports are VS 2008.   I don't want to recompile the whole thing because I don't trust the source control as much as I should. I would rather do that one by one with controlled testing.
    I have also found a comment about .Net 4 and a legacy switch,  I am using .Net 3.5 for compatibility with existing code.

    Hello,
    Installing CR2008 and CR4VS2010 on a single machine is not recommended, some issues are encountered by side by side installation.
    I will suggest you to upgrade all your reports to the newer version.
    Thanks,
    Bhushan.

  • VS2008 - ReportDocument missing data when exporting to PDF

    Hi all,
    First and foremost, I'm using:
    - VS2008 with CR Basic (10.5.3700.0)
    - CR 2008 SP4 (12.4.0.966)
    - SQL Server 2008
    I've developed a small VB.Net application that's supposed to simply load a report, set appropriate connections and parameters and finally export it to PDF.
    While it works on simple reports, I'm having trouble with a report that uses a Stored Procedure to link between two tables. The PDF shows all the data that's obtained directly from tables, but misses the details that depend on the Stored Procedure.
    This same report previews perfectly on CR 2008 SP4, where it's been developed.
    What I've tried, based on SDN and general web search:
    - Different ODBC and OLE DB (both SQLOLEDB and SQLNCLI / SQLNCLI10): No change.
    - Compile in x86 and x64: No change.
    - Add report to VS2008 project and preview it: No change; same data shown, same data missing.
    - SQL Trace while previewing with CR2008 and exporting with .Net application: This showed something interesting; one fairly  simple SQL query when using CR2008 (that successfully returns data when pasted to SQL) was transformed into a query with several joins and cross joins (that does not return data when pasted to SQL) when using the application. Links being somehow changed, I presumed.
    - Printout all the Database.Links from the ReportDocument prior to exporting: showed they were all correct.
    - Following a post on this forum I've inserted a VerifyDatabase command after loading and setting connections: I now get an "Error in formula" stating that one of the Stored Procedure's fields that's used in a formula "is not known". Commenting this line  results (again) in a successfull export of a PDF... but with the same missing data.
    Any thoughts?
    Thanks in advance!
    Regards,
    Nuno
    Edited by: Nuno Pinto on Oct 6, 2011 3:41 AM
    Edited by: Nuno Pinto on Oct 6, 2011 3:46 AM

    I don't think the language was the problem, but I had problems teasing out the correct info I needed (e.g.; CR 10.5 vs. 12.x, 32 bit vs. 64 and so on. But I know where the problem is now:
    SAP Business One reports
    This is a special OEM build of Crystal Reports.
    It uses a database driver that CR 10.5 does not ship (something like crdb_SAPBusinessOne.dll (?))
    So, you can not use CR 10.5 as it is missing the driver.
    Using CR 2008 assemblies (12.x) will potentially be also problematic. While you will have the SAP One driver, you may not have the neccessary database logon APIs exposed.
    E.g.; more than likely, this will not work. But, you can try the following;
    Make sure you are using CR 2008 (e.g.; remove all of your CR 10.5 references)
    Look at the KB [1553921  - Is there a utility that would help in writing database logon code?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333933323331%7D.do]. there is a utility attached to the KB that will write out the DB logon code for you - in VB and C#. Use that code to try to connect to the report. The utility uses InProc RAS SDK which is part of CR 2008 and it is a free runtime - just like CR SDK. For basic info on working with InProc RAS SDK see the article [How to Use The RAS SDK .NET With In-Process RAS Server|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10b840c0-623f-2b10-03b5-9d1913866b32]
    Now, keep in mind that I have never seen, never mind worked with a report based on SAP Business One (thus my ignorance as to the name of the actual CR DB driver). So this may work. Or not. All I can do from here is keep my fingers crossed. But please do share any successes or failures...
    - Ludek
    Edited by: Ludek Uher on Oct 7, 2011 1:46 PM

  • ReportDocument Serialization Error v13sp2

    I posted this a week or so ago and no one responded.  So I'm putting it up again.  All I am trying to do is get the reportdocument object to serialize and store that in session.  It should be pretty simple.  But when I call out to the RAS DLL to serialize it, it returns null.  Even for a report with just a single label on it. 
    I'm trying to understand how the RAS provided classes can be used to serialize a reportdocument into a string. I have seen many examples from the help and other threads, from my own threads, etc. But for whatever reason I cannot get even the most basic report to serialize to a string. So I must be missing a required step or I have the wrong version of Crystal. I downloaded the latest I could find, which was version 13 release 2. I have just the free basic Crystal developer edition for VS.Net 2010.
    1.) What I did was create a report class and put a single label on the report. Then I run the report. It works fine.
    2.) Then I coded a simple web page to display the report using the CrystalReportsViewer. That works fine.
    3.) Then I tried to setup a test to serialize the report as a string using the RAS Utilities Conversion DLL. That doesn't work.
    In this example, I am just trying to get the string to be equal to something. Currently it is always set to nothing/null when this runs.
    Here's the code I am testing. Am I missing something?
    Dim myReport As New CrystalReport1  u2018Empty report with just a label in the header.
    myReport.VerifyDatabase()
    '***Serialize
    Dim boReportClientDocument As CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument
    boReportClientDocument = myReport.ReportClientDocument
    Dim myConversion As CrystalDecisions.ReportAppServer.Utilities.Conversion = New CrystalDecisions.ReportAppServer.Utilities.Conversion
    Dim mySerializedRcd As String = myConversion.ToString(boReportClientDocument)
    CrystalReportViewer1.ReportSource = boReportClientDocument.ReportSource
    Any guidance or suggestions would be much appreciated. I have gone through the SDK help and setup things as they show. But it just doesn't work for me. I must be missing something. The samples look pretty simple.
    Any thoughts?
    Best regards,
    Jon

    See this post for Jon other post: Re: RAS Serialization Test - Not Working!
    Hi Jon,
    Why are you trying to Serialize the report object if the reprots are simply saved on your PC?
    That function to be used with a BOE Server where the reports are saved in the CMS Database. It's not for standalone unmanaged report objects.
    And CR for VS 2010 doesn't ahve connectivity to BOE 4.0 or any other version.
    Go to help.sap.com and get the RAS SDK help chm file and then search:
    Report Application Server .NET SDK Developer Guide 
    To Serialize the ReportClientDocument 
    Collapse All Expand All  Language Filter:All Language Filter:Multiple Language Filter:Visual Basic Language Filter:C# Language Filter:C++ Language Filter:J# Language Filter:JScript 
    Visual Basic (Declaration)
    Visual Basic (Usage)
    C#
    C++
    J#
    JScript
    To serialize a report:
    Create an instance of the Conversion class.
    Use the Conversion.ToString method to serialize the ReportClientDocument object.
    Return the serialized ReportClientDocument.
    Visual Basic Copy Code 
    Private Function SerializeRCD(ByVal rcd As ISCDReportClientDocument) As String
         Dim conversion As New CrystalDecisions.ReportAppServer.Utilities.Conversion()
         Dim serializedRCD As String = conversion.ToString(rcd)
         Return serializedRCD
    End Function
    C# Copy Code 
    private String SerializeRCD(ISCDReportClientDocument rcd)
         CrystalDecisions.ReportAppServer.Utilities.Conversion conversion = new CrystalDecisions.ReportAppServer.Utilities.Conversion();
         String serializedRCD = conversion.ToString(rcd);
         return serializedRCD;
    This list includes the namespaces used by the sample code:
    CrystalDecisions.Enterprise
    CrystalDecisions.ReportAppServer.ClientDoc
    CrystalDecisions.ReportAppServer.DataSetConversion
    NOTE: the above indicates you need CrystalDecisions.Enterprise which doesn't exist in CR for VS 2010.
    Don
    Edited by: Don Williams on Dec 17, 2011 3:01 PM

  • In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File

    Post Author: bhaveshbusa
    CA Forum: Crystal Reports
    In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File. When the application calls ReportDocument.Load(reportFileName). This
    tries to connect to the database using the connection information embedded in
    the "reportFileName". This was only realised on checking the ODBC Trace
    Log. The connection itself is not a problem. The problem is that the embedded
    connection information is related to OLD production system. And failed
    connections had raised some concerns.
    Note: I am using
    SetDataSource to populate the data for the report. So I don't need the
    connection.
    Is there any way I
    can disable this auto-connect?
    Thanks and
    regards,
    Bhavesh

    960738 wrote:
    I need a help in answering one of the issue encountered last week.
    I have created a database link and tried to access the information from a table using the program written in another language. The password provided was incorrect for that user while creating database link. So we expected that,while retrieving the data, Database connection has to be errored out as password provided is incorrrect.
    But unfortunately, user account was locked out. When i checked with DBAs they mentioned that it tries to connect 16 ports with in a min of time.we were shocked as it STOPS another scheduled jobs with that user. and affects production badly.
    As per the program, it has to connect only one time and yesterday we tried to execute the program in DBAs observation and it errored out as expected. Didn't tried for multiple ports.
    Now the question is, WHY the database connection established 16 times last week and caused user account locked. DBAs are unable to answer it. Any EXPERTs opinion on this would greatly appreciated.
    I have verified managing ports in oracle documentation, it was mentioned that if one port is busy it will try to connect to another port in the range of ports mentioned during the installtion. DBAs verified ports related file and it was blank. and they are not agreeing with this reason. Please HELP me in finding the correct REASON for this.
    is it a NETWORK issue or issue with DATABASE SERVER only?
    Thanks
    SSP
    Edited by: 960738 on Sep 22, 2012 9:13 PMDBLINK is 100% oblivious to the fact any port exists.
    DBLINK only contains username, password & TNS Alias.
    can you post actual SQL & results?

  • Upgrading Crystal Reports XI Release 2 to CR 2008: Where is ReportDocument

    I am attempting to upgrade our .NET Crystal Reports code from Crystal Reports XI Release 2 on Visual Studio 2005 SP1 to Crystal Reports 2008 on the same compiler.  We use the ReportDocument interface and I can't seem to find it in the new Crystal Reports 4.0 managed directory.  Here's the top of the .header file that worked in the old environment:
    #using <CrystalDecisions.Shared.dll>
    #using <CrystalDecisions.CrystalReports.Engine.dll>
    #using <CrystalDecisions.Enterprise.InfoStore.dll>
    using namespace CrystalDecisions::Shared;
    using namespace CrystalDecisions::CrystalReports::Engine;
    With that code in place, I get compiler errors indicating that the packages can't be found:
    c:\dev\sources\videoview_6_6\video\nextlink\reportfaxservice\NReportFaxServiceImpl.h(13) : fatal error C1107: could not find assembly 'CrystalDecisions.Shared.dll': please specify the assembly search path using /AI or by setting the LIBPATH
    environment variable
    If I comment out the lines as follows and add in the ReportDefModel (the only dll that appears to have a ReportDocument symbol):
    // #using <CrystalDecisions.Shared.dll>
    // #using <CrystalDecisions.CrystalReports.Engine.dll>
    #using <CrystalDecisions.Enterprise.InfoStore.dll>
    #using <CrystalDecisions.ReportAppServer.ReportDefModel.dll>
    // using namespace CrystalDecisions::Shared;
    // using namespace CrystalDecisions::CrystalReports::Engine;
    using namespace CrystalDecisions::ReportAppServer::ReportDefModel;
    Then, I get compiler errors like this:
    NReportFaxServiceImpl.cpp(306) : error C2039: 'Close' : is not a member of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
            c:\dev\businessobjects\common\4.0\managed\crystaldecisions.reportappserver.reportdefmodel.dll : see declaration of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
    NReportFaxServiceImpl.cpp(941) : error C2039: 'Load' : is not a member of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
            c:\dev\businessobjects\common\4.0\managed\crystaldecisions.reportappserver.reportdefmodel.dll : see declaration of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
    NReportFaxServiceImpl.cpp(950) : error C2039: 'SetParameterValue' : is not a member of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
            c:\dev\businessobjects\common\4.0\managed\crystaldecisions.reportappserver.reportdefmodel.dll : see declaration of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
    NReportFaxServiceImpl.cpp(974) : error C2039: 'ExportToDisk' : is not a member of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
            c:\dev\businessobjects\common\4.0\managed\crystaldecisions.reportappserver.reportdefmodel.dll : see declaration of 'CrystalDecisions::ReportAppServer::ReportDefModel::ReportDocument'
    Here's line 306 of that source file, for example:
    NReportFaxServiceImpl::~NReportFaxServiceImpl()
         DESTLOG( LOG_NREPORTSERVER, "NReportFaxServiceImpl::~NReportFaxServiceImpl", "[[[]]]" );
         RFaxCloseServerHandle( _hRightFaxServer );
         //  close all the report documents
            IDictionaryEnumerator^ enumReportDocuments = _mapReportDocuments->GetEnumerator();
            while( enumReportDocuments->MoveNext() )
             Object^ reportName = enumReportDocuments->Key;
             ReportDocument^ crReportDocument = dynamic_cast<ReportDocument^>(enumReportDocuments->Value);
    /* line 306 */         crReportDocument->Close();
    Can anyone advise me of the correct #using directive to specify to pull in the ReportDocument object?
    Thanks.

    Okay, we seem to be getting somewhere.  I switched the /AI directive to point to the managed/dotnet2 directory, but then I get the following warning:
    c:\dev\sources\videoview_6_6\video\nextlink\reportfaxservice\NReportFaxServiceImpl.h(15) : fatal error C1107: could not find assembly 'CrystalDecisions.Enterprise.InfoStore.dll': please specify the assembly search path using /AI or by setting the LIBPATH environment variable
    NMAKE : fatal error U1077: 'c:\dev\VisualStudio\VC\bin\cl.EXE' : return code '0x2'
    So, I commented out the following line in the header:
    #using <CrystalDecisions.Enterprise.InfoStore.dll>
    Then, I get the following error when I try to make the project:
    NReportFaxServiceImpl.cpp(982) : error C3624: 'System::Drawing::Printing::PrinterSettings': use of this type requires a reference to assembly 'System.Drawing'
    NMAKE : fatal error U1077: 'c:\dev\VisualStudio\VC\bin\cl.EXE' : return code '0x2'
    Here is line 982:
                        crReportDocument->PrintToPrinter(1, false, 0, 0);  
    So, I'm assuming that maybe I need to provide an assembly search path to both the managed and the managed/dotnet2 directories.  Is that correct?  If so, is order dependent between those two /AI directives.
    Thanks.

  • Error when creating a ReportDocument object in ver 11.5.3300.0

    When I try to create a new ReportDocument from .NET the application exists with no other information. There is an event log entry similar to this one:
    Faulting application CrystalTest1.vshost.exe, version 9.0.21022.8, time stamp 0x47316898, faulting module unknown, version 0.0.0.0, time stamp 0x00000000, exception code 0xc0000005, fault offset 0x04525da0, process id 0x10fc, application start time 0x01c9c2d6d624913d.
    Investigating more I tracked down that the error happens when I try to create various COM objects from Crystal Reports (for example by running the following vbscript: Set o = CreateObject("CrystalClientDoc.ReportClientDocument")). The error is always an Access Violation in cachemanager.dll on address 3f8691b5:
    3F869172 push ebx
    3F869173 push esi
    3F869174 push edi
    3F869175 push 3F873464h
    3F86917A call dword ptr ds:3F86C04Ch
    3F869180 mov ebx,dword ptr esp+10h
    3F869184 mov esi,eax
    3F869186 mov eax,dword ptr esi
    3F869188 mov ecx,esi
    3F86918A mov dword ptr esi+4,ebx
    3F86918D call dword ptr eax+8
    3F869190 push esi
    3F869191 lea edi,esi+14h
    3F869194 push eax
    3F869195 mov ecx,edi
    3F869197 call 3F8690EE
    3F86919C mov edi,dword ptr edi
    3F86919E push edi
    3F86919F push 0FFFFFFFCh
    3F8691A1 push ebx
    3F8691A2 call dword ptr ds:3F86C254h
    3F8691A8 push dword ptr esp+1Ch
    3F8691AC push dword ptr esp+1Ch
    3F8691B0 push dword ptr esp+1Ch
    3F8691B4 push ebx
    3F8691B5 call edi
    3F8691B7 pop edi
    3F8691B8 pop esi
    3F8691B9 pop ebx
    3F8691BA ret 10h
    The full stack trace is:
    00455B60()
    cachemanager.dll!3f8691b7()
    http://Frames below may be incorrect and/or missing, no symbols loaded for cachemanager.dll
    user32.dll!7735f8d2()
    user32.dll!7735f794()
    user32.dll!7735f73d()
    user32.dll!77360817()
    user32.dll!773539f7()
    ntdll.dll!771f99ce()
    user32.dll!77353cf7()
    user32.dll!77353b94()
    user32.dll!77353cc3()
    atl71.dll!7c12c51d()
    atl71.dll!7c12c633()
    atl71.dll!7c121653()
    user32.dll!77353d9a()
    cachemanager.dll!3f86922f()
    cachemanager.dll!3f86949e()
    cachemanager.dll!3f869600()
    cachemanager.dll!3f868aec()
    msvcr71.dll!7c349565()
    kernel32.dll!760e4911()
    ntdll.dll!771de4b6()
    ntdll.dll!771de489()
    The address called at 3f8691b5 seem to always contain the following data in my case:
    00455B51 00 00 add byte ptr eax,al
    00455B53 00 00 add byte ptr eax,al
    00455B55 00 00 add byte ptr eax,al
    00455B57 00 DA add dl,bl
    00455B59 44 inc esp
    00455B5A 44 inc esp
    00455B5B 3A 00 cmp al,byte ptr eax
    00455B5D 00 00 add byte ptr eax,al
    00455B5F 8B db 8bh
    00455B60 C7 44 24 04 70 1F F4 01 mov dword ptr esp+4,1F41F70h
    00455B68 E9 4E 39 41 3F jmp 3F8694BB
    00455B6D 00 00 add byte ptr eax,al
    00455B6F 00 DF add bh,bl
    00455B71 44 inc esp
    00455B72 44 inc esp
    00455B73 3A 00 cmp al,byte ptr eax
    00455B75 00 00 add byte ptr eax,al
    00455B77 88 E0 mov al,ah
    00455B79 66 45 inc bp
    00455B7B 00 90 5B 45 00 B8 add byte ptr eax-47FFBAA5h,dl
    The data and the address seem to be always the same in my case.
    I am running 32-bit Vista Ultimate on a dual core Intel Centrino CPU. I have a Crystal Reports Deployment suite installed. The cachemanager.dll is 106,496 bytes and the file version is 11.5.8.998
    Pelase help!

    Hi Ludek,
    Thanks for looking into this.
    > What version of .NET are you using?
    I have all version of .NET installed but please note that .NET is not required to reproduce the problem. Please read again my initial post. The error can be reproduced with this single line of VB Script and there is no .NET involved:
    Set o = CreateObject("CrystalClientDoc.ReportClientDocument")
    The same can be reproduced by creating a new ReportDocument object from .NET in any type of .NET application.
    > What CR Service Pack are you on?
    I haven't installed any additional service packs. Please see the versions of the files I have on my system to figure out the service pack:
    Crystaldecisions.Crystalreports.Engine.dll file version = 11.5.9708.998
    cachemanager.dll file version = 11.5.8.998
    clientdoc.dll file version = 11.5.8.998
    The other computers where all works good have the same versions installed.
    > What .NET Service Pack are you on?
    All latest service packs and updates from Microsoft are installed
    > What is the version of the CR assembly crystaldecisions.Crystalreports.engine.dll referenced in your application?
    The assembly version is 11.5.3700.0, file version: 11.5.9708.998, file size: 393,216 bytes
    > Is this a web or a win app?
    The error happens in btoh web and windows forms applications as well as by simply trying to create the Crystal COM object directly from VB Script without involving any .NET. So the same error will occur if CR are used from VB6 for example.
    > What OS are you on?
    Again as per my original post I am using a 32-bit Vista Ultimate on a dual core Intel Centrino CPU
    > What happens if you try to run an existing application?
    I get a crash in unmanaged code in cachemanager.dll at 0x3f8691b7. All the details are in my original post (scroll up). When this happens in a .NET application, the process is terminated and Vista shows a message that the program has stoped working. There is an error in the event log (see my original post)
    > There are different ways of instantiating a report. The sample app vbnet_win_simplepreview has all of these. Running the app with the different options may give us a clue... Was Crystal Reports installed before .NET or after?
    Crystal Reports Basic for Visual Studio 2008 was installed with VS 2008. After that I installed Crystal Reports Server Deployment
    > Have you tried to reinstall Crystal Reports?
    Yes I did reinstall both Crystal Reports Basic for Visual Studio 2008 and Crystal Reports Server Deployment in reverse order (i.e. the server deployment first and then the basics)

  • Slow Initial ReportDocument.Load & Creation Of *.rptConMgrCache file

    Problem Description
    We have a .NET reporting application that utilizes CrystalReports (assembly version 12.0.2000.840) to render about 10 different reports. When loading a particular report template (*.rpt) using ReportDocument.Load, we have noticed that the initial load takes approximately 2-3 minutes. All subsequent loads of the same template take a fraction of a second.
    The strange thing is that this behavior only occurs on particular servers (all servers in our environment are Windows 2003). On the servers with the 2-3 minute initial load, a *.rptConMgrCache file is created during the initial load and deleted when the operation is completed. On the servers that don't have that issue, the initial load is about 10-15 seconds at worst and no *.rptConMgrCache file is created.
    Initial Load in this scenario refers to the first call to the ReportDocument.Load function after IIS has been reset. This delay on the initial load is only encountered on one of the 10 report templates. The others load consistently on all servers without generating the *.rptConMgrCache file.
    Questions
    1. What is the *.rptConMgrCache file that is created in the C:\Windows\Temp directory on the problematic servers? Why would some servers create this file while others do not?
    2. Is there a resolution to this issue? I encountered this forum thread with the same issue, but the solution is for an older version of CrystalReports:
    [Re: Creating Rpt Conmgr Cache File In Temp folder while opening report from app|Re: Creating Rpt Conmgr Cache File In Temp folder while opening report from app]
    Environment Details
    - Windows 2003 Servers
    - .NET 3.5 Application developed with Visual Studio 2008
    - Packaged Crystal Report Assembly Version: 12.0.2000.840
    - Latest GAC Crystal Report Assembly Version (all servers): 12.0.2000.0
    - Kirti
    Edited by: KirtiRK on Oct 12, 2010 5:45 PM

    Ludek,
         From the other posts and articles that I have read, I completely understand that the first load is supposed to take longer because the runtime is being loaded. I should have been more clear in my original post, but this is basically what I see in terms of performance:
    Troublesome Report Document
    Initial Load
    Good Server   ~10s
    Bad Server      2-3minutes**
    2-3 Minutes covers the range of the worst loads we've seen. But you're right that I'm sensationalizing it a bit - most of the delays are right around 1minute.
    Subsequent Loads
    Good Server    <1s
    Bad Server      <1s
    All Other Report Documents
    Initial Load
    Good Server   ~10s
    Bad Server     ~10s
    Subsequent Loads
    Good Server  < 1s
    Bad Server    < 1s
    Differences in Report
    Other reports have subreports and we verified that all of our report properties match exactly. There are definetely some layout differences and I can dig in to see if there is anything odd.
    Differences in Modules
    The modified dates are somewhat different for many of the modules/assemblies, but most of them match up exactly with file size and version. I will dig in here as well to see if I can find any notable differences.
    Environment Factor
    In the end, the same code/document behaves differently on some servers. Given that information, I think that it might end up being an environmental issues - wheter that is with the Crystal Reports installation or some other .NET setting, etc. Other than the delay, the only concrete difference we've seen is the creation of the *.rtpConMgrCache file in the C:\Windows\Temp directory.
    What I'm Looking For
    To guide me in researching and drilling down further, I was hoping to find out more about what the *.rptConMgrCache files are and understand why they are created on initial load on one server and not on another. Unfortunetely, I was not able to find too much information about this on the net/forums.
    - Kirti

Maybe you are looking for