Problem changing SQL data source at runtime with VB6 and CR XI

Hello All,
We have several VB6 programs using CR XI and are able to pass a DSN to change data source with Access DB that works just fine.
We are using similar code in another program to change the data source in an SQL DB and get an error... Failed to Open the Connection.
This is a sample of what works with Access but not SQL DB:
Dim crxApplication As New CRAXDRT.Application
Public Report As CRAXDRT.Report
Global DSN_STRING
DSN_STRING = "DSN = JC Crystal Reports"
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Set Report = crxApplication.OpenReport(App.Path & "\Test11.rpt", 1)
'change location of each table in report
For Each crxDatabaseTable In Report.Database.Tables
        crxDatabaseTable.Location = DSN_STRING
Next crxDatabaseTable
FormCrystal.Show vbModal
We have tried other things from the web, still get error.
Any help would be greatly appreciated.
C Reid

Hi Carole,
When using SQL types you need more than just the DSN name. CR does keep the password in the report file and all SQL types are usually password protected.
Try this simple code:
First log onto the server:
rpt.database.LogOnServerEx("crdb_odbc.dll, pServerName, [pDatabaseName], [pUserID], [pPassword], [pServerType], [pConnectionString])
The ConnectionString is the complete line. Run in debug mode and display what the reprot is using and you can see the format it requires.
Once logged on now you can set the location for each table:
'report connection properties
        With rpt.Database.Tables(1)
            .ConnectionProperties("User ID").Value = "sa"
            .ConnectionProperties("Password").Value = "YourPassword"
            .ConnectionProperties("Data Source Name").Value = "Your DSN Name"
            '.ConnectionProperties("Data Source Name").Value = "ServerName" ' can be used if specifying a new connection
            .ConnectionProperties("Database").Value = "Northwind"
        End With
        Set rpt.Database.Tables(1).Location = "Northwind.dbo.CustOrderHist"
I'm only using one table so easy enough to create the loop or use for all...
Thank you
Don

Similar Messages

  • How to change SQL data source in rule file

    <p>Hi there,</p><p> </p><p>I use many rule files to load dimension and data with EssbaseSQL interface. (100-200 rule files!).</p><p>When need to cahnge information for data sources,  do Ihave to change it always with EAS interactively ?</p><p>Is there any way to cahnge the information of the data sourcesin batch mode or with command?</p>

    iitobs:<BR><BR>There are API calls (in at least C and VB that I found) that can use a rule file, and even copy or create one, but none that will modify a rule in any way. Even the "create rule" API call simply reserves the name so that someone else can't create one with that same name until you manage to copy it over from somewhere else - it doesn't create a new rule file, nor does it allow you to set anything in the rule. You have to use EAS to manage rule files internally.

  • Error while changing the data source at runtime

    Hi All,
    I want to change the DB connection(from Dev to QA) in the code before viewing it to the user. I browsed through the samples and found a code. But when I', trying to use the code, I'm getting the following error.
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKLogonException: Logon Error: invalid arguments in call---- Error code:-2147217393 Error code name:dbLogonFailed
    The following is the code:(Bold - problem area)
    private static void switch_tables(DatabaseController databaseController) throws ReportSDKException {
    final String DBUSERNAME = "irs_tin";
    final String DBPASSWORD = "monica30";
    final String SERVERNAME = "n3qvdb999.1dc.com";
    final String CONNECTION_STRING = "Use JDBC=b(true);Connection URL=s(oracle.jdbc.OracleDriver://n3qvdb999.1dc.com:1631);" +
                                                       "Database Class Name=s(oracle.jdbc.OracleDriver);Server=s(n3qvdb999.1dc.com);" +
                                                       "User ID=s(irs_tin);Password=;Database=s(IRSQA);Trusted_Connection=b(false);" +
                                                       "JDBC Connection String=s(!oracle.jdbc.OracleDriver!jdbc:oracle:thin://n3qvdb999.1dc.com:1631;" +
                                                       "DatabaseName={database};user=;password=!)";
    final String DATABASE_NAME = "IRSQA";
              final String URI = "!oracle.jdbc.OracleDriver!jdbc:oracle:thin://n3qvdb999.1dc.com:1631;DatabaseName=;user=;password=!";
              final String DATABASE_DLL = "crdb_jdbc.dll";
              Tables tables = databaseController.getDatabase().getTables();
    for (int i = 0; i < tables.size(); i++) {
    ITable table = tables.getTable(i);
                   //Keep existing name and alias.
                   table.setName(table.getName());
                   table.setAlias(table.getAlias());
    IConnectionInfo connectionInfo = table.getConnectionInfo();
    PropertyBag propertyBag = new PropertyBag();
    propertyBag.put("Trusted_Connection", "false");
                   propertyBag.put("Server Name", SERVERNAME); //Optional property.
                   propertyBag.put("Connection String", CONNECTION_STRING);
                   propertyBag.put("Database Name", DATABASE_NAME);
                   propertyBag.put("Server Type", "JDBC (JNDI)");
                   propertyBag.put("URI", URI);
                   propertyBag.put("Use JDBC", "true");
                   propertyBag.put("Database DLL", DATABASE_DLL);
                   connectionInfo.setUserName(DBUSERNAME);
                   connectionInfo.setPassword(DBPASSWORD);
                   connectionInfo.setKind(ConnectionInfoKind.SQL);table.setConnectionInfo(connectionInfo);
    databaseController.setTableLocation(table, tables.getTable(i));
    Thanks for your time.

    Hi Guys,
    I managed to fix my problem.
    I have used the method in the utility class at this location:
    http://code.google.com/p/struts2demos/source/browse/trunk/Struts_Demo_ThirdDemo/src/com/businessobjects/samples/JRCHelperSample.java?r=4
    -Anil

  • SQL Interface - Error in Loading the data from SQL data source

    Hello,
    We have been using SQl data source for loading the dimensions and the data for so many years. Even using Essbase 11.1.1.0, it's been quite a while (more than one year). For the past few days,we are getting the below error when trying to load the data.
    [Mon Jan 10 11:02:56 2011]Local/{App Name}/{DB Name}/{User Id}/Info(1021013)
    ODBC Layer Error: [S1000] ==> [[DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]CURSOR IDENTIFIED IN FETCH OR CLOSE STATEMENT
    IS NOT OPEN (DIAG INFO: ).]
    [Mon Jan 10 11:02:56 2011]Local/{App Name}/{DB Name}/{User Id}/Info(1021014)
    ODBC Layer Error: Native Error code [4294966795]
    [Mon Jan 10 11:02:56 2011]Local/{App Name}/{DB Name}/{User Id}/Error(1021001)
    Failed to Establish Connection With SQL Database Server. See log for more information
    [Mon Jan 10 11:02:56 2011]Local/{App Name}/{DB Name}/{User Id}/Error(1003050)
    Data Load Transaction Aborted With Error [7]
    [Mon Jan 10 11:02:56 2011]Local/{App Name}///Info(1013214)
    Clear Active on User [Olapadm] Instance [1]
    Interestingly, after the job fails thru our batch scheduler environment, when I run the same script that's being used in the batch scheduler, the job completes successfully.
    Also, this is first time, I saw this kind of error message.
    Appreciate any help or any suggestions to find a resolution. Thanks,

    Hii Priya,
    The reasons may be the file is open, the format/flatfile structure is not correct, the mapping/transfer structure may not be correct, presence of invalid characters/data inconsistency in the file, etc.
    Check if the flatfile in .CSV format.
    You have to save it in .CSV format for the flatfile loading to work.
    Also check the connection issues between source system and BW or sometimes may be due to inactive update rules.
    Refer
    error 1
    Find out the actual reason and let us know.
    Hope this helps.
    Regards,
    Raghu.

  • Crystal ActiveX Runtime Lib: Change text data source path at run time.

    We have some PCs running Crystal Reports 10 and some running CR 9 and 8.5. For each PC, we set up a System DSN ODBC data source (in Control Panel - Administrative Tools) for pulling data from text files to
    generate reports.
    Recently we wrote some routines (see the Visual Basic example at the
    end of this message) to change the path of the data files at runtime.
    According to the Crystal Reports Technical Reference Guide, we may use
    the method LogOnServer() of an Application object or an DatabaseTable
    object. However, we find that this does not work: the PrintOut()
    method only pulls data from the default path as configured for the
    System DSN, not from the path passed as the third parameter of
    LogOnServer(). It does not return any error message.
    We have also tried to use SetTableLocation() method, and it still does
    not work.
    Would any experts examine our code below and advise what we are missing? Thanks.
    For the following VB example, we have:
    System DSN Name: AP_WORKSHEET
    Driver: Microsoft Text Driver
    Database Directory: D:\0ood2 (i.e. the default path)
    Crystal Report Document: D:\3g\run\Vision\apcyto\Reports\crBlockWS.rpt
    (Which specifies that the data source text file name is BlockWS.txt)
    Purpose : We would like to read the data source text file from
    D:\0ood1 instead of the default path.
    Following is the code of the VB macro:
    Sub test()
    Rem In this version of the subroutine, we call
    Rem DatabaseTable.LogOnServer() and "Rem"ed out
    Rem Application.LogOnServer() and SetTableLocation().
    Rem We have un"Rem"ed each of them and "Rem"ed others and try to run.
    Rem In all runs, data are pulled from the default file
    Rem D:\0ood2\BlockWS.txt instead of D:\0ood1\BlockWE.txt.
    Dim crxapp As CRAXDRT.Application
    Dim crxRep As CRAXDRT.Report
    Dim crxDB As CRAXDRT.Database
    Dim crxTab As CRAXDRT.DatabaseTable
    Dim crxConnPs As CRAXDRT.ConnectionProperties
    Dim crxConnP As CRAXDRT.ConnectionProperty
    Dim apropSubLoc As String
    Dim apropConnBufStr As String
    Set crxapp = CreateObject("CrystalRuntime.Application")
    Rem
    crxapp.LogOnServer "p2sodbc.dll", "AP_WORKSHEET", "<CRWDC>DBQ=D:\0ood1",
    Set crxRep = crxapp.OpenReport
    ("D:\3g\run\Vision\apcyto\Reports\crBlockWS.rpt")
    Set crxDB = crxRep.Database
    Set crxTab = crxRep.Database.Tables(1)
    apropConnBufStr = crxTab.ConnectBufferString
    apropSubLoc = crxTab.SubLocation
    crxDB.LogOnServer "p2sodbc.dll", "AP_WORKSHEET", "<CRWDC>DBQ=D:\0ood1",
    Rem crxTab.SetTableLocation "D:\0ood1\BlockWS.txt", apropSubLoc, "DSN="
    Rem Set crxConnPs = crxTab.ConnectionProperties
    Rem Set crxConnP = crxConnPs.Item("DSN")
    Rem crxConnP.Value = "AP_WORKSHEET"
    Rem Set crxConnP = crxConnPs.Item("Database")
    Rem crxConnP.Value = "D:\0ood1\BlockWS.txt"
    Rem crxTab.Location = "BlockWS.txt"
    crxRep.DiscardSavedData
    crxRep.PrinterSetup (0)
    crxRep.PrintOut
    End Sub
    For VB macros, the problem exists in all of CR 8.5, 9 and 10. However,
    for another platform we are using, Unify Vision 4GL, it works for CR
    8.5 while not working for CR 9 and 10.
    Following is the source code in Unify Vision 4GL. This language may
    not be popular, but I thin you are about to see how it calls the
    Runtime Library methods LogOnServer(), OpenReport(), PrinterSetup() and
    PrintOut().
    %gfPrintCrystalReport
    BOOL FUNCTION gfPrintCrystalReport($reportName)
    BEGIN
    if NOTMKNOWN(GF:$oSeagateId) then
    create service of activex
    class 'CrystalRuntime.Application'
    object_ref into GF:$oSeagateId;
    if MKNOWN(GF:$oSeagateId) then
    begin
    /* TD23013: Database directories are dynamic to
    accommodate multiple user requirement of Citrix */
    send message LogOnServer to GF:$oSeagateId
    using
    ( 'PDSODBC.DLL', 'AP_WORKSHEET', '<CRWDC>DBQ='+GF:$WinTempDir,'','')
    identified by $msgHandle;
    if $msgHandle:MSG_STATE 'RESPONSE_PROCESSED'
    then
    begin
    display 'Crystal Reports cannot connect
    to the datasource ' for fyi_message wait;
    return (FALSE)
    end
    send message OpenReport to GF:$oSeagateId using
    ($reportName, 1)
    identified by $msgHandle returning
    $oCrystalReport
    if MKNOWN($oCrystalReport) then
    begin
    if (NOTMKNOWN(GF:$printerName)) then
    set GF:$printerName to
    $oCrystalReport->PrinterName;
    if GF:$printerName $oCrystalReport-
    PrinterName then
    send message SelectPrinter to
    $oCrystalReport
    using
    (GF:$driverName,GF:$printerName,GF:$portName)
    identified by $msgHandle;
    set $oCrystalReport-
    DisplayProgressDialog to FALSE;
    while TRUE
    begin
    DISPLAY NOTICE 'Print to : ' +
    GF:$printerName
    LABELS 'Ok'
    DEFAULT, 'Cancel', 'Printer Setup'
    RESULT INTO $userOption
    switch ($userOption)
    begin
    case 0 :
    send
    message PrintOut to $oCrystalReport
    using
    (PROMPT_USER, NUMBER_OF_COPIES, COLLATED, START_PAGE, STOP_PAGE)
    identified by $msgHandle;
    set
    $oCrystalReport to UNDEFINED
    return
    (TRUE);
    case 1:
    set
    $oCrystalReport to UNDEFINED
    return
    (FALSE);
    case 2:
    send
    message PrinterSetup to $oCrystalReport
    using
    (0)
    identified by $msgHandle;
    if
    GF:$printerName $oCrystalReport->PrinterName then
    begin
    set GF:$printerName to $oCrystalReport->PrinterName;
    set GF:$driverName to $oCrystalReport->DriverName;
    set GF:$portName to $oCrystalReport->PortName;
    end
    break;
    end
    end
    end
    end
    return
    (FALSE);
    END

    Hi Sydney,
    If you search the Developers help file you'll find info on using the method:
    How to change the data source
    This example demonstrates how to change the data source from native Access to an OLEDB (ADO) data source by using the ConnectionProperty Object, as well as how to change the table name by using the Location property of the DatabaseTable Object. CrystalReport1 is connected to the xtreme.mdb database found in the \Program Files\Crystal Decisions\Crystal Reports 10\Samples\En\Databases folder. The report is using the Customer table. A copy of the Customer table is added to the pubs database on Microsoft SQL Server.
    ' Create a new instance of the report.
    Dim Report As New CrystalReport1
    Private Sub Form_Load()
    ' Declare a ConnectionProperties collection.
    Dim CPProperties As CRAXDRT.ConnectionProperties
    ' Declare a DatabaseTable object.
    Dim DBTable As CRAXDRT.DatabaseTable
    ' Get the first table in the report.
    Set DBTable = Report.Database.Tables(1)
    ' Get the collection of connection properties.
    Set CPProperties = DBTable.ConnectionProperties
    ' Change the database DLL used by the report from
    ' native Access (crdb_dao.dll) to ADO/OLEDB (crdb_ado.dll).
    DBTable.DllName = "crdb_ado.dll"
    '  The connection property bags contain the name and value
    ' pairs for the native Access DLL (crdb_dao.dll). So we need
    ' to clear them, and then add the name and value pairs that
    ' are required to connect to the OLEDB data source.
    ' Clear all the ConnectioProperty objects from the collection.
    CPProperties.DeleteAll
    ' Add the name value pair for the provider.
    CPProperties.Add "Provider", "SQLOLEDB"
    ' Add the name value pair for the data source (server).
    CPProperties.Add "Data Source", "ServerA"
    ' Add the name value pair for the database.
    CPProperties.Add "Initial Catalog", "pubs"
    ' Add the name value pair for the user name.
    CPProperties.Add "User ID", "UserName"
    ' Add the name value pair for the password.
    CPProperties.Add "Password", "password"
    ' Set the table name. ' for SQL types it would be "database.dbo.table"
    DBTable.Location = "Customer"
    Screen.MousePointer = vbHourglass
    ' Set the report source of the viewer and view the report.
    CRViewer1.ReportSource = Report
    CRViewer1.ViewReport
    Screen.MousePointer = vbDefault
    End Sub

  • Using a SQL data source and XML data source in the same template

    I am trying to develop a template for the Request for Quote report generated in Apps 11.5.10. I have loaded the data from the XML output into the template, but I am missing one field - I need the org_id from the po_headers table. Is it possible to use a sql data source (i.e., "select org_id from po_headers_all where po_header_id = [insert header_id from xml data]...") in addition to the xml data source to populate the template at runtime? When you use the Insert > SQL functionality is it static at the time the template is created, or does it call to the database at runtime? I've looked through all the docs I could find, but this isn't clear.
    Thanks for any help or suggestions you may have.
    Rhonda

    Hi Pablo
    Thats a tough one ... if you go custom with a data template you will at least get support on the data template functionality ie you have a problem when you try and build one. You will not get support on the query inside the data template as you might have gotten with the Oracle Report, well you could at least log a bug against development for a bad query.
    Eventually that Oracle Report will be converted by development anyway, theres an R12 project going on right now to switch the shipped OReports to data templates. AT this point you'll be fully supported again but:
    1. You have to have R12 and
    2. You'll need to wait for the patch
    On reflection, if you are confident enough in the query then Oracle will support you on its implementation within a data template. Going forward you may be able to swap out your DT and out in the Oracle one without too much effort.
    Regards, Tim

  • Changing the Data source in Business Objects XI

    Hi,
      Is it possible to change the data source(not universe) in runtime to generate business objects reports. I am using BOXI 3.1.
    Below is the code I am using to change the universe in runtime. I would like to change this so that i can change the data source instead of changing the universe. My intention is to generate report from multipple database using same universe. Right now I am using multipple universes connected to multiple datasources to achieve this. I am using Report Engine SDK(Java).
               if("Webi".equals(mDocKind))
                   // Added for multiple database support
                   DataProviders dataProvs = documentInstance.getDataProviders();
                try{
                    //To support multiple queries in BO reports
                 for(int count=0;count<dataProvs.getCount(); count++){
                   DataProvider dp=dataProvs.getItem(count);
                   DataSource ds= dp.getDataSource();
                   infoUniverseObjects = getUniverseObject(infoStore,NewUniverseName);
                   infoUniverseObject = (IInfoObject)infoUniverseObjects.get(0);
                   String newDsCuid = infoUniverseObject.getCUID();
                   dataProvs.changeDataSource(ds.getID(), "UnivCUID=" + newDsCuid, true);
                   if(dataProvs.mustFillChangeDataSourceMapping())
                        // Re-map data source to target Universe objects
                        ChangeDataSourceMapping mapping = dataProvs.getChangeDataSourceMapping();
                        ChangeDataSourceObjectMapping[] maps = mapping.getAllMappings();
                        dataProvs.setChangeDataSourceMapping();
                    }//for dataProvs.getCount()
                }catch(Exception e)
                      mLogger.info("BOReportObject","createReport","Inside multiple data providers loop"+e.getMessage());
    Thanks in advance
    Shameer
    Edited by: Shameertaj on May 20, 2009 3:08 AM

    Hi Shameer,
    I think this is only possible with the Universe Designer SDK (which is only available in COM).
    Please kindly refer to the API reference for the Universe Designer SDK for more details:
    http://help.sap.com/businessobject/product_guides/boexir31/en/bodessdk.chm
    Also, please note that changing the universe connection when viewing a document on-demand is not recommended because this could lead to possible issues.
    For example:
    Two users trying to view documents that uses the same universe at approximately the same time.
    But user A wants to use connection X and user B wants to use connection Y.
    This could lead to an error while openning the document or while refreshing/retrieving the the data.
    Hope this helps.
    Regards,
    Dan

  • Concatenated SQL Data Source in BIP 11G

    Hi all,
    I have performed a repository upgrade of BI Publisher from 10G to 11G. Everything is working perfectly fine except the problem below:
    All the reports consists of 2 data sets. Both of them are sql queries. Data_set 1 is guaranteed to return the result set as it queries the sysdate and puts as the date the report ran. This is for auditing purpose. Data_Set2 contains the business logic for the report. At times this query does not return any data. In the case where both queries returned data, I am able to publish my report in all available output formats. e.g xml, pdf and html just to mention a few. However, in the case where Data_Set2 does not have any result set but Data_Set1 does, I am only able to display the data in XML not PDF or HTML. For pdf it come back with the message "Failed to load PDF Document" and in HTML comes with an error message "oracle.xdo.servelet.data.DataException: Layout not found".
    In BI Publisher 10G, you can could choose an option of "Concatenated SQL Data Source" and it will be able to generate the report in any format with just the result set of Data_Set1 i.e sysdate for the date when the report was ran.
    Any idea as to how I can achieve the same goal in BI Publisher 11.1.1.5
    Regards
    Joster

    Hi all,
    I managed to realise what was the problem.
    It seems like with BIP 11G, one does not to explicitly select "concatenated SQL Data Source" as was the case in 10G when using more than one data source. This option is implicitly applied.
    The issue on my side was that some of the templates I had upgraded from 10G were corrupted hence the data was returned through xml but not other template based output.
    Thanks
    Joster

  • My database not listed at SQL data source in Web Expression 4

    Can anyone help me out?
    Am not sure whether this is the correct place for my problem.
    I set up SQL Server 2005. Created a database named "employee" and a table under it "emp_info"
    I tried to connect it from Microsoft Web Expression 4 through SQL Data Source control. Well, the connection test is successful but the database i created is not shown in the drop down. However, it shows the system databases. 
    Again i create the table under one of the system databases, and tried to connect it. Those system tables which are there from before are only available to connect but not the table i newly created.
    I have checked the properties, permission of the table as well as the database. Nothing is wrong there.
    Will attach screenshot after the forum admin verify me.

    Hi Marconi,
    The forum supports VS setup and installation. Your issue is more about Web Expression 4. But I find the information below from the link:http://www.microsoft.com/expression/eng/#web
    The web is now about applications as well as traditional web sites, and this requires a new set of tools. Microsoft is committed to offering a unified approach to focus on web design and development features in Microsoft Visual Studio 2013 and beyond.
    As part of this consolidation, Microsoft Visual Studio 2013 provides the leading web development tool, which enables you to design, develop, and maintain websites and web applications. Visual Studio 2013 makes it easy to build CSS-based websites from the
    ground up with CSS layouts, HTML5 support and full featured capabilities for working with and debugging JavaScript. Learn more about
    Visual Studio Express 2013 for Web and
    WebMatrix 3.
    It seems you could install VS express 2013 for web to instead it. If you want to install VS express for web and you encounter any issue, you could post the installation issue to here.
    >>No, this is not the correct forum. This forum is for using .Net Framework inside SQL Server.
    The sentense is from the first reply. It seems you first post the issue to SQL server for help. As Erland said, it seems your issue is more about Web Expression 4. Have you solved your issue by using the first reply? If has, please mark the first reply as
    answer. If not, you could post your issue to the related forum for better support.
    http://social.msdn.microsoft.com/Forums/expression/en-US/home?forum=web
    I will move the thread to off-topic forum. Thanks for your understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Help - Set XML /XSD data source at runtime(VC2003)

    The VC 2003 app loads a CR 2008  report without any issue.
    The CR report has an XML/XSD data source ,The spec has now changed to set XML/XSD data source at runtime.
    Anyone have any information /examples on changing a CR report XML data source at runt time in VC IDE. I can not update the app to .Net or port to JAVA ,only stuck with VC 2003.
    Thank you in advance.
    In VC IDE, is there away to set a crystal reports data source as an xml File without to import the xml into a dataset?
    Edited by: Tang Pat on Jan 12, 2009 6:45 AM

    duplicate - please do not post multiple times

  • Setting Crystal Report data source at runtime

    In advance, I've read all of the posts on here about dynamically changing the data source for your report at runtime and none of it seems to work.
    I developed a report against my development database using an MySQL ODBC connection. At runtime I want to pull the data from the production database. I've tried clearing the DataSourceConnections. I've tried the SetDatabaseLogon as well as Table.LogOnInfo, Table.ApplyLogOnInfo, SetConnection, everything.
    I am using the pull method for getting the data, so CR has entire control over the mechanism used to fetch the data.
    But when I am setting some other data source I am greeted with a logon screen for the database, I i check use itegrated security then it says logon failed and if I uncheck use integrated security checkbox then it shows unable to load report and an exception is thrown
    Anyone have any ideas? I'm using Visual Studio 2010 and Crystal Reports 2011 developer edition.Apart from this my Database is in mysql and I am binding report with the MySQL Procedure.
    Note: Both these database just differ in name, Infact they are same database just I have changed the name, so the procedure and the fields are same.
    Thanks in advance.

    So if ODBC doesn't allow me to change the data source, can't it be done in some other way without mingling with each and every report.
    BDW I am able to change the data-source at designer mode,
    Currently the connection string being used is
    private readonly ConnectionInfo crConnectionInfo = new ConnectionInfo
                DatabaseName = "DB NAME",
                IntegratedSecurity = true,
                Password = "admin",
                ServerName = "localhost",
                UserID = "root"
    I just want it to read from same copy of database place at some other location so the connection string will be modified as
    private readonly ConnectionInfo crConnectionInfo = new ConnectionInfo
                DatabaseName = "Same copy of database record may change but structure will be same",
                IntegratedSecurity = true,
                Password = "admin",
                ServerName = "IP address of the machine",
                UserID = "root"

  • Trying to change the data source for a Crystal Report.

    <p>The method below represents my best attempt to programatically change the data source of a Crystal Report. The goal is to have a routine that will update the data source for reports after they have been distributed to production servers. So far I have not been successful in saving the report back to the CMS. No exceptions are thrown, but when I view the Database Configuration of the report in the CMC nothing has changed.
    </p>
    <p>
    Am I missing a step, or is there another way to accomplish this?
    </p>
    <p>
    Thank you.
    </p>
    <hr />
    <pre>
    private void test(String reportName)
       throws SDKException, ReportSDKException, java.io.IOException
       IInfoObjects newInfoObjects;
       IInfoObject reportObj;
       ReportClientDocument clientDoc = new ReportClientDocument();
       DatabaseController dc;
       PropertyBag pBag;
       PropertyBag logonProps;
       ConnectionInfo newConInfo;
       ConnectionInfo oldConInfo;
       ConnectionInfos conInfos;
       int connOptions = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB; //0;
       Fields connFields = null;
       String queryStr = "Select * From CI_INFOOBJECTS " +
          "Where SI_NAME='wfr.rpt' AND SI_KIND='CrystalReport' AND SI_INSTANCE=0";
       newInfoObjects = getCms().executeQuery(queryStr);
       if(newInfoObjects.size() > 0)
          reportObj = (IInfoObject)newInfoObjects.get(0);
          try
             clientDoc = getCms().getReportAppFactory().openDocument(
                reportObj
                , OpenReportOptions._refreshRepositoryObjects
                , java.util.Locale.US);
             dc = clientDoc.getDatabaseController();
             conInfos = dc.getConnectionInfos(null);
             for(int i = 0; i < conInfos.size(); ++i)
                oldConInfo = (ConnectionInfo)conInfos.getConnectionInfo(i);
                newConInfo = (ConnectionInfo)oldConInfo.clone(true);
                pBag = newConInfo.getAttributes();
                pBag.putStringValue("QE_ServerDescription", "alio");
                logonProps = new PropertyBag();
                logonProps.putStringValue("Trusted_Connection", "false");
                logonProps.putStringValue("Server", "alio");
                pBag.put("QE_LogonProperties", logonProps);
                newConInfo.setUserName("admin");
                newConInfo.setPassword("password");
                dc.replaceConnection(
                   oldConInfo
                   , newConInfo
                   , connFields
                   , connOptions);
          catch(ReportSDKServerException Ex)
             String msg = "A server error occured while processing the " + reportObj.getKind()
                + " object, " + reportObj.getTitle() + " (" + reportObj.getCUID() + "), from the CMS.";
             Utility.errorOut(msg, Ex);
          catch(Exception Ex)
             String msg = "An error occured while processing the " + reportObj.getKind()
                + " object, " + reportObj.getTitle() + " (" + reportObj.getCUID() + "), from the CMS.";
             Utility.errorOut(msg, Ex);
          finally
             clientDoc.save();
             getCms().commitToInfoStore(newInfoObjects);
             clientDoc.close();
    </pre>
    Edited by: Mark Young on Sep 10, 2009 2:16 PM

    <style type="text/css">
    /<![CDATA[/
        body
            font-size: 1.125em;
              font-family: helvetica,arial,"sans-serif";
          .code{font-family: "courier new",courier,mono,monospace}
          .bi{font-style: italic; font-weight: bold;}
    /]]>/
    </style>
    <p>Justin,</p>
    <p>
    Thank you for the reply. Time constraints have not allowed me to post back to this tread
    till now. I will try your suggestion. My assumption is that <i>Save the report back to the
    info store</i> refers to <span class="code">IInfoStore.commit(IInfoObjects)</span>.
    </p>
    <p>
    I'm afraid that I do not understand why I don't want to change the report client document,
    or why <i>successfully exporting the report with the new login/password</i> is not what I
    want to do. Any explanation on that statement would be appreciated.
    </p>
    <p>
    I did find a way to accomplish my goal. It involved adding the SSOKEY property to the
    logon property bag. Below you'll see my revised code which modifies the report logon and
    server. I have no idea what
    this does, and SAP support has not been able to tell me why it works. However, what I
    discovered is that if I changed the report option, <b>Database Configuration -> When
    viewing report:</b>, in the CMS to <span class="bi">Use same database logon as when report
    is run</span> from <span class="bi">Prompt the user for database logon</span>, then the
    SSOKEY property had been added to the logon property bag having an empty string as its
    value. This allowed me to successfullyupdate and save the modified logon back to the CMS.
    </p>
    <p>
    So I took a chance and added code to always add the SSOKEY property with an empty string
    as its value, and I could then successfully modify and save the report's logon info
    and server. Again, I don't know what this means, but it has worked so far. If anyone has
    some insight or comments, either are welcome. Thank you in advance.
    </p>
    <br />
    <hr />
    <pre>
    private void changeDataSourceOfAWFCrystalReports()
       throws SDKException, ReportSDKException, java.io.IOException
       IInfoObjects newInfoObjects = null;
       IInfoObject reportObj = null;
       IReport curReport = null;
       ReportClientDocument clientDoc = new ReportClientDocument();
       DatabaseController dbController;
       PropertyBag pBag;
       PropertyBag logonProps;
       ConnectionInfo newConInfo;
       ConnectionInfo oldConInfo;
       ConnectionInfos conInfos;
       int connOptions = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB;
       Fields connFields = null;
       String outputStr;
       int numOfReports;
       int numOfQueryPages;
       double progressIncrementPerPage = 30;
       int progressIncrementPerReport = 0;
       // Path query to reports is in a .properties file.
       String queryStr = getAppSettingsFile().getWscAwfCrystalReportPathQuery();
       try
          // Executes IInfoStore.getPageingQuery() and generates a list of queries.
          getCms().setPathQueryQueries(queryStr, 100);
          numOfQueryPages = 0;
          // Gets a List&lt;String&gt; of the IPageResult returned from IInfoStore.getPageingQuery().
          if(getCms().getPathQueryQueries() != null)
             numOfQueryPages = getCms().getPathQueryQueries().size();
          if(numOfQueryPages &gt; 0)
             // Use 30% of progress bar for the following loop.
             progressIncrementPerPage = Math.floor(30.0/(double)numOfQueryPages);
          for(int queryPageIndex = 0; queryPageIndex &lt; numOfQueryPages; ++queryPageIndex)
             // Gets the IInfoObjects returned from the current page query
             newInfoObjects = getCms().getPathQueryResultSetPage(queryPageIndex);
             numOfReports = newInfoObjects.size();
             if(newInfoObjects != null && numOfReports &gt; 0)
                progressIncrementPerReport =
                   Math.round((float)Math.floor(progressIncrementPerPage/(double)numOfReports));
                for(int reportIndex = 0; reportIndex &lt; numOfReports; ++reportIndex)
                   reportObj = (IInfoObject)newInfoObjects.get(reportIndex);
                   curReport = (IReport)reportObj;
                   clientDoc = getCms().getReportAppFactory().openDocument(
                      reportObj
                      , OpenReportOptions._refreshRepositoryObjects
                      , java.util.Locale.US);
                   dbController = clientDoc.getDatabaseController();
                   conInfos = dbController.getConnectionInfos(null);
                   for(int conInfosIndex = 0; conInfosIndex &lt; conInfos.size(); ++conInfosIndex)
                      oldConInfo = (ConnectionInfo)conInfos.getConnectionInfo(conInfosIndex);
                      newConInfo = (ConnectionInfo)oldConInfo.clone(true);
                      pBag = newConInfo.getAttributes();
                      pBag.putStringValue(
                         "QE_ServerDescription"
                         ,getConfigFile().getDBDataSourceConnections());
                      logonProps = new PropertyBag();
                      logonProps.putStringValue("Trusted_Connection", "false");
                      <b>logonProps.putStringValue("SSOKEY", "");</b>
                      logonProps.putStringValue(
                         "Server"
                         ,getConfigFile().getDBDataSourceConnections());
                      pBag.put("QE_LogonProperties", logonProps);
                      newConInfo.setUserName(getConfigFile().getUNVConnectionUserName());
                      newConInfo.setPassword(getConfigFile().getUNVConnectionPasswordDecrypted());
                      dbController.replaceConnection(
                         oldConInfo
                         , newConInfo
                         , connFields
                         , connOptions);
                      newConInfo = (ConnectionInfo)conInfos.getConnectionInfo(conInfosIndex);
                   } // end for on conInfosIndex
                   clientDoc.save();
                } // end for on reportIndex
             } // end if on newInfoObjects
          } // end for on queryPageIndex
       } // end try
       catch(ReportSDKServerException Ex)
          // handle...
       catch(Exception Ex)
          // handle...
       finally
          getCms().commitToInfoStore(newInfoObjects);
          if(clientDoc != null)
             clientDoc.close();
    </pre>

  • Change the data source connection of existing reports in web analysis

    Hi
    I have developed certain reports in web analysis 9.3.1, now I need to point these reports to a new cube with same layout. Can anyone let me know how to change this data source. There are lot many reports so it will take lot of time for me to recreate them.
    Please suggest any good approach
    ---xat

    You can edit the Database connection from Web Analysis. Perform the below tasks to edit the database connection..
    1) Login to Web Analysis
    2) Select the Database Connection which needs to be modified.
    3) Right Click then Edit..
    Hope this helps you..
    Regards,
    Manmohan Sharma

  • Using relational data from SQL data source in Planning and Essbase

    Hi,
    How do I take sample data from a SQL data source and bring it into a Hyperion Planning application? I understand that when creating Planning applications, a link between a relational data source and Essbase must be established, because the relational database holds the metadata while the database outline is stored with Essbase. However, all I am currently able to do is load the data into Planning applicaitons via EAS, where I right-click on the Application database, hit load data, and select from either a .txt file or an excel file. Do I need Oracle Data Integrator? Any help or insight would be greatly appreciated, as well as corrections to any incorrect assumptions I may have made in this post. Thank you.

    When you import your file (Excel or text), you're importing it using a Load Rule in EAS. To load from SQL, you simply create a SQL load rule. You'll load data the exact same way (via EAS), but with a different type of load rule. The load rule will contain the SQL that queries the database. You can preview your data in the load rule the same way you would with a file.
    If your SQL is very complex, I'd recommend creating a view and loading from that view. But otherwise it's pretty straight-forward.
    The only catch is that you need to configure a database connection (to your relational database) on the Essbase server. The Essbase DBA guide will show you how to do this.
    You COULD use ODI, but I tend to only use it for loading metadata.
    Hope this helps,
    - Jake

  • Configuring odbc.ini in Unix for SQL data sources in EAS

    Hi All,
    The first question I have is, which odbc.ini file should I edit?
    The tech reference says navigate to /home/Common/ODBC/Merant/x.x/odbc.ini but I have 5 folders under Merant...
    5.3
    6.0
    6.0SP1
    6.1
    7.0.1
    The main problem I have is making the new connection show in EAS client, I have edited all the 5 of the ODBC.ini files on our Unix essbase server to include our DB name and left the values as default (for testing purposes), what I have found is that the new connection name does not appear in the SQL data sources as a drop down menu, do I need to restart anything to make the new value show in EAS?
    OBIEDB=DataDirect 6.0 Oracle Wire Protocol
    [OBIEDB]
    Driver=/u02/oracle/obi11d/fmw/Oracle_BI1/common/ODBC/Merant/6.0/lib/ARora24.so
    Description=DataDirect 6.0 Oracle Wire Protocol
    AlternateServers=
    ApplicationUsingThreads=1
    ArraySize=60000
    AuthenticationMethod=1
    BulkBinaryThreshold=32768
    BulkCharacterThreshold=-1
    BulkLoadBatchSize=1024
    CachedCursorLimit=32
    CachedDescLimit=0
    CatalogIncludesSynonyms=1
    CatalogOptions=0
    ConnectionRetryCount=0
    ConnectionRetryDelay=3
    DefaultLongDataBuffLen=1024
    DescribeAtPrepare=0
    EnableBulkLoad=0
    EnableDescribeParam=0
    EnableNcharSupport=0
    EnableScrollableCursors=1
    EnableStaticCursorsForLongData=0
    EnableTimestampWithTimeZone=0
    EncryptionMethod=0
    FailoverGranularity=0
    FailoverMode=0
    FailoverPreconnect=0
    FetchTSWTZasTimestamp=0
    GSSClient=native
    HostName=<Oracle_server>
    HostNameInCertificate=
    InitializationString=
    KeyPassword=
    KeyStore=
    KeyStorePassword
    LoadBalanceTimeout=0
    LoadBalancing=0
    LocalTimeZoneOffset=
    LockTimeOut=-1
    LoginTimeout=15
    LogonID=
    MaxPoolSize=100
    MinPoolSize=0
    Password=
    Pooling=0
    PortNumber=<Oracle_server_port>
    ProcedureRetResults=0
    QueryTimeout=0
    ReportCodePageConversionErrors=0
    ReportRecycleBin=0
    ServerName=<server_name in tnsnames.ora>
    ServerType=0
    ServiceName=
    SID=<Oracle_System_Identifier>
    TimestampeEscapeMapping=0
    TNSNamesFile=<tnsnames.ora_filename>
    TrustStore=
    TrustStorePassword=
    UseCurrentSchema=1
    ValidateServerCertificate=1
    WireProtocolMode=1

    To answer my own question, the path to the true odbc.ini file is located here...ORACLE_INSTANCE/config/OPMN/opmn/opmn.xml, in my case, EAS was refering to an odbc.ini file located in my ARBORPATH and not /u02/oracle/obi11d/fmw/Oracle_BI1/common/ODBC/Merant/6.0/lib/ARora24

Maybe you are looking for