Change Location of Database at Runtime for Report based on a Command

Post Author: srr
CA Forum: Crystal Reports
I am using Crystal Reports Developer XI 11.5.8.826 - My database is MS Access 2003
I have created a report definition that is based on a query of multiple tables in the database, which is saved in Crystal Reports as a Command.
The report runs fine inside the Crystal Reports report designer.
I have a VB.NET 2.0 Windows Form application that contains a CrystalReportViewer control. I need to be able to set the location of the database at runtime. When I try to set the Table Location property to a different location than the design time location at runtime I get the login screen and no matter what I enter in the login screen I get a Login Failed error.
How do I set the DB location at runtime, when the report is based on a command?

Hi,
When you run the Interactive Report, go to Actions drop down:
Actions->Format->Highlight
Name: (Give a name to the highlight operation)
Sequence: (The sequence in which multiple highlights should work)
Enabled: (Enabled/Disabled)
Highlight Type: (Row/Cell)
Background Color: (Background Color you want to set)
Text Color: (Text Color you want to set)
Highlight Condition:
1) Column: (Column on whose value you want to set the highlight)
2) Operator: (use appropriate operator)
3) Expression: (Value on which the highlight should appear)
Hope it helps!
Regards,
Kiran

Similar Messages

  • UOM Conversion changes where conversion is only used for reporting

    I think this is a different situation than I've seen in other posts.
    We have a UOM conversion from CS to POUND (i.e. 1 case = 30 pounds), and at some point may want to change it so that 1 case = 28 pounds. In our situation, all transactions are done at the CS (primary UOM) and the weight is only used in calculations to print on shipping documents. Is there any harm in just changing the 30 to 28 when that time comes? Again, there are no transactions that reference the weight, no PO's, no SO's, no financials, etc.
    We also have a similar situation where a PALLET may contain 100 cases now, but in the future be reconfigured to contain 90 cases. Same idea, nothing is transacted in Pallets, and the conversion is only used in reporting. Seems like it would be OK to change that conversion without causing problems. Any thoughts?
    Thanks for your insights!
    Bill
    (Running r12.1.3 with OPM)

    I think this is low risk - just make absolutely sure that the uom was not used for customer pricing, internal pricing, boms, on ASL, on price breaks, on quotes, on POs, on material transactions, wip moves etc.
    As long as it was truly used just for reporting, you should be ok.
    Sandeep Gandhi

  • Data Selection for report based upon a 'Prompt Value'

    I want to report information in my report based upon a 'user input prompt value'
    for example:
    'Enter Shareholder Selection - A-Active, I-Inactive, B-Both Active and Inactive'
    if the user enters 'A', the report selects only active shareholders
    if the user enters 'I', the report selects only inactive shareholders
    if the user enters 'B' the report selects all shareholders, active and inactive
    the field in the database that this based upon is their total share value.
    if this field is greater than zero (>0) they are considerd 'active'
    if this field is equal to zero (=0) they are considered 'inactive'.
    I have tried creating some type of filter,  but am not having any luck. 
    I saw a few examples within the forums that I have tried without any luck....unfortunately most of the examples I've seen are base one only two choices.
    I'm sure I need to create some type of 'independant varible' but am not sure how to do that either.
    Any suggestions would be appreciated.
    Thanks.

    Hi Daryl,
    I Tried this unsuccessfully in DESKI . We can't Eliminate Rows having Empty Measure Values or Measure with 0 as values using Table Level Filter as FIlter can't FIlter rows based on Prompt value selection dynamically. Filters filter rows at a time and not based on 3 condition as Active, Inactive and Both. thus filters are of no use.
    I Tried this in WEBI, and it is working perfectly you donu2019t have to create any Object in Universe, you can do it using function UserResponse() at report level.
    Hence if you are comfortable using WEBI for Generating this report then Follow the steps.
    1. Create Report With Name and Shares Object. It will display all Shareholder Names and No.of shares they hold.
    2. Use Status Object in Query filter, use condition as u201CEqual Tou201D and Select prompt. It  contains Active, Inactive and Both as values.
    3. Report will Display all Shareholder names and No. of  shares  like 45, 789, 0, 4562 where 0 is inactive Shareholder and all other are active shareholder.
    4. Create Variable using Formula.
    =If(UserResponse("Enter Status:")="Active" And [Shares]>0;[Shares];If(UserResponse("Enter Status:")="Inactive" And [Shares]<=0;[Shares];If(UserResponse("Enter Status:")="Both";[Shares])))
    5. Remove Shares Object from the report and Put Variable created with Names of Shareholders.
    6. Select Table-> Properties-> Display-> Uncheck the Option u201CShow Rows with Empty Measure Valuesu201D
    7. Report will display Value correctly as per your Prompt value selection.
    I Hope this Helpsu2026
    Thanksu2026
    Pratik

  • Dynamic query table for report based on LOV selected

    Hi,
    Need some suggestion and guidance how to dynamically query table via lov for report .
    Scenario:
    Table, TABLE_LIST, has tablename (table in DB) and filter (for where clause) column. The TABLENAME_LOVE is derived from table TABLE_LIST.
    SELECT TABLENAME D, TABLENAME R FROM TABLE_LIST
    In Page 2,a page select list item,P2_TABLENAME to use TABLENAME_LOV
    All data in tables in the table_list have identical structure (columns, triggers, primary key, and so on).
    I want to have the report region query from the table based on selected LOV.
    Example,
    Tablename Filter
    TB1
    CD2 ACTIVE='Y'
    When select TB1, the report regin will query based on TB1.
    When select CD2, the report regin will query based on CD2 WHERE ACTIVE='Y'
    Question:
    How can I query based on &P2_TABLENAME. WHERE &P2_FILTER.
    Like
    select col1, col2 from &P2_TABLENAME WHERE &P2FILTER
    Greatly appreciate any suggestion and some guidance.
    Tigerwapa

    Hi,
    You should always post your Apex version, DB version and other information as suggested in the FAQ.
    And the moment you talk report you should state whether it is IR or Classic.
    As for your query, have you explored the Report type "SQL Query (PL/SQL function body returning SQL query)" ?
    That might be a good fit for what you are trying to achieve.
    Regards,

  • How to find overhead costs(labor and material)  for report based on ck13n

    HI.
    i am creating a report based on ck13n...
    i need to display labor costs.
    overhead costs.
    material overhead costs for all assemblies (sub assembly as well as final assembly)..
    how do i proceed with it

    You can use information under itemization for cost estimate display. under itemization cost estimate are normally displayed (if configured) as break between materials, labour and other cost. I ope this helps

  • Capture runtime for report through SE30

    Hi,
    I want capture run time ( execution time ) for one report. i tried in execute in foreground using SE30 its giving timeout error.
    i tried to run in background using SE30, it did not give proper results..
    Please help how to capture run time if i run this report in background.
    Thanks
    Sireesha

    Hi,
    Pleasecheck out the below
    Check the latest version of SE30 - New ABAP runtime tool - SAT (ECC 6 onwards)
    http://scn.sap.com/docs/DOC-10248
    For a detailed info of SE30 read the below
    http://wiki.sdn.sap.com/wiki/display/ERPHCM/Trace+for+ABAP+Analysis
    Regards,
    Karthik

  • Dynamic sql query for report based on user input

    Hi everyone,
    I have built custom search fields (name, date born, gender etc.) in the search region and in the results region a report need to be displayed.
    Now I'm not very experienced with Apex or Oracle sql, but could anyone telll me how to first check if a user filled in a field and then build a query based upon what field the user filled in to submit.
    Any help would be appreciated, thanks in advance.
    regards,
    Cleo
    Edited by: Cleopatra on Jan 18, 2011 5:51 AM

    Hi, Cleopatra. Welcome to OTN!
    If you don't have too many fields instead of checking to see if they're filled in you can use OR conditions in yoru WHERE_CLAUSE to check for NULLS to ignore NULLS, something like (you will have to test this carefully!)
    AND some_column = NVL(:P24_1,some_column)the idea being that if the field is NULL then the column will match itself - in this case assuming the column itself does not have a null value

  • Request for reporting available after rollup. Why not before?

    Hi,
    In infocubes with aggregates, a dataload is not available for reporting until you roll-up the aggregates. This is very unwanted behaviour and we'd like to have the loads available at all times, with or without a rolled up aggregate. All our aggregates are rolled up in the same process chain block after all loads are done. This means that data will not be available for reporting until all loads have finished, something our customers complain about.
    Because parallel rollup jobs collide, rolling up up after every infopackage would make our loadschedule very unflexible (difficult to plan parallel processes).
    Is this possible (by changing a setting somewhere) to change this and make load available for reporting at all times, or is this one of SAP's standard programming decisions without any workarounds?
    Cheers,
    Eduard

    Aggregates data is maintained in aggregate tables.
    Unless, you roll it up after every data load, the aggregate data wont be correct and it wont be consistent with the data in the cube.
    YES< the roll up job will not be complete unless the loading job is compete.
    One suggestion is to review the process chain jobs and see if you can reshuffle the jobs.
    But aggregate roll up has to happen after data loading job of that cube on which aggregate is built .
    Ravi Thothadri

  • Changing database location per Table at runtime is extremely slow in viewer

    We are using the Crystal Reports 2008sp2 Viewer in windows forms .NET
    application to display various reports based on a Pervasive database.  The
    C# code dynamically changes the database table locations at run time.  The
    location needs to be set for each table since the location may be different
    for each table in the report. 
    We have tried to methods to change the location.
    1) Set  the Table.Location property in the ReportDocument.Database.Tables
    collection.
    foreach (Table table in rd.Database.Tables)
    Table.Location = "New Path";
    2) Set the TableLogOnInfo properties.
          TableLogOnInfo logonInfo = new TableLogOnInfo();
          logonInfo = table.LogOnInfo;
          logonInfo.ConnectionInfo.ServerName = dataPath;
          logonInfo.ConnectionInfo.LogonProperties[0] = new NameValuePair2("Data
    File", dataPath);
          logonInfo.ConnectionInfo.LogonProperties[0] = new NameValuePair2("Data
    File Search Path", path);
          table.ApplyLogOnInfo(logonInfo);
    Both of these methods work, but have extremely slow performance.  Both
    methods take between 2 and 3 seconds to execute per table.  Since many of
    our reports have 20 - 30 table references ( sometimes more ), this can add
    an additional 1-2 minutes to the display of a report.
    It seems that the Crystal viewer object is doing some sort of verification
    every time the database location is changed.  We have noted that as the
    location is changed, the database is being accessed by the viewer.  Please
    advise as to how to stop this behavior.  Is there a way to set the location
    without the viewer verifying the change?
    This problem is turning reports that run in the 2008 Report Designer in 3 seconds into reports that take
    many minutes to run.  We will hear nothing but screaming from our 300 customers.
    Thanks for any help.
    Bill Smith

    Hello,
    I have a very similar issue but with Crystal XI and XI R2.
    I'm using Oracle 10g, and changing a couple of properties using the following sequence for each table to change the login information and the table's current view (each view is a portion of the overall table):
    IDatabaseTablePtr table = tables->GetItem(tableN);          
    table->SetLogOnInfo(TheApp.GetDataSource(), TheApp.GetDatabase(), userID, pwd);
    char tableLocation[201];
    char tempTable[201], newTable[201];
    strcpy(tableLocation, table->GetLocation());
    // make new table name, put into newTable
    table->PutLocation(newTable);
    if (!table->TestConnectivity())
      ShowCrystalRE_Error(job);
    Stepping through in my debugger, the SetLogOnInfo seems very quick, it's the PutLocation( ) that seems to be taking alot of time.
    Any help would be greatly appreciated.
    This is extremely fast on SQL Server, only noticeably slow on Oracle.

  • Change runtime for a specific report

    Hi All,
    I was wondering if it's possible to change the runtime limit for a specific report in SAP. So for example if the general runtime limit is set to 20 mins, can I change this to 45 mins for one specific report?
    Thanks.
    Manu.

    Hi,
    I dont think it is possible to change the runtime for a single report. By runtime, i mean runtime in foreground.
    It is a BASIS setting and will be allied to ALL reports.
    Contact your BASIS admin for further clarifications.
    Regards,
    Shashank

  • Why should I recompile report for any changes in the database ?

    Hi All
    I call a report (.rep) from a form using RUN_REPORT_OBJECT, and everything is OK
    For any change in the database, for example :
    1- Export Dump file for the schema.
    2- Drop the schema
    3- Re-create the schema again
    4-Import the taken dump to the schema
    When i call the report again, the report doesn't run. If i recompile the report again it will work.
    I read too much posts about this issue, most of them are taLking about the command line parameter RECURSIVE_LOAD=NO ,
    v_url :=' COMPANY_NO='||:global.company_no|| ' RECURSIVE_LOAD=NO';
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,v_url);
    But , Still the problem not solved
    Notes :
    1- The report type is .REP
    2- if I used the .JSP report, it is working fine , But i can't copy the source code for the report at the customer side.
    Please Help

    Well, first of all this would not be the correct forum. There is a dedicated reports forum for reports related questions. And secondly this most certainly depends on your report. If you have a query like
    select * from my_tableor e.g. are using %rowtype records in your report then you most certainly will have to recompile it after you do an exp/imp.
    cheers

  • Facing problem while changing the database at runtime

    hi everyone,
    Before posting this thread, i have gone through the various posts addressing the problem....but still iam unable to get the solution for this problem.
    The report has been generated in one system, so the database properties (connection string....) are hardcoded in the report file...
    Now when iam trying to change the database, it is still connecting to the system where the report file was created.
    I have tried the changeDatasource() method, but it didnot worked....
    here is the code for changeDatasource() method
    public static void changeDataSource(ReportClientDocument clientDoc,
                    String reportName, String tableName,
                    String username, String password, String connectionURL,
                    String driverName,String jndiName) throws ReportSDKException {
            PropertyBag propertyBag = null;
            IConnectionInfo connectionInfo = null;
            ITable origTable = null;
            ITable newTable = null;
            // Declare variables to hold ConnectionInfo values.
            // Below is the list of values required to switch to use a JDBC/JNDI
            // connection
            String TRUSTED_CONNECTION = "false";
            String SERVER_TYPE = "JDBC (JNDI)";
            String USE_JDBC = "true";
            String DATABASE_DLL = "crdb_jdbc.dll";
            String JNDI_DATASOURCE_NAME = jndiName;
            String CONNECTION_URL = connectionURL;
            String DATABASE_CLASS_NAME = driverName;
            // The next few parameters are optional parameters which you may want to
            // uncomment
            // You may wish to adjust the arguments of the method to pass these
            // values in if necessary
            // String TABLE_NAME_QUALIFIER = "new_table_name";
            // String SERVER_NAME = "new_server_name";
            // String CONNECTION_STRING = "new_connection_string";
            // String DATABASE_NAME = "new_database_name";
            // String URI = "new_URI";
            // Declare variables to hold database User Name and Password values
            String DB_USER_NAME = username;
            String DB_PASSWORD = password;
            System.out.println("DB_USER_NAME......."+DB_USER_NAME);
            System.out.println("DB_PASSWORD......."+DB_USER_NAME);
            // Obtain collection of tables from this database controller
            if (reportName == null || reportName.equals("")) {
                Tables tables = clientDoc.getDatabaseController().getDatabase().getTables();
                System.out.println("Tables in reports........"+tables.size());
                for(int i = 0;i < tables.size();i++){
                    origTable = tables.getTable(i);
                    System.out.println("origTable........"+origTable.getQualifiedName());
                    if (tableName == null || origTable.getName().equals(tableName)) {
                        newTable = (ITable)origTable.clone(true);
                        // We set the Fully qualified name to the Table Alias to keep the
                        // method generic
                        // This workflow may not work in all scenarios and should likely be
                        // customized to work
                        // in the developer's specific situation. The end result of this
                        // statement will be to strip
                        // the existing table of it's db specific identifiers. For example
                        // Xtreme.dbo.Customer becomes just Customer
                        newTable.setQualifiedName(origTable.getQualifiedName());
                        System.out.println("newTable........"+newTable.getQualifiedName());
                        // Change properties that are different from the original datasource
                        // For example, if the table name has changed you will be required
                        // to change it during this routine
                        // table.setQualifiedName(TABLE_NAME_QUALIFIER);
                        // Change connection information properties
                        connectionInfo = newTable.getConnectionInfo();
                        // Set new table connection property attributes
                        propertyBag = new PropertyBag();
                        // Overwrite any existing properties with updated values
                        //propertyBag.put("Trusted_Connection", TRUSTED_CONNECTION);
                        //propertyBag.put("Server Type", SERVER_TYPE);
                        propertyBag.put("Use JDBC", USE_JDBC);
                        propertyBag.put("Database DLL",DATABASE_DLL );
                        propertyBag.put("JNDI Datasource Name",JNDI_DATASOURCE_NAME );
                        propertyBag.put("Connection URL", CONNECTION_URL);
                        propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);
                        //propertyBag.put("Server Name", SERVER_NAME); //Optional property
                        // propertyBag.put("Connection String", CONNECTION_STRING); //Optional property
                        // propertyBag.put("URI", URI); //Optional property
                        connectionInfo.setAttributes(propertyBag);
                        // Set database username and password
                        // NOTE: Even if the username and password properties do not change
                        // when switching databases, the
                        // database password is *not* saved in the report and must be set at
                        // runtime if the database is secured.
                        connectionInfo.setKind(ConnectionInfoKind.SQL);
                        connectionInfo.setUserName(DB_USER_NAME);
                        connectionInfo.setPassword(DB_PASSWORD);
                        // Update the table information
                        clientDoc.getDatabaseController().setTableLocation(origTable,newTable);
    Also i tried with replaceConnection() method...........it displayed the report, but with not column names and data
    need help regarding.......
    Edited by: abhishek.c1984 on Jun 25, 2009 10:02 AM

    In the report i have two tables.............so before changing the database properties for each table iam printing their names.
    The names are dispalyed correctly.......but once i set the table location...i.e through the following method..
    clientDoc.getDatabaseController().setTableLocation(tables.getTable(i),newTable);
    every time i can see only one table i.e. properties are set for the first table ........and each time the properties are being set for the first table only.....i dont no what is happening to the rest of the tables..
    I have posted the method in the above post.....can any one please trace out the problem
    Note: when i comment the following code, i can see all the tables
    clientDoc.getDatabaseController().setTableLocation(tables.getTable(i),newTable);
    when i uncomment it, i can see only first table repeating every time...
    Edited by: abhishek.c1984 on Jun 25, 2009 1:03 PM

  • Set Table Location for Reports(Command Objects)

    Hi SAP Gems,
    I would like to thank TED,Merry,Jonathan, Shawn, and all the developers contributing to this community.
    I would really appreciate any help on following question:
    1. I have a report designed in CR 2008 against DB2(JDBC Connectivity).
    2. The report is working fine in the designer.
    3. There are five sub reports in the main report.
    4. The main report doesnt have any command object however every child/sub report has command object with paramaters.
    5. Every subreport is linked.
    6. I would like to change runtime datasource location for this report using CRJ 2.0 SDK'S.( from AIX to Windows BOX)
    7. Both BOX's have same database schema.
    8. I am able to view the report in the jsp page using SDK's, however "set table location doesnt works and prompts me the error:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Unexpected database connector error---- Error code:-2147467259 Error code name:failed
    *There is no problem with the code because the sample code is taken from sdn.sap as it is and it works for other report without subreport and command objects.
    I tried using the following code piece but again same problem.
    if(table instanceof com.crystaldecisions.sdk.occa.report.data.CommandTable)
                        IProcedure command = (IProcedure)table;
                        ParameterField commandParam = (ParameterField) command.getParameters().get(0);
                        Values values = new Values();
                        ParameterFieldDiscreteValue pfdv = new ParameterFieldDiscreteValue();
                        pfdv.setValue("ANTON");
                        values.add(pfdv);
                        commandParam.setCurrentValues(values);
    I would like to know if I dont want to set the command level param using:
    ParameterField commandParam = (ParameterField) command.getParameters().get(0);
                        Values values = new Values();
                        ParameterFieldDiscreteValue pfdv = new ParameterFieldDiscreteValue();
                        pfdv.setValue("ANTON");
                        values.add(pfdv);
                        commandParam.setCurrentValues(values);
    would the parameter would be prompted automatically?
    how do I find what paramaeter to set and how ?
    Regards,
    Jonathan Roy

    Hi ,
    Can any one help please?
    Ted !! I would really appreciate an answer from you.
    Regards,
    Jon

  • CR runtime for VS2010 (v13) not generating report

    I installed Crystal Reports Runtime for VS2010 version 13 on Win2003 Server 64 bit (for intranet website that is used to execute reports). The web site is executed under Integrated security. The user account and the network service account have write and modify access to the designated temp folder on the web server. But for some reason when I execute the report, "Database Logon Failed" error is getting generated. Crystal Reports 10.5 runtime under same settings worked fine, but when I installed CR13 runtime and changed Web.config to point to CR13 version, it is generating this error. The correct version 13 is getting picked up as I checked the ReportDocument object's Class Version after the ReportDocument.Load() is executed, and it points to version 13. It is generating this error when executing " ReportDocument.ExportToDisk". Does any account other than the user account (logged in NT account) and service account require permissions to temp folder. Does any other folder require permissions? What is new in version 13 regarding the temp folder that CR uses to generate the report? The temp folder that is used in our intranet web site to generate CRs is a special folder (not C:\Win\Temp but another designated folder) that has the user account & Network service account have write and modify access. Has anything regarding the temp folder that CRs uses changed between CR10.5 and CR13. The web site, Crystal Reports(.rpt) and SQL server (Network is set up for Kerberos Authentication) are all set up for integrated security, and this set up worked with CR10.5 runtime, but does not work with CR13 runtime.
    Error Details:
    Server Error in '/' Application.
    Database logon failed.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Runtime.InteropServices.COMException: Database logon failed.

    I have the same issue as you. I have converted my reports from CR10 to CR13. I can execute them locally (I'm in "Administrator Group"), but when I deploy the reports to my DEV environment I have this error :
    CrystalDecisions.CrystalReports.Engine.LogOnException: Echec de la connexion à la base de données. ---> System.Runtime.InteropServices.COMException (0x8004100F): Echec de la connexion à la base de données.
       à CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
       à CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       --- Fin de la trace de la pile d'exception interne ---
       à CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       à CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       à CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       à CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
       à CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
       à CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
       à
    I don't understand how it could be a database connection problem, because the report crash on CrystalDecisions.CrystalReports.Engine.ReportDocument.Export() call and, at this point, data are loaded into the dataset from my Data Tier (which did not fired an exception).

  • How to change a connection with the database in Runtime?

    How to change a connection with the database in Runtime?
    My connection was made using ADF Business component (ApplicationModule).
    ADF Swing.
    JDeveloper Studio 11.1.1.4.0.

    When deploying ADF applications with database connection, you should be using JDBC data sources configured in the weblogic server.
    You could change the JDBC data sources to a different DB instance or location - by changing the JDBC data source and restarting the weblogic server.
    For more details, check
    http://techiecook.wordpress.com/2010/12/02/oracle-weblogic-adf-datasources/
    Thanks,
    Navaneeth

Maybe you are looking for