Crystal report DataBase Connection Issue.

I am trying to change the connection string of the report file dynamically base on the connection info in the web.config.
I have connected to the database A while designing  the report if  to change the database dynamically to database B from code behind.
I have used the following code.
But getting an error as "DataBase Logon failed".
may some one help  in resolving this issue ASAP.
ParameterFields myParams = new ParameterFields();
                        ParameterField myParam = new ParameterField();
                        ParameterDiscreteValue myDiscreteValue = new ParameterDiscreteValue();
                        myParam.ParameterFieldName = "@ID";
                        myParam.ReportName = strreportfile;
                        myDiscreteValue.Value = Convert.ToInt32(Session["ID"]);
                        myParam.CurrentValues.Add(myDiscreteValue);
                        myParams.Add(myParam);
                                           CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
                        CrystalDecisions.Shared.TableLogOnInfo crConnectionInfo = new CrystalDecisions.Shared.TableLogOnInfo();
                        crConnectionInfo.ConnectionInfo.ServerName = ConfigurationManager.AppSettings["ServerName"].ToString();                        crConnectionInfo.ConnectionInfo.DatabaseName = ConfigurationManager.AppSettins["DatabaseName"].ToString();
                        crConnectionInfo.ConnectionInfo.UserID = ConfigurationManager.AppSettings["UserId"].ToString();
ConfigurationManager.AppSettings("UserID").ToString;
                        crConnectionInfo.ConnectionInfo.Password = ConfigurationManager.AppSettings["password"].ToString();
                        foreach (InternalConnectionInfo conn in objReportDocument.DataSourceConnections)
                            conn.SetConnection(crConnectionInfo.ConnectionInfo.UserID, crConnectionInfo.ConnectionInfo.Password, crConnectionInfo.ConnectionInfo.ServerName, crConnectionInfo.ConnectionInfo.DatabaseName);
                        CrystalReportViewer1.EnableParameterPrompt = false;
                      objReportDocument.OpenSubreport("test2.rpt");
                     objReportDocument.Subreports[0].SetDatabaseLogon(crConnectionInfo.ConnectionInfo.UserID, crConnectionInfo.ConnectionInfo.Password, crConnectionInfo.ConnectionInfo.ServerName, crConnectionInfo.ConnectionInfo.DatabaseName);
                        for (int index = 0; index <= reportdoc.Database.Tables.Count - 1; index++)
                          reportdoc.Database.Tables[index].ApplyLogOnInfo(crConnectionInfo);
                   CrystalReportViewer1.ParameterFieldInfo = myParams;
                        CrystalReportViewer1.ReportSource = objReportDocument;

Moved to .NET SDK forums.
SEARCH here, 100's of posts on how to debug your DB connection problem.
Good luck
Don

Similar Messages

  • Crystal Report Dynamic connection issue ORA-04043 Database Vendor Code 4043

    HI All,
    Ii am getting dynamic connection issue with Crystal Report 2008 and Business View Manager, i have Oracle database,
    i have done following steps
    1 Creating Dynamic Connection (including two connection XDC & YDC)
    2. Creating Data Foundation (Common object available in both connection ie. stored procedure)
    3. Creating Business View (with selected number of elements in business element, like firsta name, lastname)
    I have verified database connectivity from Business view manager, both the connection are working fine bringing different number of rows from two different schemas (different schema but same objects in two schemas)
    4. Database connectivity to different database schemas
    5. Connectivity from Crystal Report (done the connectivity from the repository to business view )
    6. Report Connectivity with first schema shows records
    7 Report Connectivity with second schemas shows error
    as follows Failed to retrive data from the database & on clicking of detail i get following error
    Crystal Reports
    Database Connector Error: 'ORA-04043: object HR.EXCEPTION_REPORT_SUB1_PROC [Database Vendor Code: 4043 ]'
    Q first of all i need to know if dynamic connection using business view manager and crystal report technically possible or not, if yes then please let me know the solution, since we did verified with SQL database and ite work with two different database.
    Q if not possible then are there any options to resolve dynamic deployment of crystal report over multiple schemas with crystal report 2008
    Any help or suggestion will be appriciated, hope some one might have got similar issue
    Thanks in advance
    Edited by: smunir on Jul 12, 2011 9:18 AM
    Edited by: smunir on Jul 12, 2011 9:41 AM
    Edited by: smunir on Jul 12, 2011 9:43 AM

    Hi,
    When i use same credentials in Tod or sqlplus it works perfect and gives appropriate results. But when i use same credentials using business view manager, the very first connection works but the second connection does not work
    Please suggest!
    Regards,
    <<smunir>>

  • Crystal Report Database connection problem in CMC

    Dear All,
    We are using Business Objects XI 3.1, Crystal Report 2008 SP1 for report development. Crystal reports are generated using SAP BW Query.
    Where in, once you have published Crystal report to Enterprise server and open the same using Infoview it gives error saying "database logon failed, check user name password"
    Did checked the database config tab in CMC there was no password and "Prompt user name password" option was enabled as well. when we type the password at the password text box, it is not accepting the same to store at the text box insted keep enpty always.
    Please let know what is the issue and guide me to over come the same.
    Thanks in advance.
    Regards
    Murugesh

    Hi,
    Is the account that runs the services of BOE on your OS able to ping the DB server. It may also lie in the fact that you have to do the correct setup steps for the SAP Integration Kit. Have you installed and configured this between your BW and BOE environment?
    Hope this helps...
    Martijn van Foeken
    Focuzz BI Services
    http://www.focuzz.nl
    http://nl.linkedin.com/in/martijnvanfoeken

  • Crystal report DB connect issue

    I am trying to understand why Crystal doesn't keep the database connection.
    Overview:
    I have Crystal on a company server.
    The reports were designed and run under user account1.
    I made user account2 and set up Crystal to run on same server with different account.
    It was working fine and then the next time I needed to refresh report data, the following screen comes up and I don't know how to resolve it.  The select data source doesn't show list available and the field explorer shows the database and its schema..  I don't know what to code in the Find File DSN because when I look in the folders, there are no options with the correct extension.
    Please help.
    Barry j.

    Hi Barry,
    The image you have inserted is not visible (not accessable).  Can you attach once again error message.
    Also have created FILE DSN (ODBC) under User or System ?  It should be always under System to make use of other users.
    -Sastry

  • Can not find Function module in Crystal Report Database Connections FN

    Hi,
    we designed a Function Module XX in SE80.
    We set up BO Interagtion for SAP
    We can connect to the R3( CRM) System.
    We can See FN's.
    We can not see our Function Module XX we designed in SE80 in the Database Connection
    What is missing ?
    Any Authorization missing ?
    Which Where
    Thanks
    Martin Sautter

    Yes,
    we just have got it:
    /Database Assistant / Data / My Connections/<myConnection>/FN -> Right Mice Button/ Options ->  Table Name Like: <MYTABLE>
    than
    /Right Mice Button/Regenerate
    Thanks
    Martin

  • Crystal Reports Server 2008 (Linux) - Crystal Reports/MySQL/ODBC Issue

    Hello,
    I have successfully installed CRS '08 on a Red Hat Enterprise Linux 4 server.  All services run fine.
    In the CMC, I have uploaded a Crystal Report that connect to a remote MySQL server. 
    I have installed the My SQL ODBC 3.51.11 and .12 Drivers as a System DSN.
    I have proven that the reports run fine in Crystal Reports 2008 directly against the remote MySQL DB server.
    (in Windows but with the same 3.51 ODBC Drivers)
    I have also proven that the database connection works okay from the CRS '08 Red Hat server to the remote MySQL DB server, when also creating a system DSN (using bash ./ODBCConfig)
    The problem is that when I log into the CMC or InfoView, and when I run the Crystal Reports from there, I get an error message:
    "Error in File <MyCrystalReport>: Failed to load database information"
    Is there something wrong with my specific Crystal Reports' Database Configuration? (Right click- Database Configuration)
    I see the driver was registered correctly in the /etc/odbc.ini file
    Am I supposed to set any other ODBC environment variables?
    Is there are firewall issue (port 3306 is already open)?
    In summary, the install was successful, and Crystal Reports can be uploaded and viewed via CMC or InfoView, but I cannot run the Crystal Reports against the database.
    Please advise, Thanks!

    Hi, I'm facing a similar problem. My ODBC DSN never works with CRS. Here are the details:<br><br>
    (1) I  installed the CRS 2008 in /opt/crystalreportsserver_2008_v1/ on a Linux platform. The CRS works well. I created a report with Crystal Reports 2008. This report directly connects to a MySQL server. After I published the report and manually modify its database configuration, I can browse it from InfoView. I'm sure that CRS, MySQL, and a report connecting to MySQL are all good.<br><br>
    (2) Then, I created an ODBC DSN on a Windows platform. This DSN connects to a MySQL server. I created another report with Crystal Reports using this DSN. The report can show the data within Crystal Reports.<br><br>
    (3) Then, I published the second report to CRS, but when I try to browse it, I always get such a message: Failed to open the connection.<br><br>
    I have configured the ODBC for CRS on the Linux server and I think the configuration is correct. This is how I do that: I edited the /opt/crystalreportsserver_2008_v1/bobje/odbc.ini file. In the file I added a data source called ods_telstar. Following is the content of the file:<br><br>
    [ODBC Data Sources]<br><
    CRSQLServerWP=DataDirect 5.3 SQLServer Wire Protocol Driver<br>
    CRSybaseWP=DataDirect 5.3 Sybase Wire Protocol Driver<br>
    CRText=DataDirect 5.3 Text Driver<br>
    %SYBASEDSN%=DataDirect 5.3 Sybase Wire Protocol Driver<br>
    ods_telstar = MySQL<br>
    <br>
    ... <br>
    <br>
    [ods_telstar]<br>
    Description     = ODS on telstar<br>
    Trace       = Off<br>
    TraceFile   = stderr<br>
    Driver      = /opt/crystalreportsserver_2008_v1/bobje/enterprise120/linux_x86/odbc/lib/libmyodbc5.so<br>
    SERVER      = xxx<br>
    USER        = xxx<br>
    PASSWORD    = xxx<br>
    PORT        = 3306<br>
    DATABASE    = ods<br>
    <br>
    In the middle I removed some data source definitions that are by default in the file. Note that I use "xxx" to replace the server name, user, and password. Such information is for internal use and I'm sure the original information is correct. The MySQL ODBC driver file has been put in the correct location. Correct access permissions has been assigned to the file.<br><br>
    I've tried to restart the CRS server, but still the report using ODBC DSN cannot be viewed.<br><br>
    The reason that we want to user ODBC DSN is that we may have many reports to publish. When we design the reports, we specify that they get data through an ODBC DSN such as ods_telstar. If we configure the same DSN on CRS, then we don't need manually modify each report's configuration after we publish them. If these reports are directly connecting to MySQL, then we have to manually modify each one's database configuration after we publish them.<br><br>
    I've no idea what's wrong with all the setup. Any suggestions and comments are appreciated!<br>

  • How to create a Crystal Report to connect to Oracle

    Hi,
    When I create a Crystal report to connect to SQL Server, I create a stored procedure to get all data I need and connect to it from Crystal Report.(In the stored procedure, I created temp tables, used cusor etc to run data.) But now I need to use a Oracle database. I heard I need to create a package and put this stored procedure in this package. Questions:
    1. if I need to create a package, how can I call the stored procedure from it?
    2. Can I create temp table in this procedure too? I need to create some temp tables to join together to get complex data.
    3. if I want the return data from stored procedure, do I still "select ... from ..." or there is another other ways?
    I am so desperated. Please help. I know this are very silly questions. But please.

    Hi Jenny,
    We are also using Crystal Reports for our Oracle Database, we normally just select the tables we want to use or create our own SQL query.
    However, if you really want to use Oracle stored-procedure (which performs faster than a SQL query because the stored procedure is compiled in advance), you can look at this document:
    http://support.businessobjects.com/communityCS/TechnicalPapers/scr_oracle_stored_procedures.pdf
    Hope this will answer your questions.

  • Crystal Reports - ECC - SSO Issue

    Team,
    System Details.
    1. BOE XI 3.1 SP3
    2. Crystal Reports 2008
    3. SAP ECC 6.0
    4. SAP NW 7.x
    Scenario: Crystal reports running against ECC system. SSO configured on Crystal Report database configuration option, report is accessed through SAP NW portal (which in turn is configured to BO Info View using KM IVIEW option). Report fails with "The database login information is either incomplete or incorrect" error message.
                                                                BUT the same user id (as the user id ) when hard coded ("Use same database logon as when report is run") in Crystal Reports database configuration static option ("Use original database logon information from the report") works fine.
    Please let me know your thoughts regarding how to debug this issue?

    Hi,
    if you want to have SSO for the report you need to :
    - have the SAP Authentication configured and the SAP Roles imported
    - the SAP Roles need to have the necessary rights on the BOE Server
    and in your case because of the portal part :
    - all machines need to be in the same domain
    - all URLS need to be fully qualified
    - trust between ECC and Portal needs to be configured
    - your ECC system needs to accept portal token
    ingo

  • Crystal Report DB Connection

    Hi,
    I want to design Custtomized reports for SAP Business One in Crystal Report. Please guide me how can I connect with the server and database so that it becomes general and I can use it in any SBO server at different client places without doing any changes in the report. If I use OLEDB provider for SQL then I need to replace the server everytime I change the server.
    Please tell me the way how it is done.

    Hi
    Search SDK forum for "Crystal"... I think so you can find solutions
    For example, I found very usefull this [Thread: How to Change Crystal Report database name from visual basic code?|How to Change Crystal Report database name from visual basic code?; for CR functions...
    Regards
    Sierdna S.

  • Seagate Crystal Reports: Database Error

    I am using Crystal reports Version 8 and frequently get the error 'Seagate Crystal Reports: Database Error' when I try to open a previously working crystal report file. The error occurs when I click on the Database menu. Every time I get this error I end up redesigning the report as the I have not yet found a solution and I cant run the report.
    The error is a message box with the title 'Seagate Crystal Reports: Database Error' and an ok button - nothing else.
    Its very frustrating!
    Please help.
    Thanks.

    Hi,
    What database are you using and how are you connecting to it? 
    What are you clicking in the Database menu:  Set Location, Verify Database, Show SQL Query?
    Before opening the report, can you connect to the database first then open the report? 
    I would have expected an error code or a more descriptive error to follow. 
    Thanks,
    Brian

  • Financial Report Database Connection

    Hello Guys,
    Is there any way to change the Financial Report Database Connection for multiple reports at a time?
    Thanks in Advance.
    Raz

    Try this (I am in HFM version 9.3.1)
    1) Put all the reports you want to change in the same folder
    From the web (Explore)
    2) When you go into Tools/Change Database Connections and get to the "Select Financial Documents to Change Database Connection" highlight all the reports you want changed.
    3)Click ok and then in the next screen change the connection.

  • *Crystal Reports 2008 connection to oracle 11g database error IM003*

    Hi ,
    I am getting the following error when connecting to Oracle 11 g database using Crystal Reports 2008.
    _Logon Failed:Details: IM003:Specified driver could not be loaded due to system error 127 ( Oracle in OraClient11g).
    Datebase Vendor Code:160.
    The Login and Pw that I am using are correct.
    *Could you please let me know any steps that i need to do to resolve this problem.
    Thanks!*

    Hello,
    I haven't seen that error in years... There was a version of Oracles client that did not put the client install into the PATH statement.
    Add the Oracle ...\Bin folder to your System Environment variables and then it should work.
    Thank you
    Don

  • Crystal Report ADO Connection Error

    I have a Crystal Reports created against an MS SQL Server DB using an ADO Connection (crdb_ado.dll). I am using a hardcoded user ID and password for logging into SQL Server, everything works fine when I log from Crystal Reports client, I am able to connect to SQL Server and refresh the report.
    When I publish to BOE and access from Infoview or CMC I get an error "[Failed to open the connection.
    xxxx report Details:  [Database Vendor Code: 17 ]]". I use the same account for SQL server under database config for Crystal report within CMC.
    Please see release info below:
    BOE XI 3.1 FP 3.1 (Windows 2008 server)
    Crystal Reports 2008 FP 3.1
    I have checked the  ADO dll version, size etc. on both client and BOE XI server and it looks the same.
    Are there any additional configuration required for this connection to work from BOE XI?
    I enabled log on BOE side and could not get anymore information other than the above message. We also tried with the SQL Server SA account to make sure this is not an access issue.
    Thanks.

    Hi Don,
    Please see answers below:
    >
    > What happens if you set the logon over ride properties for each instance?
    >
    I select the option "Use same database logon as when report is run" and get the error mentioned in the first message.
    > Also need to know what version of SQL Server you are using and if you are using the Native Client or the OLE DB for SQL Server driver?
    >
    We are using SQL Server 2008. I have tried with the OLEDB for SQL driver and with the Native client. In both the cases I am getting the same error. I also tried to change the OLEDB.sbo file as mentioned in note 1204488.
    Thanks.

  • Crystal Report dialog box issues

    I am very new at .NET, and this is my second post to this forum.
    I've created a Crystal Report within a project using Visual Studio 2005 Professional Edition, on a Windows XP machine.
    The report is handled by a CrystalReportViewer, which has its ReportSource set to the report.
    Via a dialog box, the report asks for a signon and password for a SQL Server database.  Then, via a second dialog box, it prompts for a parameter required by the report.
    All of this works ok, but I have two issues:
    1) I would like to set the database signon and password so that the user doesn't have to enter them each time he runs the report.
    2) If the Cancel button is clicked on any of the dialog boxes, it renders the report unusable until I shut down the application and reopen it.
    I have looked online for two days, but have not been able to find a solution to these above problems.  It is probably simple, but I'm not seeing it.
    I am attaching the relevant code for the button that runs the report.
        Private Sub cmdChecks_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdChecks.Click
                CrystalReportViewer2.DisplayToolbar = True
                CrystalReportViewer2.Visible = True
                CrystalReportViewer2.Height = 600
                CrystalReportViewer2.Width = 1000
                CrystalReportViewer2.Left = 10
        End Sub
    Can anybody help me with this?
    Thank you!

    Hi,
    I would like you to know the code of the logon based on the object models-
    If you are using the ConnectionInfo then use the below code:-
    //For web application
    ConnectionInfo crConnection = new ConnectionInfo();
    // Connection Information
    crConnection.ServerName="D-2818-W2K";
    crConnection.DatabaseName="Northwind";
    crConnection.UserID="sa";
    crConnection.Password="sa";
    crReport.Load(Server.MapPath("CrystalReport1.rpt"));
    Tables crTables=crReport.Database.Tables;
    foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
              TableLogOnInfo crTLOI = crTable.LogOnInfo;
              crTLOI.ConnectionInfo=crConnection;
              crTable.ApplyLogOnInfo(crTLOI);
              crTable.Location=crTable.Location;// for multiple table selection
    CrystalReportViewer1.ReportSource=crReport;
    ====================================================================================
    //For desktop application
    ConnectionInfo crConnection = new ConnectionInfo();
    // Connection Information
    crConnection.ServerName="D-2818-W2K";
    crConnection.DatabaseName="Northwind";
    crConnection.UserID="sa";
    crConnection.Password="sa";
    crReport.Load(Application.StartupPath + "//CrystalReport1.rpt");
    Tables crTables=crReport.Database.Tables;
    foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
              TableLogOnInfo crTLOI = crTable.LogOnInfo;
              crTLOI.ConnectionInfo=crConnection;
              crTable.ApplyLogOnInfo(crTLOI);
              crTable.Location=crTable.Location;// for multiple table selection
    CrystalReportViewer1.ReportSource=crReport;
    =====================================================================================
    If using ReportDocument object model
    //For web application
    ReportDocument crReport= new ReportDocument();
    crReport.Load(Server.MapPath("CrystalReport1.rpt"));
    crReport.SetDatabaseLogon("sa","sa");
    CrystalReportViewer1.ReportSource =crReport;
    =====================================================================================
    //For desktop application
    ReportDocument crReport= new ReportDocument();
    crReport.Load(Application.StartupPath + "//CrystalReport1.rpt");
    crReport.SetDatabaseLogon("sa","sa");
    CrystalReportViewer1.ReportSource =crReport;
    To download sample code click [here|https://boc.sdn.sap.com/codesamples].
    You can also take help from [Dev library|https://www.sdn.sap.com/irj/boc/sdklibrary]
    Hope this helps!!
    Regards
    Amit

  • Crystal Report 9 performance issue wehn we move old DB to new DB server

    We are using Crystal Reports 9 version, recently we move to new database server and reports data source are pointing to Old database server and old database server is no longer in the network.
    , Now we have issue with the performance, if the we call the reports from web application, it is talking long to retrieve the report at least 1 min.. , if we manually update the report data source pointing to new server and the reports are pulling in 1 second, Is there any easy solution to update all the report pointing to new server, we have 3000 reports, we can not use manual process, it will take long time and it is also issue with the future if we change the server.
    Thanks!
    Ram

    The 1 minute timeout is due to ODBC driver trying to connect, it's the default timeout you are seeing. There is not tool Cr has to migrate/update database connection info. You can develop your own though or search the web for a third party tool, I'm sure there are lots out there.

Maybe you are looking for

  • Is there a way to CAPTURE audio/video off the net then run it m.m. prsntn

    I'm fairly new to the mac genre. In windows we had apps like Camtasia to capture audio/video off the net. I was hoping something like that would be avail for the mac and then once capture it how would I edit it and include it in a presentation softwa

  • Sax XML Parser? URLDecoder.decode bad in applet? Explorer Browser jvm?

    Ok, here it goes folks, I have a serious problem with Explorers jvm, I'm developing using jdk 1.3.1 to write swing applets, in anyevent little functions that I use will not work with Explorers Browser, for example, the Explorer JVM understands the Ve

  • Default value to notes tab in opportunity

    Hi:   How to populate the default value to Notes (long text) in opportunity screen(Notes Tab). Any help is appreciating. Many Thanks Selvam

  • HT1725 download error

    Downloaded a movie that came with itunes extras... The movie downloaded but not the extra... when attempting to download the extra and unknown error message appears claiming a connectivity issue... my connection is fine. Is there another way to reloa

  • Installing Java SE 6 Runtime on IMac Yosemite to open Dreamweaver

    I am having terrible trouble doing this. I have installed SE Runtime 7 and 8 but the dialogue box keep demanding 6. The "Install" button does  not work. Been into websites - not go - the Apple support page is BLANK on SE 6 Runtime. Help