How to implement a subquery in CR2011 using native formulae?

Hi All, If you look at the following SQL query, we want to have EquipRate based on Current Date for a EquipCode. How can I achieve the same result in Crystal reports designer using native formulas and functions. Thanks for your help. It will help us in not creating a view at the database side.
Select a.EquipRate
From a
Where a.EffectiveDate =
(select Maximum (a.EffectiveDate,b.EquipCode)
  from a, b
   where a.id=b.id)
Thanks

While this is possible, it will be MUCH more efficient to create the view OR to create a Command (SQL Select Statement) in the report to do this.
To do this just in Crystal you could do something like this:
1.  Add Table A.
2.  Add a command that is something like this:
(select  b.EquipCode,
  Maximum (a.EffectiveDate)  as MaxDate
  from a
    inner join b on a.id = b.id
  group by b.EquipCode)
3.  Link the table to the command on EquipCode and EffectiveDate/MaxDate
However, if you have a lot of data, this will be VERY slow because Crystal will pull all of the data into memory and then join the table to the command instead of having the database do the join.
The other "just Crystal" option is to write a single Command that pulls all of the data you need for your report.  If your report has any parameters, you'll want to create them in the Command Editor and use them in the Where clause of the query.  Parameters created in the report can't be "seen" in the Command Editor and using the Select Expert instead of the query itself again means that Crystal will pull all of the data into memory and filter it there instead pushing the filter down to the database.
-Dell

Similar Messages

  • How to implement the function "Slow Play" using MPMoviePlayerController?

    Does anybody have idea to implement the function "Slow Play" using MPMoviePlayerController or some other indirect solutions? Thanks. Kevin.

    You can use the changeSelection(...) method to change the cell with focus.

  • How to implement "delete" on a table using OWB?

    Hi All,
    How do I implement a simple delete using OWB?
    Assumption:
    (1) Table abcd (id number, age number, amt number)
    (2) the_number is a variable
    (3) the_id is a variable
    Want to implement following transformation in OWB?
    DELETE FROM ABCD WHERE AMT=0 AND number = the_number AND id = the_id ;
    Rgds,
    Deepak

    We implemented delete mappings, and delete flows to be able to reverse a failed load. This is in my opinion a very sound and valid reason for deleting from a datawarehouse. Also if the need is there it could be used for deleting old superfluous data from the datawarehouse.
    There are a few things to consider: closed records in type II should be opened up (post mapping).
    Test, test, test.
    It is indeed a bit tricky to realize,but certainly working and possible.
    steps to take are following:
    1) create new mapping
    2) drop mapping table where to delete from onto mapping (2 times, 1 source, 1 target)
    3) map all fields from source to their corresponding fields in target, except the ones that determine the "where" clause (Refered to as filter fields)
    4) Either create a select, or a mapping input parameter which should result in generating the filter-values for your delete.
    5) map above step to the filter fields.
    6)define a delete mapping by altering target table properties as follows:
    6a) Loading Type => Delete
    6b) Match by constraint => No constraints
    7) set properties each field as folows:
    7a) filter fields match column when deleting => Yes
    7b) other fields match column when deleting => No
    Hope this helps,
    Wilco

  • How to implement a opaque label, not use swing

    since i need to implement a opaque label in applet, so i can just use awt, not swing, how should i do?
    thx

    Hi,
    Create your own class that extends java.awt.Label and
    override the "public void paint(Graphics g)" method.
    the body of this method could be something like:
    g.setColor(<your background color of choice>);
    g.fillRect(0,0, getWidth(), getHeight());
    super.paint(g);
    I didn't test this code, it's from the top of my head,
    I leave the testing to you.
    And if you want a reusable component you could add an
    opaque property and only fill the background when the
    component is opaque.
    Best of luck,
    Christhx for your answer, but the problem is that----
    i need the label to be opaque, so maybe behind the label is an image or picture, i can't just simply set the background color. Since all things are created dynamic, i don't know what is its background, so can't paint its background properly.

  • How to implement Calendar (event calendar) And use it in Portal 10g

    Dear Guros,
    I need to develop Event Calendar have the following functionality:
    - Add Event To certain day.
    - All other defualt functionality of the Calendar.
    How can i develop an event Calendar or use some of Exist Calendar.
    I need to use this calendar inside Oracle Portal 10g.
    Please; help me.

    Hi Eugeny,
    I have used the SAP Connector Framework to connect to R/3, get data from a BAPI and then display the data in a HTMLB tableview.
    Have a look at the link below to get information about how to connect to a BAPI from a Java iview.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/using sap adapter for connector framework
    Cheers
    Richard

  • How to implement OData based BASIC Authentication using HTML, JavaScript for Mobile Apps using Apache Cordova/PhoneGap and datajs-1.1.1.js library

    Hello,
    I have an issue with OData based BASIC authentication for iOS App created using HTML, JavaScript, SAP UI5, OData and Apache Cordova/PhoneGap.
    Please check the post here http://scn.sap.com/thread/3527245
    Request you to kindly reply on the above given link.
    Thanks and Regards,
    Suraj Kumar

    Hello Prathik,
    The code which I am using for OData based BASIC Authentication, for my Mobile App is as below.
       var onSuccess = function(data) {
       alert("We are Through"); //Just to check that the OData request was sucessful
       var onError = function(err) {
       switch(err.response.statusCode) {  
       case 403 : {
       window.alert("Error Code - 403, Service unreachable ");
       break;
       case 401 : {
       window.alert("The credentials are incorrect or missing!");
       break;  
    // dataUserName and dataPassword are the two variables, in which I am storing my Username and Password, respectively.
       var connectionRequest = {
       requestUri: "ODATA SERVICE URL GOES HERE/",
       headers: { Authorization : 'Basic ' + Base64.encode(dataUsername + ":" + dataPassword) },
       method: "POST"
       OData.request( connectionRequest, onSuccess, onError);

  • How to implement a password/login feature using the package OWA_SEC

    HELLO.....
    I have another question:
    I am using the following versions of Oracle products
    Connected to:
    Oracle9i Release 9.2.0.5.0 - Production
    JServer Release 9.2.0.5.0 - Production
    SQL> select owa_util.get_version from dual;
    GET_VERSION
    9.0.4.0.1
    (version of OWA packages)
    I have successfully compiled the following package:
    (It is based on a package in the text “Oracle Web Application Programming for PL/SQL Developers” by Susan Boardman etc… page 687-688
    The SPEC and BODY code is as follows:
    CREATE OR REPLACE PACKAGE AUTHEN_TEST IS
    FUNCTION AUTHORIZE RETURN BOOLEAN;
    PROCEDURE HELLO_WORLD;
    END;
    CREATE OR REPLACE PACKAGE BODY AUTHEN_TEST IS
    FUNCTION AUTHORIZE RETURN BOOLEAN IS
    v_user VARCHAR2(10);
    v_password VARCHAR2(10);
    BEGIN
    owa_sec.set_protection_realm('The Realm of Testing');
    v_user := UPPER(owa_sec.get_user_id);
    v_password := UPPER(owa_sec.get_password);
    IF v_user = 'PREN' AND v_password = 'HALL' THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    END AUTHORIZE;
    PROCEDURE HELLO_WORLD IS
    v_status BOOLEAN;
    BEGIN
    htp.p('TESTING');
    v_status := authorize;
    IF v_status = TRUE THEN
    htp.p('WENT TO PASSWORD SECTION');
    ELSE
    htp.p('DID NOT GO TO PASSWORD SECTION');
    END IF;
    END HELLO_WORLD;
    END AUTHEN_TEST;
    As I said the code compiles!!
    However what I want it to do is successfully run the following code from the above package:
    owa_sec.set_protection_realm('The Realm of Testing');
    v_user := UPPER(owa_sec.get_user_id);
    v_password := UPPER(owa_sec.get_password);
    I want the user to be asked for a password and login
    Currently when I use the web based application the browser displays:
    TESTING DID NOT GO TO PASSWORD SECTION
    Any advice is appreciated
    Thank You
    Douglas

    Hello,
    The URL:
    http://www.columbia.edu/~br111/plsqltools/configur.htm#1002513
    has useful information related to my question
    Also this post from Paul M was helpful:
    Finding which OWA packages are available for use in the schema/database
    Thanks
    Doug

  • How can I play video on Android using native player?

    Is there a way to tell android to open my mp4 (either in assets or on external sd)  with it's native video player?
    Just like if I tap this (mp4) file in any android file manager.
    reasons:
    1 - I don't want to write my own player (especially when I have one built in)
    2 - I assume playback experience may be better when playing large file NOT through the AIR.
    So, can I  make something like "NativeApplication.execute(pathToMp4)"?

    Check the hardware acceleration mode you have set. Try to use "direct" acceleration as this will choose between GPU and CPU to render and is most compatible. The setting is in the XML file generated for the app:
    <!-- The render mode for the app (either auto, cpu, gpu, or direct). Optional. Default auto -->
    <renderMode>direct</renderMode>
    And no the device is absolutely not guaranteed to record compatible video at all. Browsers go by browser standards and video recording goes via manufacturer hardware and software limits, features and compatibility. It entirely depends on what you're doing with the video and the mode it is recorded in. If the user checks off the record CIF MMS compatible video and records in that it will not be visible to many browsers. Audio is almost always recorded in ultra-light mp3 or aac so that's why you hear it.
    Android allows you to install many different browsers. Did you install any or set any other browser as the alternate default browser? When you run the video from a file manager you may be running an alternate, capable browser for the codec. AIR may use the native built-in browser. Also it may not load the video into a browser for playback at all as I would suspect a video would be mapped to the devices default media player and not a browser at all. Unless you're able to select the video and explicitly tell it to open in a browser I feel you're actually looking at the video in the "Video" app of your device, which will be compatible with the codec.
    A simple way to check browser compatibility is to copy the video to your computer, upload it to a web server and see how it plays on various desktop browsers. If any of them have black video and only play sound, you know it's a codec issue.

  • How Can I make a Frame AlwaysOnTop using Native Methods

    Hi Have Developed The Sample Application for Always On Top that is compiled successfully even executed without any exception, but the frame is not always On Top As I required.
    I m m using
    -Windows XP 2004
    -J2SDK-1.4.2
    -Microsoft Visual C++ 6.0
    The following is the code
    and all files mentioned right after the code:
    1- MyFrame.java
    import java.awt.*;
    import javax.swing.*;
    public class MyFrame extends JFrame{
         static { System.loadLibrary("MyFrame"); }
         public MyFrame() {
              super();
         public void setAlwaysOnTop(boolean b) {
              int hwnd = getNativeWindowHandle(this);
              setAlwaysOnTop(hwnd, b);
         private native int getNativeWindowHandle(Window window);
         private native void setAlwaysOnTop(int hwnd, boolean flag);
    2- AtTopTestFrame.java
    public class AtTopTestFrame {
         public static void main(String s[])
              MyFrame frm = new MyFrame();
              frm.setSize(300,300);
              frm.show();
              frm.setAlwaysOnTop(true);
    3- MyFrame.cpp
    #include <jni.h>
    #include <jawt.h>
    #include <afxwin.h>
    #include <windows.h>
    #include "MyFrame.h"
    #include "jawt_md.h"
    JNIEXPORT jint JNICALL
    Java_MyFrame_getNativeWindowHandle(JNIEnv *env, jobject jobj, jobject window)
         JAWT awt;
         awt.version = JAWT_VERSION_1_4;
         jboolean result = JAWT_GetAWT(env, &awt);
         if (result == JNI_FALSE)
              return 105;
         JAWT_DrawingSurface* ds = awt.GetDrawingSurface(env, window);
         if (ds == 0)
              return 106;
         jint lock = ds->Lock(ds);
         if ((lock & JAWT_LOCK_ERROR) != 0)
              return 107;
         JAWT_DrawingSurfaceInfo* dsi = ds->GetDrawingSurfaceInfo(ds);
         if (dsi == 0)
              return 108;
         JAWT_Win32DrawingSurfaceInfo* dsiwin = (JAWT_Win32DrawingSurfaceInfo*) dsi->platformInfo;
         jint ret = reinterpret_cast<jint>(dsiwin->hwnd);
         ds->FreeDrawingSurfaceInfo(dsi);
         ds->Unlock(ds);
         awt.FreeDrawingSurface(ds);
         return ret;
    JNIEXPORT void JNICALL
    Java_MyFrame_setAlwaysOnTop(JNIEnv *env, jobject jobj, jint hwnd, jboolean flag)
         if (flag)
              SetWindowPos((HWND) hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
         else
              SetWindowPos((HWND) hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    Steps I performed For compilation
    1-MyFrame.class (with command "javac MyFrame.java")
    2-MyFrame.h (with command "javah MyFrame" )
    3-MyFrame.obj(with command "cl -IE:\j2sdk1.4.2_03\include -IE:\j2sdk1.4.2_03\include\win32 /c -LD -IMyFrame.h MyFrame.cpp")
    4-MyFrame.dll(with command "link /DLL MyFrame.obj E:\j2sdk1.4.2_03\lib\jawt.lib")
    5-AtTopTestFrame.class (with command "javac AtTopTestFrame.java")
    6-Execute AtTopTestFrame.class (with command "java AtTopTestFrame")
    After the steps performed on the above three files. I got a frame appeared as usual but that is not AlwaysOnTop as I required.
    I m again telling that I m using
    -Windows XP 2004
    -J2SDK-1.4.2
    -Microsoft Visual C++ 6.0
    Can any one take a review of this code and please help me. It is most required for my assignment to be completed. I just required my frame AlwaysOnTop.
    Thanks
    Khurram.

    HI guys
    Can any one help me in above problem
    Thanks
    Khurram

  • How to implement user-exit based changes for incompletion status?

    Hi,
    I have to implement changes to incompletion procedure using user exit. I have found the following user exit for controlling header status.
    User exit in Program RV45PFZA
    In this user exit you can store a specification for the reserve fields in VBUK (header status). Reserve field UVK01 could, for example, be used for an additional order status (as for rejections status, etc.).
    The following workareas are available for this user exit:
    VBUK (header status)
    FXVBUP (item status)
    FXVBUV (Incompletion)
    Please help, how to implement changes to incompletion procedure using user exit?
    Regards,
    Chamandeep

    Dear,
             Go to CMOD and enter the enhacement number there. U can find the enhancement number through table MODSAP. here u can enter the enhancement object which is in ur case is Program name. Then you can use the  enchacement number in CMOD and create a project and export it.
    RG,
    VM

  • How to implement SSO to non-SAP systems using SAP logon ticket?

    Hello,
    We would like to implement Single Sign On between our SAP Netweaver system and a Siebel which is a non-SAP system using SAP logon tickets.
    Can anyone please give me some leads on this, in particular:
    1. Is there a JAVA API or an SAP plug-in that can be implemented on the Siebel machine to extract the SAP logon ticket?
    2. As the other machine might seat on a complete different domain, is it possible to implement SAP logon ticket without using cookies (perhaps through the HTTP header?
    3. In case you think using SAP logon tickets is not the best solution here I would be happy to hear any other suggestions you might have.
    Roy

    Hi,
    I'm currently using SAML as well. Unfortunately the SAP J2EE cannot work as authority (identity provider) but what you can do is using an open implementation of SAML such as opensso which is an open version of SUNs Java System access manager.
    There are a couple of other projects such as opensaml, apache's wss4j or shibboleth that might be interesting in this context.
    I just installed opensso and got it working with SAP J2EE 7.0 using SAPs JAAS SAMLLoginModule to authenticate users within SAP J2EE.
    In this scenario opensso serves as identity provider just as you need! There are a couple of Policy agents available on SUNs Download site you can use with Apache, Tomcat, JBOSS, WebSphere, Bea Web Logic etc. in order to authenticate! Otherwise you just directly authenticate against opensso. When installing opensso you can configure the type of user store you want  to use! By default it uses LDAP but you can also use different types of user store using JDBC or other mechanisms. Since you have a Directory Service you could easily connect it to your existing directory.
    There is also a way to map user ids directly in opensso by adding a uid mapping class. I created some documentation with lots of screenshots about using opensso with SAP J2EE. You can easily use opensso with any other system that supports SAML. In the case of SAP the usage is currently limited to SAML versions 1.0 and 1.1. Version 2.0 is not yet supported but should be in one of the following versions.
    Here are some links you might want to check:
    OpenSAML: https://spaces.internet2.edu/display/OpenSAML/Home
    wss4j: http://ws.apache.org/wss4j/
    shibboleth: http://shibboleth.internet2.edu/
    opensso: https://opensso.dev.java.net/
    On SDN you will find a documentation on how to connect SUN Java System Access Manager to SAP J2EE (see https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/906d9fc6-31b9-2910-1385-90edad7d7570). As I said opensso is based on the SUN Access Manager code and looks quite the same. So you can adapt this documentation in order to configure opensso or you can just ask me for the documentation.
    Hope this is helpful...
    Let me know if you need further assistance on this topic
    Cheers

  • How to implement row level security using external tables

    Hi All Gurus/ Masters,
    I want to implement row level security using external tables, as I'm not sure how to implement that. and I'm aware of using it by RPD level authentication.
    I can use a filter condition in my user level so that he can access his data only.
    But when i have 4 tables in external tables
    users
    groups
    usergroups
    webgrups
    Then in which table I need to give the filter conditions..
    Pl let me know this ...

    You pull the Group into a repository variable using a session variable init block, then reference that variable in the data filters either in the LTS directly or in the security management as Filters. You reference it with the syntax VALUEOF("NQ_SESSION.Variable Name")
    Hope this helps

  • How to implement a single sign on  feature using java.

    Hi,
    I have a question like , How to implement **single sign on** feature in java without using any third party framework or tool like LDAP or any other which is available in the market.
    Actually the situation is i have all security information into the table and those information is used for single sign on . If a user logged in from a jsp loging page all the security role should be assigned to that particular user.
    We can do this using LDAP but i am not supposed to use the LDAP or any third party tool . I have to write a java class for that .
    please suggest me the method , how to implement this in a web application.
    Edited by: Rakesh_Singh on Mar 19, 2008 11:55 AM

    you could setup a token that specifies a user is authenticated. other applications that u want SSO can check for existance of this token
    if it is HTTP - you can save the token as a cookie and downstream apps look for this token
    yr code needs to validate that the token/cookie was indeed a valid one and not subject to man-in-the middle attack.

  • How to implement session varibles and how to use it

    how to implement session varibles and how to use it.ple help me

    Please see the below blog, Hope it helps!!!
    http://obieetraining11.blogspot.com/2012/06/create-initialization-block-for-session.html

  • Help!!! How to implement a special useful button in tool bar?

    How to implement a special useful button in tool bar, when the button is clicked, then a menu shows under the button, just like the Internet Explorer's back button and forward button, there is a black arrow at the two buttons right, when click the black arrow, a menu shows under the back button or forward button, how to implement this in java?
    Please help!!!
    Thanks!!!

    Like an enhanced JComboBox?
    ;o)
    V.V.

Maybe you are looking for

  • HT5409 AVCHD audio does not play with the video clip

    iPhoto does not import, or even see the clips, and when QuickTime played the clip off the card itself, no audio is present even though the inspector shows stereo.              

  • Is there additional feature for music or Radio?

    Hi, I want to know that is there additional feature for radio or listening music at CME 7.0? If there is a setting, can anyone guide me how to configure that. thanks

  • HR ABAP - Suggestion

    Message removed Permanently

  • Mac mini does not boot, no video signal, no chime

    My mini "starts" without chime when I press the power button on the back. The fan starts, the light in front goes on and I hear some clicks which could be the hard drive. The screen remains black (no signal) and the mini does not respond to the USB k

  • MSI GE600 Drivers of ATI 5730

    Hi all and sorry for my english. I have a MSI GE600-023 My question is simply : can i install the generic driver of ATI =>  http://game.amd.com/us-en/drivers_catalyst.aspx for my GE600 or I must use obligatory the MSI driver => http://eu.msi.com/inde