Pass enum type as a paramter of constructor

hi
i have a hospital system application with three main classes Patient, Doctor and Hospital as well as two Enum classes. The Hospital class uses the Patient class's constructors to create object. The parameters that Patient class default constructor takes are-
private Patient(String name, int age, Type patientType, String medicareNo, int hoursTreated) { //set class fields}
now when i actually use this in the hospital class , like -
hospital.patients.add(new Patient ("Fred Bear", 29, PRIVATE, "Ben Casey", "HCF236788", 10, Level.A));
i get error in Netbeans and Eclipse that constuctor not found
can anyone plz tell me how to solve this one!!!
thnx

karanJ wrote:
can anyone plz tell me how to solve this one!!!
Either by passing arguments that match an existing c'tor in number and types of args or by creating a new constructor that matches what you're trying to call in number and types of args. Which one is correct depends on your requirements, so only you know that.

Similar Messages

  • Calling applet from SJ passing enum type

    Is it possible to pass enumeration type when calling applet from JavaScript?
    For example my method in applet looks like:
         public enum ColorEnum {
              RED,
              GREEN,
    BLUE
         public void doSomething(ColorEnum color)
    If I send String in JS like 'RED' I get following exception:
    Message: java.lang.IllegalArgumentException: No method found matching name doSomething and arguments [java.lang.String]

    HI,
    Please check out these links-
    embed java applet in web dynpro
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b3c1af90-0201-0010-c0ac-c8d802d264f0
    Regards
    Lekha

  • Passing enums to functions without knowing the specific enum type

    My application needs the function invocation feature by using reflection mechanism. The function parameters are restricted to string, int, float and enums. I am facing problems with enums.
    Is there a way to invoke the function by passing specific enum type as parameter to the function.
    For eg:
    public void doProcess(int i, COLOR.RED){
    I should be able to invoke the above function using reflections. How dynamic casting to COLOR can be done is the question here?

    The application takes XML file as an input. This file has processing instructions. The processing instruction provides data about the class name, function name and parameters specifications like
    Classname_FunctionName("String param", 123, COLOR.RED)
    The application should invoke the corresponding library function by passing these parameters after assessing the correct types.

  • Query on conversion between String to Enum type

    Hi All,
    I would like to get advice on how to convert between char and Enum type. Below is an example of generating unique random alphabet letters before converting them back to their corresponding letters that belonged to enum type called definition.Alphabet, which is part of a global project used by other applications:
    package definition;
    public enum Alphabet
    A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,
    T, U, V, W, X, Y, Z
    public StringBuffer uniqueRandomAlphabet()
    String currentAlphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    StringBuffer randomAlphabetSB = new StringBuffer();
    for (int numberOfAlphabet=26; numberOfAlphabet>0; numberOfAlphabet--)
    int character=(int)(Math.random()* numberOfAlphabet);
    String characterPicked = currentAlphabet.substring(character, character+1);
    // System.out.println(characterPicked);
    randomAlphabetSB.append(characterPicked);
    StringBuffer remainingAlphabet = new StringBuffer( currentAlphabet.length() );
    remainingAlphabet.setLength( currentAlphabet.length() );
    int current = 0;
    for (int currentAlphabetIndex = 0; currentAlphabetIndex < currentAlphabet.length(); currentAlphabetIndex++)
    char cur = currentAlphabet.charAt(currentAlphabetIndex);
    if (cur != characterPicked.charAt(0))
    remainingAlphabet.setCharAt( current++, cur );
    currentAlphabet = remainingAlphabet.toString();
    return randomAlphabetSB;
    // System.out.println(randomAlphabetSB);
    I got the following compilation error when trying to pass (Alphabet) StringBuffer[0] to a method that expects Alphabet.A type:
    inconvertible types
    required: definition.Alphabet
    found: char
    Any ideas on how to get around this. An alternative solution is to have a huge switch statement to assemble Alphabet type into an ArrayList<Alphabet>() but wondering whether there is a more shorter direct conversion path.
    I am using JDK1.6.0_17, Netbeans 6.7 on Windows XP.
    Thanks a lot,
    Jack

    I would like to get advice on how to convert between char and Enum type. Below is an example of generating unique random alphabet lettersIf I understand well, you may be interested in method shuffle(...) in class java.util.Collections, which randomly reorders a list.
    before converting them back to their corresponding letters that belonged to enum type called definition.AlphabetIf I understand well, you may be interested in the built-in method Alphabet.valueOf(...) which will return the appropriate instance by name (you'll probably have no problem to build a valid String name from a lowercase char).

  • Enum type is retrieving me a null reference

    Hi, i have a very strange bug in my code that is messing me up.
    I defined two enum types in separated files like this:
    public enum Section {
         SectionA, SectionN;
    public enum Subsection {
        SubA(1, SectionA), SubN(2, SectionN);
        private Section sec;
        private int num;
        Subsection (int num, Section sec) {
            this.num = num;
            this.sec = sec;    // Here is the problem
    }Well, the problem is that in the line with the comment I'm recieving a null reference and I think that is not possible. Is that a compiler bug?

    I'm no getting any error message, let me show you my code:
    The problematic enum type.
    public enum Subseccion {
        ALUMNOS_ALTA(1, AltaAlumnos.class, "Alta", Privilegio.ALTA_ALUMNOS, Seccion.ALUMNOS),
        ALUMNOS_BUSCAR(2, BuscarAlumno.class, "Buscar", Privilegio.BUSCAR_ALUMNOS, Seccion.ALUMNOS),
        ALUMNOS_EDITAR(3, EditarAlumno.class, "Editar", Privilegio.EDITAR_ALUMNOS, Seccion.ALUMNOS),
        PERSONAL_ALTA(1, AltaPersonal.class, "Alta", Privilegio.ALTA_PROFESORES, Seccion.PERSONAL),
        PERSONAL_BUSCAR(2, BuscarPersonal.class, "Buscar", Privilegio.PERSONAL_BUSCAR, Seccion.PERSONAL),
        PERSONAL_EDITAR(3, EditarPersonal.class, "Editar", Privilegio.PERSONAL_EDITAR, Seccion.PERSONAL),
        MATERIAS(1, Materias.class, "Materias", Privilegio.ASIGNATURAS, Seccion.CURSOS),
        CURSOS(2, Cursos.class, "Cursos", Privilegio.CURSOS, Seccion.CURSOS),
        GRUPOS(3, Grupos.class, "Grupos", Privilegio.GRUPOS, Seccion.CURSOS),
        ASIGNAR_GRUPOS(4, AlumnosSalones.class, "Asignar Grupos", Privilegio.ASIGNAR_GRUPOS, Seccion.CURSOS);
        private final Class<? extends JPanel> panel;
        private final String texto;
        private final Seccion pa;  // La secci�n a la que pertenece
        private final Privilegio priv;   
        private final int importancia;
        Subseccion(int importa, Class<? extends JPanel> panel, String texto, Privilegio priv, Seccion fad) {
            this.panel = panel;
            this.texto = texto;
            if (fad == null)
                System.err.println("A NULL REFERENCE");   // Always happen
            pa = fad;
            this.priv = priv;
            this.importancia = importa;
        public int getImportancia() {
            return importancia;
         * Regresa el Panel construido que corresponde a la secci�n.
         * @param d El Objeto de base de datos que se usar� para crear el Panel.
         * @param ven El Objeto de ventana que se usar� para crear el Panel.
        public JPanel getPanelInstance(BaseDeDatosE d, VentanaPrincipal ven)
            throws InstantiationException, NoSuchMethodException, IllegalAccessException,
                    java.lang.reflect.InvocationTargetException {
            // Construyo el panel si es que hay uno asociado
            Constructor<? extends JPanel> cons = panel.getConstructor(BaseDeDatosE.class, VentanaPrincipal.class);
            JPanel panel = cons.newInstance(d, ven);
            return panel;
         * Devuelve el privilegio asociado a esta secci�n.
        public Privilegio getPrivilegio() {
            return priv;
         * Pone el "bot�n" en RollOver.
         * @param btn El "bot�n"
        public void setEstadoRollOver(JPanel btn) {
         * Pone el "bot�n" en estado presionado.
         * @param btn El "bot�n"
        public void setEstadoPresionado(JPanel btn) {
         * Devuelve la secci�n a la que pertenece.
        public Seccion getSec() {
            return pa;
         * Pone el "bot�n" en estado normal.
         * @param btn El "bot�n"
        public void setEstadoNormal(JPanel btn) {
    The enum type that is getting null.
    public enum Seccion {
        ALUMNOS(null, "/alumno", "Alumnos",
                new Subseccion[] {Subseccion.ALUMNOS_BUSCAR, Subseccion.ALUMNOS_ALTA, Subseccion.ALUMNOS_EDITAR},
                null),
        PERSONAL(null, "/profesor", "Personal",
                 new Subseccion[] {Subseccion.PERSONAL_BUSCAR, Subseccion.PERSONAL_ALTA, Subseccion.PERSONAL_EDITAR},
                 null),
        CURSOS(null, "/cursos", "Cursos",
               new Subseccion[] {Subseccion.CURSOS, Subseccion.GRUPOS, Subseccion.MATERIAS, Subseccion.ASIGNAR_GRUPOS},
               null),
        CURSOS_CALIFICAR(CalificarCursos.class, "/default", "Calificar Cursos", null, Privilegio.CALIFICAR_CURSOS),
        ASISTENCIA(Asistencia.class, "/default", "Asistencia", null, Privilegio.ASISTENCIA);
        private final Class<? extends JPanel> panel;
        private final String prefijoImagen;
        private final Subseccion[] subs;  // Las subseciones de esta secci�n
        private final String etiqueta;  // El texto que va a llevar el icono
        private final Privilegio priv;
        Seccion (Class<? extends JPanel> panel, String prefijoImagen, String etiqueta, Subseccion[] subs, Privilegio priv) {
            this.panel = panel;
            this.prefijoImagen = prefijoImagen;
            this.subs = subs;
            this.etiqueta = etiqueta;
            this.priv = priv;
         * Regresa el Panel construido que corresponde a la secci�n.
         * @param d El Objeto de base de datos que se usar� para crear el Panel.
         * @param ven El Objeto de ventana que se usar� para crear el Panel.
         * @return <code>null</code> Si no tiene un panel asociado.
        public JPanel getPanelInstance(BaseDeDatosE d, VentanaPrincipal ven)
            throws InstantiationException, NoSuchMethodException, IllegalAccessException,
                    java.lang.reflect.InvocationTargetException {
            if (panel != null) {
                // Construyo el panel si es que hay uno asociado
                Constructor<? extends JPanel> cons = panel.getConstructor(BaseDeDatosE.class, VentanaPrincipal.class);
                JPanel panel = cons.newInstance(d, ven);
                return panel;
            return null;
         * Devuelve el privilegio asociado a esta secci�n.
         * @return <code>null</code> Si no existe un privilegio asociado.
        public Privilegio getPrivilegio() {
            return priv;
         * Pone el icono de estado RollOver.
         * @param etiq El JLabel asociado a esta secci�n
        public void setIconoRollOver(JLabel etiq) {
            etiq.setIcon( new ImageIcon( getClass().getResource(prefijoImagen + "BtnOver.jpg") ) );
         * Pone el icono de estado Presionado.
         * @param etiq El JLabel asociado a esta secci�n
        public void setIconoPresionado(JLabel etiq) {
            etiq.setIcon( new ImageIcon( getClass().getResource(prefijoImagen + "Btn.jpg") ) );
         * Pone el icono de estado Normal.
         * @param etiq El JLabel asociado a esta secci�n
        public void setIconoNormal(JLabel etiq) {
            etiq.setIcon( new ImageIcon( getClass().getResource(prefijoImagen + "BtnBco.jpg") ) );           
         * Obtiene un arreglo con las subsecciones disponibles, en primer lugar la que
         * se deber�a mostrar por defecto.
         * @return <code>null</code> Si no tiene subsecciones asociadas.
        public Subseccion[] getSubsecciones() {
            return subs;
         * Le pone el texto a la etiqueta que muestra el icono de la secci�n.
        public void setTextoIcono(JLabel etiq) {
            etiq.setText(etiqueta);
    }And if you do
    Subseccion.ALUMNOS_ALTA;The message "NULL REFERENCE" is printed.

  • Enum type class hierarchy.

    Hi,
    I was reviewing and eagerly testing the Typesafe Enum Facility (enum types) on 1.5.0 beta, which is still in Public Review in the JCP (JSR-201).
    I would would like to mention a missing feature that I find usefull and powerfull for a custom framework architecture.
    I understand and agree with respect to the first question on the JSR 201 FAQ, about subclassing enums.
    Having enumeration constants from both the superclass and the subclass is quite confusing and I agree with disallowing it from the language.
    But I miss the ability to inherit custom behavior (methods, and not enumeration constants), for an enum type, from a middle superclass. This middle superclass could be a base class for enum types within a specific development framework (and of course, java.lang.Enum would by in is class hierachy).
    The actual proposal allows for an enum type to only have java.lang.Enum as superclass, from which it inherits methods like name() and ordinal(). But in a proyect where a large number of diferent enum types with a common and custom extra framework behavior (like a localizedName() or propertyKey() method for example) would need the implementation of this behavior in each enum type source code (or in a helper class).
    Following the example above, the actual proposal would need the following coding in order to add an additional behavior to all (or some) of the enum types in a development proyect:
    public interface MyBaseFrameworkEnum {
         String localizedName();
         String propertyKey();
    public enum FooEnum implements MyBaseFrameworkEnum {
         FOO_A, FOO_B;
         public String localizedName() {
              //..... coding necesary in every enum implementing BaseFrameworkEnum
         public String propertyKey() {
              //..... coding necesary in every enum implementing BaseFrameworkEnum
    As you see, every enum type in my example framework (like FooEnum) would need to code both methods localizedName() and propertyKey() which would produce a lack of centralized code and increase of class file size.
    It would be very powerfull to be able to use the following coding:
    public abstract enum MyBaseFrameworkEnum {
         public String localizedName() {
              //..... coding centralized
         public String propertyKey() {
              //..... coding centralized
    public enum FooEnum extends MyBaseFrameworkEnum {
         FOO_A, FOO_B;
    As you see, with this abstract enum MyBaseFrameworkEnum (which does not falls in the subclassing problem mentioned in the FAQ) does not define enum constants and will pass its custom behavior to its subclass enums. thus centralizing the related code.
    I generally use an implementation of the Typesafe Enum Pattern so I really am looking forward for this new Typesafe Enum Facility in the Java language. But, as an example, I generally use common features in my enums, a properyKey() method used to get a unique key in order to internationalize my applications, since a description to enums is normally needed to be displayed to users.
    I believe this capability would be very powerfull in cases where common features are needed for enums in a development proyect with respect of:
    - code centralization and maintainance.
    - class file size.
    - source code readability.
    This extension would not contradict the actual definition, it would only allow for an enum type to be able to extend from another abstract enum type which has no enumeration constants.
    I believe that if there are other programmers that find this extension worth, it could make it in the JSR-201(which is in public review until February 21th) process before the final specification.
    Regards,
    Luis Longeri

    It would be very powerfull to be able to use the
    following coding:
    public abstract enum MyBaseFrameworkEnum {
         public String localizedName() {
              //..... coding centralized
         public String propertyKey() {
              //..... coding centralized
    public enum FooEnum extends MyBaseFrameworkEnum {
         FOO_A, FOO_B;
    }Luis, I like your idea but don't really like the idea of an abstract enum. I think this would be better
    public class MyBaseFrameworkEnum extends Enum {
         public String localizedName() {
              //..... coding centralized
         public String propertyKey() {
              //..... coding centralized
    public enum FooEnum extends MyBaseFrameworkEnum {
         FOO_A, FOO_B;
    }However, this always opens up the risk of you breaking the enum specific stuff, so all the vulnerable Enum methods would need to be declared "final".
    Because you are unlikely to see this in the language any time soon (if at all), you can always centralise your code in some static methods that take the enum as an argument
    public class MyBaseFrameworkEnumTools {
         public String localizedName(Enum e) {
              //..... coding centralized
         public String propertyKey(Enum e) {
              //..... coding centralized

  • Enum type as generic

    In the following, what should X be so that E is recognized as an enum type?
    class A<E extends X> {
        . . . E.values() . . .
    }It seems that X of Enum<E> should work, but no joy. I thought that enum types were subclasses of java.lang.Enum, but apparently not fully.

    Enum<E> does not have a method values(). The compiler generates this method for every enum, but it is not declared in Enum.
    It can't be declared in Enum because it is static, and in Enum it would also be abstract (it is not implemented there), but static and abstract are incompatible modifiers.
    Even though we know it will always work, the language has no way to specify that every Enum<E> has that method, and so you can't call it on a type variable.
    As a solution (if you really need this to work), put a Class<E> argument in the constructor, save the Class<E> reference, use reflection on the reference to get values().class A<E extends Enum<E>> {
        Class<E> type;
        A(Class<E> type) { this.type = type; }
        void yourMethod() {
            E[] values=type.getMethod("values").invoke(null);
    }You'll need to deal with a few exceptions but they shouldn't in practice get thrown.
    Bruce

  • Reflection and enum types: help needed

    Hello, I just released a new version of my OpenSource project (http://sourceforge.net/projects/jdbcmanager).
    The application needs JRE 1.5 just only for printing tables (JTable.getPrintable(...) method).
    I have had a lot of complains from users due to requiring 1.5
    So I'm trying to make it compatible with 1.4.2 and also provide JTable printing functionality to 1.5 users.
    I can check if JRE in use is 1.5 and then invoke getPrintable(...) method via reflection, but I do not find a way to pass its first argument (an enum) via reflection, because in 1.4.x enum type does not exist, and without solving this the compiler reports a compilation error.
    Here is the code I'm using:String sJavaVer = System.getProperty( "java.version" );
           if( sJavaVer.charAt( 0 ) == '1' && sJavaVer.charAt( 2 ) < '5' )
               MessageFormat mfHeader = new MessageFormat( sHeader );
               MessageFormat mfFooter = new MessageFormat( sFooter );
               Printable     p        = getPrintable( PrintMode.FIT_WIDTH, mfHeader, mfFooter );
               PrintShop     ps       = new PrintShop( p );
               if( bPreview )
                   ps.showPreview( "Preview: "+ sHeader, getPreferredScrollableViewportSize() );
               else
                   ps.print( bPageDialog );
           else
               App.showMessage( "Warning", "You need JRE 1.5.0 or above to be able to print tables." );
           }Obviously this can't compile under 1.4.x
    Every suggestion is more than welcome.

    I haven't worked with 1.5 enums, but my best guess is that you'd have to get instances of the enums via reflection as well.
    As an incidental suggestion: rather than doing a text search on the "java.version" property, you should simply try to retrieve the "getPrintable" method via reflection. The "if" condition then checks to see if you got anything back.

  • Passing enums as arguments within a jni function

    I am trying to pass enum arguments from a Java/JNI function to a C function. For example,
    public native void java_func(enum pname);
    java_jni_func(JNIEnv * env, jobject panel, enum pname)
    c_func(pname);
    where
    c_func(enum pname);
    But I get the error message "illegal use of this type as an expression"
    Any ideas on how I go about solving my problem.

    Hi DavidBray,
    Your task is very simple, you can pass enum value as argument ( do not pay attention to the message above ). You need only to get the name of an enum value in native method. I wrote you a simple example in MS Windows.
    Here is the code in Java:
    package test;
    public class JEnumToJNI {
         static {
              System.loadLibrary("JNIJEnumToJNI");
         public enum JEnum {
             Ok,
             Cancel
         public static void main(String[] args) {
              PrintEnumValue(JEnum.Ok);
              PrintEnumValue(JEnum.Cancel);
         static native void PrintEnumValue(JEnum val);
    }The native method extracts the name of enum value and prints it. This is code of JNI module:
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
    #include <stdio.h>
    #include <string>
    #include "test_JEnumToJNI.h"
    using namespace std;
    // Converts jstring to string object
    string jstring2string(JNIEnv *env, jstring js)
        string result;
        long len = env->GetStringUTFLength(js);
        char* p = (char*)malloc(len + 1);
        memset(p, 0, len + 1);
        if(len > 0)
            env->GetStringUTFRegion(js, 0, len, p);
        result = p;
        free(p);
        return result;
    BOOL APIENTRY DllMain( HANDLE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
        return TRUE;
    JNIEXPORT void JNICALL Java_test_JEnumToJNI_PrintEnumValue(JNIEnv* env, jclass, jobject enumVal)
        // Get enum class
        jclass jclassEnum = env->GetObjectClass(enumVal);
        if(jclassEnum != 0)
             //Get toString() method
            jmethodID toString_ID = env->GetMethodID(jclassEnum, "toString", "()Ljava/lang/String;");
            //Get enumVal name
            jstring jstrEnum = (jstring)env->CallObjectMethod(enumVal, toString_ID);
            fprintf(stdout, "enum value: %s\n", jstring2string(env, jstrEnum).c_str());
            // Delete local references created
            env->DeleteLocalRef(jstrEnum);
            env->DeleteLocalRef(jclassEnum);
        else
            // If jclassEnum == 0 clear Java Exception
            env->ExceptionClear();
    }The header generated with javah.exe
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class test_JEnumToJNI */
    #ifndef _Included_test_JEnumToJNI
    #define _Included_test_JEnumToJNI
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     test_JEnumToJNI
    * Method:    PrintEnumValue
    * Signature: (Ltest/JEnumToJNI/JEnum;)V
    JNIEXPORT void JNICALL Java_test_JEnumToJNI_PrintEnumValue
      (JNIEnv *, jclass, jobject);
    #ifdef __cplusplus
    #endif
    #endifYour task is very simple and you need not to substitute enum values with numbers.

  • Using, passing enums across subvis (newbie)

    Folks,
    I am building a set of subvis for a customer who will provide their own interface and use that to call into one of my subvis.
    There are many commands (a serial I/O application) to support. What I'm shooting for is an enumeration control for all commands so the customer can just add this to their front panel. As they choose a command this (among other inputs) is passed into my subvi.
    The problem: in my subvi I can see each numeric value for a command (I have a driver to mimic the customer) as 0, 1, 2, 3
    etc. In the case structure in my subvi I would like to be able to have each case refer to the name of each enum rather than raw numbers. So if the user on thier VI selects GetTemperature I want in my subvi case structure to use that same name,
    GetTemperature, rather than 0 and so on.
    This is all to simple a thing to do but I don't see the light (newbie gets bit again). I started out passing string to get the
    ball rolling but I hate that.
    I've been on the forums until my eyes glazed over.
    The zip file has my project (of course it's broken because of a mix of integer/strings in a case statement). MiniMain.vi is
    what I call the driver and Mila.vi is my subvi that eventually the customer will call into.
    Any help would be greatly appreciated.
    Dave
    Attachments:
    MiniMain.zip ‏77 KB

    dkl234 wrote:
    Thanks Sam. Took a short while but I'm good to go with type def.
    But the real problem is: on my driver I will see the enum type names (good). When an enum is choosen I can see it come
    over into my subvi as a value (0, 1, 2 etc, still good). I can wire this input to a case structure but the problem is now all I have
    is a 0 or 1 or 2 or whatever in the subvi to plug into the case structure. I'm hoping there's a way to programmatically convert
    the raw input (0,1,2 and so on) into the enum type names so I can use the enum type names in the case statements.
    Is there a way to process the input value (the 0,1,2 etc) in the subvi back into the enum type names?
    It sounds like you made a type def, but didn't replace the front panel control on your subVI with that new type def.  Right click the control and select Replace >> Select a Control and browse to where you saved the type def control.  Now when you update the type def, all places that call that type def will also be updated, and you can wire that to a case and it will work with the names.  Please post your code because all I am doing is guessing and having a VI I would know the problem and be able to give a better answer.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Is it possible to pass some type of parameter/unique id FROM PDF?

    hi there,
    I will try to explain this as best as I can but please bear with me.
    I have Adobe Acrobat X Pro.
    We have drawings linked to each other in pdf.
    When you open a drawing (say, a layout of a house), my boss wants to be able to click on say, a door, and have all the information on that door pop up (size, manufacturer, when it was shipped, etc). The information log is stored in Excel. I know how to hyperlink to open an excel file FROM pdf, but cannot figure out how to open a specific sheet in Excel. So here is my question:
    1. How do I link to a specific sheet in Excel so it opens when I click on a link in the pdf file?
    Having said that, we are going to have around 1500 items and I don't want to have to create 1500 sheets (if that's even possible) to open the details for each one. So here is question #2:
    2.  Is it possible to pass some type of parameter to excel (or even Access) to know what item was clicked on the pdf file so I can write a macro/code in Excel to just fill in the details for that item? (Hence just needing one sheet instead of 1500?).
    Suggestions/path forwards are welcome.
    I hope this was clear and I thank you in advance.
    Thanks,
    Jessica

    There really isn't a way to do that. It would be possible to export an Excel sheet to a tab-delimited (or CSV, XML) file which could optionally be attached to the PDF. JavaScript inside the PDF could read the data file and extract the information for an item so it could be displayed somehow.

  • Int to enum type loookup

    I am iterating in a while loop and using the index terminal to build an array of differnet values of the same enumerated type control that are from a strict type def enumerated control. What I want to do is to iterate and do a comparison and if the comparison holds, I want to build an array of the correlating enumerated types so that I can use this later on.
    I am using a Function that came with the state diagram toolkit called "int to enum" that the state diagram uses when calculating its next state info. It seems to bomb out when I attempt to wire my enum type control to its input.
    Any ideas?

    I have not used the state diagram toolkit but have extensively employed enums from typedefs. This is very convenient since for comparisons just compare it to a constant version of the typedefs. If you use a strict typedef remember that almost everything must be identical and this causes many problems. Since typedefs of enums rarely have to be strict I would think about why you chose a strict type def as opposed to a normal typedef. One additional added feature is that when wiring a enum typedef to a case structure you can populate the case with the enum named cases. I would speculate that your problems are due to the use of a strict typedef which is only necessary when you are concerned with more than just a typdef's structure and values (i.e aesthetic properties). Hope this helps (again I have not used the state diagram toolkit).
    -Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • % operator in Enum Type

    Dear fellow developers,
    Below is code calculating your weight on different planets using Enum type, from the book of Sun on Java Tutorials. Can anyone tell me what does "%" mean in "%s", "%f" and "%n"?
    How does all three managed to get in the for-each loop without being declared explicitly before it?
    public enum Planet {
    MERCURY (3.303e+23, 2.4397e6),
    VENUS (4.869e+24, 6.0518e6),
    EARTH (5.976e+24, 6.37814e6),
    MARS (6.421e+23, 3.3972e6),
    JUPITER (1.9e+27, 7.1492e7),
    SATURN (5.688e+26, 6.0268e7),
    URANUS (8.686e+25, 2.5559e7),
    NEPTUNE (1.024e+26, 2.4746e7),
    PLUTO (1.27e+22, 1.137e6);
    private final double mass; // in kilograms
    private final double radius; // in meters
    Planet(double mass, double radius) {
    this.mass = mass;
    this.radius = radius;
    private double mass() { return mass; }
    private double radius() { return radius; }
    // universal gravitational constant (m3 kg-1 s-2)
    public static final double G = 6.67300E-11;
    double surfaceGravity() {
    return G * mass / (radius * radius);
    double surfaceWeight(double otherMass) {
    return otherMass * surfaceGravity();
    public static void main(String[] args) {
    double earthWeight = Double.parseDouble(args[0]);
    double mass = earthWeight/EARTH.surfaceGravity();
    for (Planet p : Planet.values())
    System.out.printf("Your weight on %s is %f%n",
    p, p.surfaceWeight(mass));
    Thank you in advance.

    DanielTan_NL wrote:
    How does all three managed to get in the for-each loop without being declared explicitly before it?They are declare. Right here.
    >
    public enum Planet {
    MERCURY (3.303e+23, 2.4397e6),
    VENUS (4.869e+24, 6.0518e6),
    EARTH (5.976e+24, 6.37814e6),etc.
    Every enum has a values() method that returns an array of the values you define for that enum.

  • Can enum type be used in web service

    I am confused about how to use a enum type in web service interface, please do me the favor

    yep, that I assumed that was the category. I meant, What are you trying to do? Is this a webservices specific question or a question about how to use Sun Java Studio Enterprise and Web Service?? If this is a Web Services specific question, try posting to the Web Services forum.
    http://forum.java.sun.com/forum.jspa?forumID=331
    I searched this forum for postings related to your question but did not find much.

  • ORDERS05 IDOC to pass order type RE

    Hello All,
    We want to receive EDI 180 returns document from our warehouse. I figure I'll map the EDI document to ORDERS05. I need to pass order type RE to create the returns order in VA01. Where in the IDOC do I put the RE?
    Thank you.
    Farhaud

    Dear Farhaud,
    E1EDK01 (Document header general data)
    BSART (Document type)
    You can get more details from transaction WE60 -> Basic type: ORDERS05
    I hope this helps.
    Best regards,
    Ian Kehoe

Maybe you are looking for