Bex Scenario: First Time Shipments to Customers - Query

Hi Friends,
We have one report called “First time Shipments to Customers”.  Means, user wants to see the transactions where we first time ship any product to the customers.
For example following transactions occur in Jan, 2007
                        Date       Cust     Mat       Qty
Record1:        01/01/07     C1        M1         10
Record2:        05/01/07     C1        M1         30
If user executes report on 31/01/07, then he wants to see following output:
                                        C1       M1         10
Say in the next month (Feb, 2007) following transactions occur.
                        Date       Cust     Mat       Qty
Record1:        01/02/07     C1        M1         10
Record2:        05/02/07     C1        M1         30
Record3:        06/02/07     C1        M2         50
If user execute report on 28/02/07. Then he wants to see following output:.
                                       C1          M2        50
That means the combination of Customer / Material have already occurred in previous month so only the third transaction should be displayed.
How can we restrict output records by comparing them with previous records in Bex? The only selection condition we have is “Period”.
Can you help me on this, please?
Thanks in Advance.
Sasi

Thanks dude..It would be kind of you if u can plese give me a sample code for this scenario..

Similar Messages

  • Query Region: vo.executeQuery is not using criteria first time.

    Hi,
    Scenario*
    I have a simple QueryRegion with an AdvancedTable. Its construction mode is autoCustomizatioCriteria.
    Also, there is a 'Refresh' button on the page to redirect to same page with a parameter 'refreshStatus' set.
    This button is handled in the processFormRequest as follows
    if (pageContext.getParameter("Refresh") != null) {
    HashMap parameters = new HashMap();
    parameters.put("refreshStatus", "REFRESH");
    pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/ap/payments/psr/webui/PsrSearchPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null, parameters, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    In the processRequest, the 'refreshStatus' parameter is checked and if it is true, an AM method is invoked which calls a VO method, which ultimately invokes super.executeQuery() which is expected to use previous search criteria.
    Issue*
    I navigate to this page, enter criteria and click 'Go'.
    Expected results are displayed.
    Then I click the Refresh button. The table refreshes without considering the criteria. All results from database table are displayed.
    The criteria entered is still seen in the search fields as the AM is retained during redirect.
    Now I click on 'Go' again keeping the same criteria.
    Expected Results are displayed.
    Then I click the Refresh button. Now the table refreshes with the criteria in action.
    I am not getting the expected Refresh behavior for the first time only. The flow is same both times for Refresh button. Any idea why executeQuery() is not seeing WHERE conditions on the VO for the first time?
    Thanks
    Chinni

    Chinni
    Please post the complete codes .
    boolean isRefreshStatus =pageContext.getParameter("refreshStatus") != null;Here you are taking refereshStatus value in boolean but your value is REFRESH boolean cannot accept string type data.
    I will suggest try using sop() and check whether VO method for executing query is getting called or not and based on what values...
    Moreover while posting your code kindly enclose it in between {noformat}{noformat}
    for e.g
    {noformat} select * from dual
    {noformat}
    This looks like select * from dualThanks
    AJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Is it possible to execute a Bookmarked query the first time a page is rende

    Hi,
    We are in the process of creating certain dashboards for our product using Endeca.
    We have defined some metrics in the Metric Bar component, and want some useful information to be visible to the user the first time the user comes to this page.
    As of now, these metrics look to be very generic in nature, but give useful information once the user starts searching. Some examples of these Metrics are - Supplier Count, Category count, etc. These won't make much sense to the end user without a context. Hence, we want this context to be present the very first time the user comes to this page.
    The easiest solution seems to be creating a Bookmark, and being able to execute that the first time the page renders.
    Is this possible to do? If yes, how?
    Also, are there any other ways to achieve this result, other than using the Bookmark component?
    Thanks,
    Amit

    The easiest solution seems to be creating a Bookmark, and being able to execute that the first time the page renders.
    Is this possible to do? If yes, how?To achieve this option, first create the bookmark and then under action within the bookmark portel click on Create Link. Copy everything after the question mark. Next go to manage package and paste the copied text into the Query String text box.
    Also, are there any other ways to achieve this result, other than using the Bookmark component?Option two would be to utilize deep linking method to access the page.
    Hope this helps.

  • TS1702 I had this Scrabble on my iPad2 and began to have connection problems, it would lock in the "connecting" position. This is not the first time Scrabble has had problems with interface. Typically customers delete the Ap then download it again to rein

    I have contacted EA about this and can find no help. I had this Scrabble on my iPad2 and began to have connection problems, it would lock in the "connecting" position. This is not the first time Scrabble has had problems with interface. Typically customers delete the Ap then download it again to reinstall it. During the process you sign in and approve the purchase KNOWING that another window will open saying that you have previously purchased it and that there is no charge. So what happened this time? It will not connect and all of my saved and current games are wiped out. I want my money back, this game interface is pretty junk and operates like some ancient DOS program,,bug,bug,buggy. I want my money back.

    Go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store.
    Regards.

  • By default in a table,adf query panel should be executed first time output

    Hello all,
    I am using adf 11g. I have taken adf query panel and i have taken seperate another table.My Requirement is first time in table ,query should be executed after that in search button then according to date/query should be executed in a table.
    Thanks in advance.
    Anup

    Hi All,
    Same problem i m getting.By default Data is not comming bfr search button,if search button then data is comming.Plz give me reply.
    Thanks
    Anup

  • Sql query when fired for first time

    Here is my query. I installed database and software using DBCA. Now i got connected to sql. Now my doubt is when I fired SELECT * FROM EMP from scott user, for the first time, what are the different steps followed to fectch the data. I mean how the user gets connected to the database and which background process works at what stages. Please give detailed explanation. Thanks.

    When connecting to the database the client makes a request to the listener, and the listener checks the availability of the requested database service and responds to the client with an ACCEPT message, which indicates connection dispatching.
    After that, the listener sends a RESEND message back to the client and uses this time to check the database service. The client recieves the RESEND message and sends the same request again to the Listener.
    After recieving the ACCEPT message the connection is established, and this connection is different depending if you are using a Dedicated Server or Shared Server configuration.
    When you issue the query:
    SELECT * FROM emp;Oracle checks in the Shared Pool, in the Data Dictionary cache if the object exists and if you have sufficient privileges to access it (user Scott in this case). It then checks the Library cache if this statement has been executed before. If it did, another parse will not be necessary. Then the SQL statement is parsed (if necessary), interpreted and executed.
    The DBRW (Database Writer) background process then checks in the Buffer Cache if the blocks which contain the information from the EMP table are already there. If they are, a physical read is not necessary and it fetches the rows from the Buffer Cache.
    If they are not, DBWR reads the data files, retrieves the data from them, store the related blocks in the Buffer Cache (so in the next executions of this query a physical read will not be needed) and then the data is shown to the user.
    There are other details envolved, but in a general view that is what happens.

  • Query execution slow for the first time...

    I am new to Oracle sql.
    I have a query whose performance is very slow for the first time, but on subsequent executions its fast. When executed for the first time it is taking around 45 seconds and on subsequent executions, 600 milliseconds.
    Is there a specific reason for this to happen. I am calling this query from my java code using a prepare statement.

    Are the differences in queries solely in the where clause? If so can you parameterize the query and use bind variables instead so the only difference from one query to the next is the values of the bind variables? Using bind variables in your queries will enable the parser to reuse the already parsed queries even when the bound values differ.
    Also there may be other optimizations that can be made to either your query or the tables that it is querying against to improve your performance. To be able to improve your queries performance you need to understand how it's accessing the database.
    See Rob's thread on query optimization [When your query takes too long |http://forums.oracle.com/forums/thread.jspa?threadID=501834&start=0&tstart=0] for a primer on optimizing your query.

  • The query just run the first time, the second doesnt run

    The query just run the first time, the second doesnt run, i checked it in the SM50 and appear this msg:
    CL_RSR_CACHE_BO_FF============CP
    its not a problem of indexes, i repaired it but its really weird cause the first time the query run ok, the second doesnt, it seems that the cache is confused or i dont know, help guys, i'll really appreciate it

    I was watching the notes, its really weird when i load the cube and execute the query for the first time, its ok, to the second stay in cache, but i was watching that the cube doesnt allow me activat the BD statistics, i dont know if this is necesary to improve the performance of the query, what i know is this:
    1- before i create a Hierarchy for an infoobject thta is in the cube ,  the query used to run ok. Now when i load the first time and execute its ok, but the second stay in cache.
    2- now i can activate the statistics for the cube, the indexes are ok, i checked for the RSRV and all is ok less the statistics.
    what can i do help friends...

  • How do we tune a query that takes more time for the first time?

    Hi,
    First time it takes 20 secs and subsequent times 2 secs.
    Let me know if you need more info
    Thanks

    Following are the parameters set at the DB level.
    .__db_cache_size=2214592512
    .__java_pool_size=16777216
    .__large_pool_size=16777216
    .__shared_pool_size=1543503872
    .__streams_pool_size=33554432
    *._optimizer_cost_based_transformation='off'
    *._smu_debug_mode=4
    *.compatible='10.2.0.1.0'
    *.cursor_sharing='SIMILAR'
    *.db_block_size=8192
    *.db_domain=''
    *.db_file_multiblock_read_count=16
    *.job_queue_processes=10
    *.open_cursors=5000
    *.optimizer_mode='ALL_ROWS'
    *.pga_aggregate_target=1277165568
    *.processes=250
    *.remote_login_passwordfile='EXCLUSIVE'
    *.sessions=1000
    *.sga_target=3833593856
    *.undo_management='AUTO'
    *.undo_tablespace='UBPTAB_UNDO'
    Execution Plan
    Plan hash value: 2107556093
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 45157 | 29M| | 9094 (1)| 00:01
    :50 |
    | 1 | SORT ORDER BY | | 45157 | 29M| 78M| 9094 (1)| 00:01
    :50 |
    |* 2 | TABLE ACCESS FULL| <tname>| 45157 | 29M| | 2564 (2)| 00:00
    :31 |
    Following are result from dba_tab_statistics.
    NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_CACHE_HIT_RATIO AVG_ROW_LEN
    112704 11520 768 685
    AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS
    0 0
    Follwing was the time it has taken to generate the explain plan report after issuing the below command.
    set autotrace traceonly
    Elapsed: 00:00:15.49
    Following is the statistics
    Statistics
    0 recursive calls
    0 db block gets
    11380 consistent gets
    0 physical reads
    0 redo size
    8823636 bytes sent via SQL*Net to client
    37731 bytes received via SQL*Net from client
    3019 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    45267 rows processed
    Pl let us know how to tune the same.
    Thank you all for the help

  • Using Bulk Scenario to Capture Data from Source for First time

    Hi,
    I need to setup ODI for a table between two Database. Genereally, I follow practice of importing oracle  dump of table into target database for the first time before delta capture preocess starts. However, this time there is space constraint at source system & we can not create the oracle dump as it will result into 120-130 GB.
    Is it possible to import these one time data into target Database via ODI Bulk Schenario. Does ODI have any timeouts set at the database connetion as this will take long running session to copy across such a huge data. Will it cause any time outs at Database.
    Please suggest.
    Thanks.

    Hi All,
    Thanks a lot for your responses. Moving ahead and trying out different things, i figured out that the EPMA/Planning had to be on the same machine as the ERPI. After installing EPMA/Planning on the same machine, the ERPI target application registration page started displaying all the applications created using the EPMA and i also successfully registered my target planning application with ERPI. But you know life is not that fair, right after the resolution of this problem, another problem appeared :(. While registering the target planning application, EPMA was by default selected as the Metadata Load method and i selected FDM as the data load method.
    After registering the application, i happily started adding the metadata rule as instructed in the knowledge document 951369.1 (Thanks user735469 for the reference), but when i clicked on the Add Dimension button, the next page gave an error stating There are no more dimensions remaining to be mapped under this application. and the dimensions drop down under the target application area was empty.
    According to this link http://download.oracle.com/docs/cd/E12825_01/epm.111/readme/fdm_11113_readme.html , this error can be fixed by clicking on the refresh button but i couldnt find a refresh button on the entire page. I tried refreshing the browser but to vain. I also downloaded and applied latest ERPI patch but still no positive results.
    Any idea why is this happening ?
    Desperately waiting for your help. :(
    Thanks & Regards,
    Muhammad Jamshaid Nawaz

  • Long time to open workbook for first time

    Hi,
    I have a workbook with three queries . Performance of workbook is good when it was created for first time. It has additional 22 sheets with formulas and other sheets with values based on query sheets.
    The problem starts after I close the existing session and open in another session when it takes 15 to 20 minutes to come up.But after that the book is slow even for single click button action.
    Version of analysis 1.4.6
    Win 7(64 bit)
    Ms office 2010(32 bit)
    Refresh on opening is disabled.
    Few thing which I did:
    >> I opened up task manager and did analyze wait chain, I found that excel.exe is waiting for splwow64.exe process.
    >> I enabled logging at "debugging information" in support setting for workbook and checked things out in log file.
    Found that
    There was warning "AddSerializer failed (Command processors not initialized)
    Looking at log file for events when book took time to open, I found that time stamp gap between  following events"
    -verbose: Working mode as serialized in document:'Local'
    -verbose: Successfully deserialized system info from workbook  XML
    - verbose: ...its logs various properties of queries like query name,id etc"
    and its immediate previous event of cache formula string is 20 mins.
    >> in another session I opened a workbook with normal performance.Found above mentioned warning message and deserialization... information.
    the difference in this case is that there is not delay in events.
    Has anybody faced this issue? Any idea on deserialization of workbook xml in analysis.
    Any idea where is metadata saved in analysis. is it in form of some hidden script object just as in BEx 7.0
    Thanks
    Pramod.

    Hi Pramod,
    Since you have several sheets in this workbook, have you checked the number of custom styles?
    Please check the SAP note http://service.sap.com/sap/support/notes/1899658
    According to the note, too many styles slow down Analysis for Office.
    The note also contains a macro that you can run on your workbook to delete the custom styles if you want to check.
    Regards,
    Filipe

  • First time an SQL expression is placed on report a DB SELECT executes

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue). I'm using CR XI.
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    This is a cross post of:
    1st time an SQL expression is placed on report a DB SELECT executes
    Please do not cross post. See the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
    The above post has been moved to the Crystal Reports Design forum, thus locking this thread.
    Ludek

  • First time an SQL expression is placed on report a DB SELECT executes -CRXI

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen.  I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    duplicate - please do not post multiple times

  • Report which contain subreports is not rendered first time is processed.

    when I try to render report contains subreports from first time is not rendered but when i select regresh button the input screen is promb again and then i fill all input again and submit, as a result the report was rendered.
    why this happen? is this a know issue?

    after more testing that issue i discovered that when i try to render report of type "Table" then the report is rendered fom rthe first time i pass/set the input values of the report, but when i use reports of type "chart" the report is not rendered from first time and it need a refresh and then manually entering the values for the input.
    i am using the folloing version of JRC:
    com.businessobjects.sdks_.jrc_.11.8.0_11.8.5.v1197
    my code is a s follow:
    =========================
    <%@ page contentType="text/html; charset=utf-8" %><%@ page import="com.crystaldecisions.reports.sdk.ReportClientDocument"%>
    <%@ page import="com.crystaldecisions.report.web.viewer.*" %>
    <%@ page import="com.crystaldecisions.reports.sdk.DatabaseController" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.ReportSDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.PropertyBag" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.IStrings" %>
    <%@ page import="com.crystaldecisions.reports.sdk.ParameterFieldController" %>
    <%@ page import="com.crystaldecisions.reports.exportinterface.ExportFormatType" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
    <%@ page import="java.io.ByteArrayInputStream" %>
    <%@ page import="java.io.FileOutputStream" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PrinterDuplex" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PrintReportOptions" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PaperSource" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PaperSize" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.exportoptions.*" %>
    <%@ page import="java.io.OutputStream" %>
    <%@ page import="org.t2k.bl.reports.ReportsViewerManager" %>
    <%@ taglib prefix="lms_reports" tagdir="/WEB-INF/tags/lms/reports" %>
    <%!
    Utility method that demonstrates how to write an input stream to the server's local file system.
        private void writeToBrowser(ByteArrayInputStream byteArrayInputStream, HttpServletResponse response, String mimetype, String exportFile, boolean attachment) throws Exception {
            //Create a byte[] the same size as the exported ByteArrayInputStream.
            byte[] buffer = new byte[byteArrayInputStream.available()];
            int bytesRead = 0;
            //Set response headers to indicate mime type and inline file.
            response.reset();
            if (attachment) {
                response.setHeader("Content-disposition", "attachment;filename=" + exportFile);
            } else {
                response.setHeader("Content-disposition", "inline;filename=" + exportFile);
            System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            response.setContentType(mimetype);
            System.out.println("aaaaa1111");
            OutputStream outs = response.getOutputStream();
             System.out.println("aaaaa2222");
            //Stream the byte array to the client.
            while ((bytesRead = byteArrayInputStream.read(buffer)) != -1) {
                outs.write(buffer, 0, bytesRead);
            System.out.println("bbbbb");
            //Flush and close the output stream.
            outs.flush();
    //        outs.close();
            System.out.println("ccccc");
        /* Include the file AlwaysRequiredSteps.jsp, which contains the code to:
           - Create an Enterprise SessionMgr object
           - Log on to the CMS
           - Create an IInfoStore object
           - Query for and select a report
           - Create an IReportAppFactory object
           - Use the IReportAppFactory object to create a ReportClientDocument object with the IInfoObject that is retrieved from the query
    Logs on to all existing datasource
    @param clientDoc The reportClientDocument representing the report being used
    @param username    The DB logon user name
    @param password    The DB logon password
    @throws com.crystaldecisions.sdk.occa.report.lib.ReportSDKException
        public static void logonDataSource
                (ReportClientDocument
                        clientDoc,
                 String username, String
                        password
                throws
                ReportSDKException {
            clientDoc.getDatabaseController().logon(username, password);
    Changes the DataSource for each Table
    @param clientDoc The reportClientDocument representing the report being used
    @param username  The DB logon user name
    @param password  The DB logon password
    @param connectionURL  The connection URL
    @param driverName    The driver Name
    @param jndiName        The JNDI name
    @throws ReportSDKException
        public static void changeDataSource
                (ReportClientDocument clientDoc,
                 String username, String password, String connectionURL,
                 String driverName, String jndiName
                throws
                ReportSDKException {
            changeDataSource(clientDoc, null, null, username, password, connectionURL, driverName, jndiName);
    Changes the DataSource for a specific Table
    @param clientDoc The reportClientDocument representing the report being used
    @param reportName    "" for main report, name of subreport for subreport, null for all reports
    @param tableName        name of table to change.  null for all tables.
    @param username  The DB logon user name
    @param password  The DB logon password
    @param connectionURL  The connection URL
    @param driverName    The driver Name
    @param jndiName        The JNDI name
    @throws ReportSDKException
        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_OPTIONAL_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;
            // Obtain collection of tables from this database controller
            if (reportName == null || reportName.equals("")) {
                Tables tables = clientDoc.getDatabaseController().getDatabase().getTables();
                for (int i = 0; i < tables.size(); i++) {
                    origTable = tables.getTable(i);
                    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
    //                    System.out.println(newTable.getQualifiedName() + "  -  " + origTable.getQualifiedName());
                        newTable.setQualifiedName(origTable.getAlias());
    //                    newTable.setAlias(origTable.getAlias());
                        // 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 ODBC", USE_JDBC);
                        propertyBag.put("Database DLL", DATABASE_DLL);
                        propertyBag.put("JNDIOptionalName", JNDI_OPTIONAL_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("Database Name", DATABASE_NAME); //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.setUserName(DB_USER_NAME);
                        connectionInfo.setPassword(DB_PASSWORD);
                        // Update the table information
                        clientDoc.getDatabaseController().setTableLocation(origTable, newTable);
            // Next loop through all the subreports and pass in the same
            // information. You may consider
            // creating a separate method which accepts
            if (reportName == null || !(reportName.equals(""))) {
                IStrings subNames = clientDoc.getSubreportController().getSubreportNames();
                for (int subNum = 0; subNum < subNames.size(); subNum++) {
                    Tables tables = clientDoc.getSubreportController().getSubreport(subNames.getString(subNum)).getDatabaseController().getDatabase().getTables();
                    for (int i = 0; i < tables.size(); i++) {
                        origTable = tables.getTable(i);
                        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
    //                        System.out.println(origTable.getQualifiedName());
                            newTable.setQualifiedName(origTable.getQualifiedName());
                            newTable.setAlias(origTable.getAlias());
                            // Change properties that are different from the original
                            // datasource
                            // 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("JNDIOptionalName", JNDI_OPTIONAL_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("Database Name", DATABASE_NAME); //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.setUserName(DB_USER_NAME);
                            connectionInfo.setPassword(DB_PASSWORD);
                            // Update the table information
                            clientDoc.getSubreportController().getSubreport(subNames.getString(subNum)).getDatabaseController().setTableLocation(origTable, newTable);
    %>
        try {
            // Create the ReportClientDocument object.
            ReportClientDocument clientDoc = new ReportClientDocument();
            clientDoc.open("Class Progress by AI.rpt", 0);
            //start sheeet code            -  work
            changeDataSource(clientDoc, "root", "eatmyshorts",
                    "jdbc:mysql://localhost:3306/lms",
                    "com.mysql.jdbc.Driver", "LMS_MySQL5.1");
            ParameterFieldController paramController = clientDoc.getDataDefController().getParameterFieldController();
            paramController.setCurrentValue("", "Type", "en_US");
            paramController.setCurrentValue("", "SchoolName", "general");
            paramController.setCurrentValue("", "StudyClassName", "classss");
            paramController.setCurrentValue("", "SegmentId", 6);
            paramController.setCurrentValue("", "LAID", 30);
            paramController.setCurrentValue("", "AIID", 205);
            paramController.setCurrentValue("", "LOID", 1);
            IReportSource reportSource = clientDoc.getReportSource();
            // Create a Viewer object
            CrystalReportViewer viewer = new CrystalReportViewer();
            // Set the report source for the  viewer to the ReportClientDocument's report source
            viewer.setReportSource(reportSource);
            // Set the name for the viewer
            viewer.setName("Crystal_Report_Viewer");
            viewer.setPrintMode(CrPrintMode.PDF);
            viewer.setEnableParameterPrompt(true);
            viewer.setEnableDrillDown(true);
            viewer.setOwnPage(false);
            viewer.setOwnForm(true);
            viewer.setDisplayToolbar(false);
            viewer.setDisplayGroupTree(false);
            viewer.setHasPageBottomToolbar(false);
            // Process the http request to view the report
            viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
            // Dispose of the viewer object
            viewer.dispose();
            // Release the memory used by the report
            clientDoc.close();
        } catch (ReportSDKExceptionBase e) {
            e.printStackTrace();
    %>

  • How to use different xsl's for user first time logon in OAM

    Hi,
    We have a requirement to use different stylesheets (xsls) for employees and customers in OAM. How we can configure different XSLs for user first time logon to OAM (i.e for change password and configuring challenge and responses).
    Any pointers on this is appreciated.
    Thanks in advance..
    Srikanth

    XSLs displayed are controlled by the StyleCookie. So if you can set the value of this cookie to be different front customers and employees, they will see different styles.
    You can do this in various locations -> from the web server, from the url, custom plugins, etc....
    -Raj

Maybe you are looking for

  • Office Web App 2013 : Compatibility issue after opening a word document with image from sharepoint 2013

    Hi, Uploaded a word doucment in sharepoint 2013 and When we open it in WebApp2013 then following compatibilty warning is reflecting. "Compatibility Mode Functionality is currently limited" how to supress this warning message ? Thanks. raj

  • Multiple apps failing after update to OS 10.6.8

    Process:         iTunes [2521] Path:            /Applications/iTunes.app/Contents/MacOS/iTunes Identifier:      com.apple.iTunes Version:         ??? (???) Build Info:      iTunes-1113011001003008~1 Code Type:       X86 (Native) Parent Process:  laun

  • Problem downloadin​g maps

    Hi there...I'm trying to download the Maps app and am getting the following error: "Sorry, your device does not meet the system requirements that are needed to support BlackBerry Maps." I have the most updated device drives...any thoughts? Thanks in

  • Error while launching Webdynpro Console

    Hello Gurus, I am trying to launch webdynpro console from the url http://<HOST>:50000/webdynpro/welcome/Welcome.jsp and its giving me error    Internal Server Error   SAP J2EE Engine/7.00    Application error occurred during request processing.   Det

  • Display report problem

    Hi,     I written the code as below in that i have the data in the ITAB15 but in the write statement i cant get the output only for matnr,maktx,meins and soq fields iam getting the data for the rest i have the data in the ITAB15 but it is displaying.