CREATING IMAGE DYNAMICALLY (outofmemory exception)

//in my code first i am creating an image using the below lines of
//code on a panel.
image imgOfflineCanvas = createImage( d.width, d.height );
graphics g = (Graphics2D) imgOfflineCanvas.getGraphics();
g.drawImage(imgOfflineCanvas, 0, 0, this);
g.drawRect(
I am getting out of memory exception if i try to create image of bigger size using createImage( d.width, d.height ).So how can i create image with bigger size();

Use BufferedImage to create the Image.
Then draw the Image whereever you want
BufferedImage buffImg = new BufferedImage(width, height , BufferedImage.TYPE_INT_RGB);
Graphics g = buffImg.getGraphics();
//Get the Image
g.drawImage(img, 0, 0, width, height, null);
//Now paint the BufferedImage whereever you want
g.drawImage(buffImg, 0, 0, null);

Similar Messages

  • How to create image dynamically in Java

    Hi
    I am new to image API.
    My requirement is, I need to write some data (for example string line by line) and want to save it as JPG file in my local system.
    Can some one please post the sample code.
    Thanks in Advance
    Kris
    Message was edited by:
    kris-help

    I am not understanding how to proceed.
    If I have any sample code it is going to be very helpful.
    Someone please post the code.
    Thanks in advance.

  • OutOfMemory while creating Images from camera's pictures

    Hi there,
    I am trying to create a javax.microedition.lcdui.Image object from a JPG image created by the 8120 camera. So far I’ve tried simulator only. I use JDE 4.3.0.1r.
    Here is a code from the body of a thread launched from the fileJournalChanged function:
    FileConnection file = null;
    InputStream is = null;
    Image capturedImage = null;
    try {
      file = (FileConnection) Connector.open("file://" + m_sImagePath, Connector.READ_WRITE);
      is = file.openInputStream();
      capturedImage = Image.createImage(is);
    Well, the Image.createImage(is) throws “OutOfMemory” exception, which seems reasonable, given the 1600x1200 dimensions of the pictures captured by simulator/camera. I understand that unpacked bitmap for such an image occupies around 5MB, which seems to be too big for a system to handle when freeMemory() from java.lang.Runtime reports just over 36MB.
    However, I wonder whether there is a way to get around this problem?
    Since I am an inexperienced BlackBerry developer, it is quite possible that I am overlooking an alternative way of creating javax.microedition.lcdui.Image object from a 1600x1200 image captured by the BlackBerry’s camera.
    Regards,
    Aharon.

    Steve:
    Welcome to the Apple Discussions. Were you able at any time to load directly from your camera into iPhoto? If so, did that stop after running some software updaters?
    is there a way to get iPhoto to load these into its library as if it were taking them from a camera?
    As long as the image files are not located inside the iPhoto Library folder you can just drag the folder they are in into iPhoto's open Organize window and they will be imported. If they are in multiple folders then each folder will result in a new roll with those photos.
    If the files are inside the iPhoto Library folder, move them to the desktop and import from there.

  • Create images with dynamic width from 3 images each (left/center/right-part)

    Hello,
    i want to employ a script to create images of dynamic width for me. The whole process shall base on different sized sets of images, which contain a left-image, a right-image and a center-image. The desired width for the different cases shall be reached by duplicating the center-image between the two outer images and placing those images next to each other until the image extends to desired width.
    The layers importet into Photoshop shall be importet as smart-layers (which i already solved).
    Has anyone done something similar already and could give me some useful hints on that issue ?
    I have come up to this until now:
    #target Photoshop
    // =========================== Opens a new document and asks for dimensions ============================
    var myLayerset = File.openDialog ("Select the set of images you want to use!", "*.png",true)
    var myName = prompt("How do you want to call the document?"); // askes for document name
    var width =  prompt("Please insert width for the output here!", ""); // askes for desired width
    var height = prompt("Please insert height for the output here!", ""); //askes for desired height
    var docName = myName +".psd"
    var idMk = charIDToTypeID( "Mk  " );
        var desc3 = new ActionDescriptor();
        var idNw = charIDToTypeID( "Nw  " );
            var desc4 = new ActionDescriptor();
            var idNm = charIDToTypeID( "Nm  " );
            desc4.putString( idNm, """Wunschname""" );
            var idMd = charIDToTypeID( "Md  " );
            var idRGBM = charIDToTypeID( "RGBM" );
            desc4.putClass( idMd, idRGBM );
            var idWdth = charIDToTypeID( "Wdth" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idWdth, idRlt, width );
            var idHght = charIDToTypeID( "Hght" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idHght, idRlt, height );
            var idRslt = charIDToTypeID( "Rslt" );
            var idRsl = charIDToTypeID( "#Rsl" );
            desc4.putUnitDouble( idRslt, idRsl, 72.000000 );
            var idpixelScaleFactor = stringIDToTypeID( "pixelScaleFactor" );
            desc4.putDouble( idpixelScaleFactor, 1.000000 );
            var idFl = charIDToTypeID( "Fl  " );
            var idFl = charIDToTypeID( "Fl  " );
            var idTrns = charIDToTypeID( "Trns" );
            desc4.putEnumerated( idFl, idFl, idTrns );
            var idDpth = charIDToTypeID( "Dpth" );
            desc4.putInteger( idDpth, 8 );
            var idprofile = stringIDToTypeID( "profile" );
            desc4.putString( idprofile, """sRGB IEC61966-2.1""" );
        var idDcmn = charIDToTypeID( "Dcmn" );
        desc3.putObject( idNw, idDcmn, desc4 );
    executeAction( idMk, desc3, DialogModes.NO );
    //==============================================save document================================================
    var idsave = charIDToTypeID( "save" );
        var desc4 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
            var desc5 = new ActionDescriptor();
            var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
            desc5.putBoolean( idmaximizeCompatibility, true );
        var idPhtthree = charIDToTypeID( "Pht3" );
        desc4.putObject( idAs, idPhtthree, desc5 );
        var idIn = charIDToTypeID( "In  " );
        desc4.putPath( idIn, new File( "C:\\Users\\ target folder goes here" + docName ) );
        var idDocI = charIDToTypeID( "DocI" );
        desc4.putInteger( idDocI, 308 );
        var idsaveStage = stringIDToTypeID( "saveStage" );
        var idsaveStageType = stringIDToTypeID( "saveStageType" );
        var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
        desc4.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
    executeAction( idsave, desc4, DialogModes.NO );
    //========================================================================================================
    for (var i = 0; i < myLayerset.length; i++) {
    if (myLayerset[i] instanceof File && myLayerset[i].hidden == false) {
    // ======================================================= opens selected images as smart objects====================
    var idOpn = charIDToTypeID( "Opn " );
        var desc1 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
       desc1.putPath( idnull, myLayerset[i]);
        var idsmartObject = stringIDToTypeID( "smartObject" );
        desc1.putBoolean( idsmartObject, true );
    executeAction( idOpn, desc1, DialogModes.NO );
    //===================================duplicates opened layer into created document========================================
    var idDplc = charIDToTypeID( "Dplc" );
        var desc144 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref135 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref135.putEnumerated( idLyr, idOrdn, idTrgt );
        desc144.putReference( idnull, ref135 );
        var idT = charIDToTypeID( "T   " );
            var ref136 = new ActionReference();
            var idDcmn = charIDToTypeID( "Dcmn" );
            ref136.putName( idDcmn, docName); 
        desc144.putReference( idT, ref136 );
        var idVrsn = charIDToTypeID( "Vrsn" );
        desc144.putInteger( idVrsn, 5 );
    executeAction( idDplc, desc144, DialogModes.NO );
    // ======================================================= close tab without saving ==========
    var idCls = charIDToTypeID( "Cls " );
        var desc156 = new ActionDescriptor();
        var idSvng = charIDToTypeID( "Svng" );
        var idYsN = charIDToTypeID( "YsN " );
        var idN = charIDToTypeID( "N   " );
        desc156.putEnumerated( idSvng, idYsN, idN );
    executeAction( idCls, desc156, DialogModes.NO );

    I adapted a Script somewhat, so you may give this a test.
    But it uses the open file so you would have to adapt it further.
    // arranges the selected jpg, tif, psd in line;
    // gutters may be irregular due to rounding effects;
    // thanks to michael l hale and muppet mark;
    // for mac and CS6;
    // 2014, use it at your own risk;
    #target photoshop
    if (app.documents.length == 0) {
              var myDocument = app.documents.add(UnitValue (300, "mm"), UnitValue (50, "mm"), 300, "new", NewDocumentMode.RGB, DocumentFill.TRANSPARENT)
    else {myDocument = app.activeDocument};
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var theArray = [0, 0, myDocument.width, myDocument.height];
    // select files;
    if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}
    else {var theFiles = File.openDialog ("please select exactly three files", getFiles, true)};
    // do the arrangement
    if (theFiles) {placeInLines (myDocument, theFiles, theArray)}
    app.preferences.rulerUnits = originalRulerUnits;
    ////// function to place images in lines //////
    function placeInLines (myDocument, theFiles, theArray) {
    theFiles.sort();
    // fit on screen;
    var idslct = charIDToTypeID( "slct" );
    var desc64 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref44 = new ActionReference();
    var idMn = charIDToTypeID( "Mn  " );
    var idMnIt = charIDToTypeID( "MnIt" );
    var idFtOn = charIDToTypeID( "FtOn" );
    ref44.putEnumerated( idMn, idMnIt, idFtOn );
    desc64.putReference( idnull, ref44 );
    executeAction( idslct, desc64, DialogModes.NO );
    // change pref;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    setToAccelerated();
    app.togglePalettes();
    var check = turnOffRescale ();
    // create the arrangement;
    if (theFiles.length > 0 && theFiles.length == 3) {
    myDocument.activeLayer = myDocument.layers[0];
    // create masked group;
    var theGroup = myDocument.layerSets.add();
    theGroup.name = "arrangement";
    // determine the array’s values;
    var areaWidth = theArray[2] - theArray[0];
    var areaHeight = theArray[3] - theArray[1];
    var theDocResolution = myDocument.resolution;
    var areaRelation = areaHeight / areaWidth;
    // center of placed non-pdf images;
    var centerX = Number(myDocument.width / 2);
    var centerY = Number(myDocument.height / 2);
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    var pdfSinglePages = new Array;
    var nonPDFs = new Array;
    var theDimPDFs = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    var theDimensions = new Array;
    var theLengths = new Array;
    // array to collect both files and placed pdf-pages;
    var theseFiles = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    for (var o = 0; o < theFiles.length; o++) {
        var thisFile = theFiles[o];
              theseFiles.push(thisFile);
              var theDim = getDimensions(thisFile);
              theDimensions.push(theDim);
              theRelativeWidth = 100 / theDim[1] * theDim[0];
              theLength = theLength + theRelativeWidth;
    // reset dialogmodes;
    app.displayDialogs = DialogModes.ERROR;
    // if three files;
    if (theseFiles.length == 3) {
    // create the layers;
    var theNumber = 0;
    var theAdded = 0;
    var y = areaHeight / 2;
    // add placed image’s width;
    var thisLineWidth = 0 + theAdded;
    var theLastFactor = Number (Number(myDocument.height) / theDimensions[2][1] * theDimensions[2][2] / theDocResolution * 100);
    var theLastWidth = Math.round(theDimensions[2][0] * theLastFactor / 100 * theDocResolution / theDimensions[2][2]);
    // place the files;
    for (var x = 0; x < 3; x++) {
    var theNumber = x;
    var thisFile = theseFiles[theNumber];
    var theFactor = Number (Number(myDocument.height) / theDimensions[theNumber][1] * theDimensions[theNumber][2] / theDocResolution * 100);
    var theNewWidth = Math.round(theDimensions[theNumber][0] * theFactor / 100 * theDocResolution / theDimensions[theNumber][2]);
    var offsetX = theNewWidth / 2 + thisLineWidth - centerX + theArray[0];
    var offsetY = y - centerY + theArray[1];
    var theLayer = placeScaleFile (thisFile, offsetX, offsetY, theFactor, theFactor);
    myDocument.activeLayer.move(theGroup, ElementPlacement.PLACEATBEGINNING);
    thisLineWidth = thisLineWidth + theNewWidth;
    // duplicate the middle one;
    if (theNumber == 1) {
              while (thisLineWidth < myDocument.width - theLastWidth) {
                        theLayer = duplicateAndOffset (theLayer, theNewWidth, 0);
                        thisLineWidth = thisLineWidth + theNewWidth;
    // reset;
    app.togglePalettes();
    turnOnRescale (check);
    app.preferences.rulerUnits = originalRulerUnits;
    ////// playback to accelerated //////
    function setToAccelerated () {
              var idsetd = charIDToTypeID( "setd" );
              var desc1 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                        var ref1 = new ActionReference();
                        var idPrpr = charIDToTypeID( "Prpr" );
                        var idPbkO = charIDToTypeID( "PbkO" );
                        ref1.putProperty( idPrpr, idPbkO );
                        var idcapp = charIDToTypeID( "capp" );
                        var idOrdn = charIDToTypeID( "Ordn" );
                        var idTrgt = charIDToTypeID( "Trgt" );
                        ref1.putEnumerated( idcapp, idOrdn, idTrgt );
              desc1.putReference( idnull, ref1 );
              var idT = charIDToTypeID( "T   " );
                        var desc2 = new ActionDescriptor();
                        var idperformance = stringIDToTypeID( "performance" );
                        var idperformance = stringIDToTypeID( "performance" );
                        var idaccelerated = stringIDToTypeID( "accelerated" );
                        desc2.putEnumerated( idperformance, idperformance, idaccelerated );
              var idPbkO = charIDToTypeID( "PbkO" );
              desc1.putObject( idT, idPbkO, desc2 );
              executeAction( idsetd, desc1, DialogModes.NO );
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true
    ////// place //////
    function placeScaleFile (file, xOffset, yOffset, theScale) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theScale );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
    executeAction( idPlc, desc5, DialogModes.NO );
    return myDocument.activeLayer;
    ////// open pdf //////
    function openPDF (theImage, x) {
    // define pdfopenoptions;
    var pdfOpenOpts = new PDFOpenOptions;
    pdfOpenOpts.antiAlias = true;
    pdfOpenOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
    pdfOpenOpts.cropPage = CropToType.TRIMBOX;
    pdfOpenOpts.mode = OpenDocumentMode.CMYK;
    pdfOpenOpts.resolution = 10;
    pdfOpenOpts.suppressWarnings = true;
    pdfOpenOpts.usePageNumber  = true;
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    pdfOpenOpts.page = x;
    var thePdf = app.open(theImage, pdfOpenOpts);
    thePdf.close(SaveOptions.DONOTSAVECHANGES);
    // reset dialogmodes;
    app.displayDialogs = theDialogSettings;
    ////// turn off preference to scale placed image //////
    function turnOffRescale () {
    // determine if the resize prefernce is on;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var appDesc = executeActionGet(ref);
    var prefDesc = appDesc.getObjectValue(charIDToTypeID( "GnrP" ));
    var theResizePref = prefDesc.getBoolean(stringIDToTypeID( "resizePastePlace" ));
    // turn off resize image during place;
    if (theResizePref == true);{
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc12 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref4 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref4.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref4.putEnumerated( idcapp, idOrdn, idTrgt );
        desc12.putReference( idnull, ref4 );
        var idT = charIDToTypeID( "T   " );
            var desc13 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc13.putBoolean( idresizePastePlace, false );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc12.putObject( idT, idGnrP, desc13 );
    executeAction( idsetd, desc12, DialogModes.NO );
    return theResizePref
    ////// turn on preference to scale plced image //////
    function turnOnRescale (check) {
    if (check == true) {
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc14 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref5.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idcapp, idOrdn, idTrgt );
        desc14.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc15 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc15.putBoolean( idresizePastePlace, true );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc14.putObject( idT, idGnrP, desc15 );
    executeAction( idsetd, desc14, DialogModes.NO );
    ////// convert to so if not one aready //////
    function duplicateAndOffset (theLayer, theXOffset, theYOffset) {
    app.activeDocument.activeLayer = theLayer;
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
        var desc9 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idLyr, idOrdn, idTrgt );
        desc9.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc10 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idHrzn, idRlt, theXOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idVrtc, idRlt, theYOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc9.putObject( idT, idOfst, desc10 );
    executeAction( idcopy, desc9, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// load pdf as smart object //////
    function transformLayer (layer, percentage, xOffset, yOffset) {
    app.activeDocument.activeLayer = layer;
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc4 = new ActionDescriptor();
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc4.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc5 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc4.putObject( idOfst, idOfst, desc5 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idWdth, idPrc, percentage );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idHght, idPrc, percentage );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc4.putBoolean( idLnkd, true );
        var idAntA = charIDToTypeID( "AntA" );
        desc4.putBoolean( idAntA, true );
    executeAction( idTrnf, desc4, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// function to get file’s dimensions, thanks to michael l hale //////
    function getDimensions( file ){
    function divideString (theString) {
              theString = String(theString);
        var a = Number(theString.slice(0, theString.indexOf("\/")));
        var b = Number(theString.slice(theString.indexOf("\/") + 1));
        return (a / b)
    // from a script by michael l hale;
    function loadXMPLibrary(){
         if ( !ExternalObject.AdobeXMPScript ){
              try{
                   ExternalObject.AdobeXMPScript = new ExternalObject
                                                                ('lib:AdobeXMPScript');
              }catch (e){
                   alert( ErrStrs.XMPLIB );
                   return false;
         return true;
    function unloadXMPLibrary(){
       if( ExternalObject.AdobeXMPScript ) {
          try{
             ExternalObject.AdobeXMPScript.unload();
             ExternalObject.AdobeXMPScript = undefined;
          }catch (e){
             alert( ErrStrs.XMPLIB );
    ////// based on a script by muppet mark //////
    function dimensionsShellScript (file) {
              try {
    // getMetaDataMDLS;
    if (File(file) instanceof File && File(file).exists) {
              var shellString = "/usr/bin/mdls ";
              shellString += File(file).fsName;
    //          shellString += File(file).fullName;
              shellString += ' > ~/Documents/StdOut2.txt';
              app.system(shellString);
    // read the file;
    if (File('~/Documents/StdOut2.txt').exists == true) {
        var file = File('~/Documents/StdOut2.txt');
        file.open("r");
        file.encoding= 'BINARY';
        var theText = new String;
        for (var m = 0; m < file.length; m ++) {
                        theText = theText.concat(file.readch());
              file.close();
              theText = theText.split("\n");
    // get the dimensions;
              var dim = new Array;
              for (var m = 0; m < theText.length; m++) {
                        var theLine = theText[m];
                        if (theLine.indexOf("kMDItemPixelWidth") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemPixelHeight") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionWidthDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionHeightDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
    // remove file and hand back;
              File('~/Documents/StdOut2.txt').remove();
    catch (e) {
              if (File('~/Documents/StdOut2.txt').exists == true) {File('~/Documents/StdOut2.txt').remove()};
              return dim
              try{
                        loadXMPLibrary();
                        var xmpf = new XMPFile( file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );
                        var xmp = xmpf.getXMP();
                        xmpf.closeFile();
                        var resolutionUnit = xmp.getProperty( XMPConst.NS_TIFF, 'ResolutionUnit', XMPConst.STRING);
                        var resFactor = 1;
                        if (resolutionUnit == 2) {
                                  var resFactor = 1;
                        if (resolutionUnit == 3) {
                                  var resFactor = 2.54;
                        var dim = [xmp.getProperty( XMPConst.NS_EXIF, 'PixelXDimension', XMPConst.STRING),
                        xmp.getProperty( XMPConst.NS_EXIF, 'PixelYDimension', XMPConst.STRING),
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'XResolution', XMPConst.STRING)) * resFactor,
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'YResolution', XMPConst.STRING)) * resFactor];
                        unloadXMPLibrary();
                        if(dim[0]=="undefined" || dim[1]=="undefined"){
                var dim = undefined;
                var res = undefined;
                var bt = new BridgeTalk;
                bt.target = "bridge";
                var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+file.toSource()+");");
                bt.body = myScript;
                bt.onResult = function( inBT ) {myReturnValue(inBT.body); }
                bt.send(10);
                        function myReturnValue(str){
                                  res = str;
                                  dim = str.split(',');
                        function psRemote(file){
                                  var t= new Thumbnail(file);
                                  return t.core.quickMetadata.width+','+t.core.quickMetadata.height;
        }catch(e){unloadXMPLibrary()};
              if (String(dim[2]).indexOf("\/") != -1) {
                        var a = divideString(dim[2]);
                        var b = divideString(dim[3]);
                        dim = [dim[0], dim[1], a, b]
    // if dimensions are missing as might be the case with some bitmap tiffs for example try a shell-script;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var array = dimensionsShellScript(file);
                        dim = array;
    // if shell-string failed open doc to get measurements;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var thisDoc = app.open (File(file));
    // close ai without saving;
                        if (file.name.slice(-3).match(/\.(ai)$/i)) {
                                  thisDoc.trim(TrimType.TRANSPARENT);
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.DONOTSAVECHANGES)
                        else {
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.PROMPTTOSAVECHANGES)
    return dim;

  • Dynamically Create Image: RDataMatrix

    Hello All,
    Anyone know of any samples or tutorials showing how to dynamically create images on a web page using RDataMatrix? The library can be found at java4less.com. Any input would be greatly appreciated.
    Thanks,
    Tim

    Hi,
    I am not aware of this. However, we have examples posted in blogs and referenced here that use a servlet URL reference from the image objec in JSF to access streamed image contents
    Frank

  • How to create a dynamic link in a Form to link to a specific FOLDER

    Hello,
    I have created a reports of all employees of my department.
    This reports shows me the empno and ename
    When I clicked on a empno ( for example empno = 1 ) then then I got a MASTER DETAIL FORM about that employee(empno = 1) .
    Who he or she is and which course he or she had followed.
    I want create a dynamic link in the MASTER DETAIL FORM which shows me directly the folder of that employee ( in this example folder 1 ).
    If I clickt on the report with all employees of my department on an other number ( for example empno = 3333333) then if I click on the dynamic link in the MASTER DETAIL FORM I want to see the folder of employee 3333333 !!! You know what I mean ?
    What I want to know is, how to create a dynamic link that shows me directly a folder which is dependent on which empno I had clicked on in the report ( report with employee numbers and ename )
    Is there any way to pass some parameters into a link to a Folder ? Is this possible in Portal ? Does anyone know how to do this, or do you have a suggestion how to solve this problem ?
    Thanks a lot !!!
    Chu Lam

    Hi Chetan,
    I am glad that someone had replied on my question.
    I will explain it to you again.
    I have created a report that shows me all employees. If I click on a employee number then I get an MASTER DETAIL FORM on my screen with all the information(where he works now and which number I have to dial ifhow can I reach him by telephone) of that employee on which number I clicked on.
    I really like this mechanism. (You click on a number and the information that you see in the next screen is dependent of the number you clicked on ! )I have created all this. It works fine.
    What I want is to expand this example.
    Every employee has a FOLDER (yes, those ones in Content Area ) which they can insert text or image into that folder. The folder name is just the employee number. ( employee with employee number 3303, he owns a folder which is named 3303 and an employee with empno 9999, he or she owns a folder with the name 9999. )
    Every employee can tell more about himself in that FOLDER by iserting text and images. For example : What he likes, pictures of his vacation, something like this.
    What I want is this :
    If I click on the first report,which provides me all employees on screen, on a employee number 3303 then I get a Master Detail Form on my screen with all information about that employee with employee number 3303. And I want in this MASTER DETAIL FORM to create a link that shows me directly the FOLDER of that employee ( 3303), so I can learn more about employee with employee number 3303. But I don't know how to create this link.
    That link had to be dependent on the employee number. The difficult thing about this link is that this link had to be dynamic.
    I hope this will make it clear to you :
    (report all employees:)
    empno ename
    3301 john smith
    3302 peter clark
    3303 wilson jones
    If I click on a empno ( for example 3303) then I get a MASTER DETAIL FORM which provides me information.
    (MASTER DETAIL FORM )
    EMPNO 3303
    ENAME wilson jones
    department New York
    mobile number 98908763
    Company tel. no day
    AOL 097485838 monday till wednesday
    Oracle 04848584333 thursday and friday
    LINK
    (what I want is to create a link here )
    If I click on LINK in this MASTER DETAIL FORM then I want to link to the FOLDER of this employee ! ( In this example it is FOLDER 3303.
    BUT IF I CLICKED ON THE FIRST REPORT ON A DIFFERENT NUMBER ( FOR EXAMPLE 3301) THEN IF I CLICK ON LINK IN THE MASTER DETAIL FORM THEN I HAVE TO LINKED TO FOLDER 3301.
    I just want to know how to make a link like this ( create a dynamic link to a specific folder ).
    Thanks in Advance.
    Chu

  • Error while creating a dynamic internal table refers to custom field

    Hi all,
    I am getting the exception TYPE_NOT_FOUND when I try to create a dynamic internal table using:-
    DATA: gr_desc TYPE REF TO cl_abap_typedescr.
    gr_desc = cl_abap_typedescr=>describe_by_name( p_field ).
    The field p_field is a Z-field inside a DB table, (e.g. a user added field in MARA). The statement fails at that point and gives a runtime exception. Any suggestions to how I may solve this problem? Or any alternatives for the same? I guess we face this issue for all custom fields..has SAP released a note for this??
    Thanks..

    that's just the wrong method, you should use DESCRIBE_BY_DATA
    gr_desc = cl_abap_typedescr=>describe_by_data( p_field ).
    Note: DESCRIBE_BY_NAME is to be used for referencing a DDIC type by its name. Example:
    gr_desc = cl_abap_typedescr=>describe_by_name( 'MARA-ZZFIELD' ).

  • Error while creating VO dynamically and assigning it to Table Region

    Hi,
    I am getting the below exception while running my OAF page
    oracle.apps.fnd.framework.OAException: Programming error. Row (oracle.jbo.server.ViewRowImpl@1e) must be of type oracle.apps.fnd.framework.OARow.
    I've created a dynamic VO using createViewObjectFromQueryStmt(), and used setViewUsage() on messageStyledTextBean of my table.
    Couldn't find anything related to the error on forum.
    Any sort of help is appreciated.

    Check in Corresponding VORowImpl ---
    change the Import Statement -- from -
    import oracle.jbo.server.ViewRowImpl; // 11i
    to
    import oracle.apps.fnd.framework.server.OAViewRowImpl; // R12
    Hope This will help Out..

  • Error when trying to create a Dynamic UI Element(DropDownByKey)

    Dear All,
    I am trying to create a Dynamic UI element(dropdownbykey) .
    I used the following code which i wrote in domodify:
    if (firstTime)
    IWDTransparentContainer thetransparent =(IWDTransparentContainer)view.getElement("AttributeDynamic_TransparentContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild(
      "DynamicNode",null,true,true,false,true,false,true,null,null,null);
                              IWDAttributeInfo attr1=node.addAttribute("attrib00","ddic:com.sap.dictionary.string");
    IWDAbstractDropDownByKey Sizedropdown=(IWDAbstractDropDownByKey)view.createElement(IWDAbstractDropDownByKey.class,null);
    Sizedropdown.bindSelectedKey(attr1);
    thetransparent.addChild(Sizedropdown);
    When i deployed it i got the following error:
    com.sap.tc.webdynpro.services.exceptions.CreationFailedException: Cannot create view element implementation com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByKey
    Can anyone please help me in this regard.
    Thanks and Regards
    Nishita Salver

    Dear All,
    Thanks for ur quick reply below is the entire error chain:
    com.sap.tc.webdynpro.services.exceptions.CreationFailedException: Cannot create view element implementation com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByIndex
         at com.sap.tc.webdynpro.progmodel.view.ViewElementFactory.createElement(ViewElementFactory.java:161)
         at com.sap.tc.webdynpro.progmodel.view.View.createElement(View.java:177)
         at com.sap.satyam.dynamic_attrapp.Dynamic_attrAppView.wdDoModifyView(Dynamic_attrAppView.java:184)
         at com.sap.satyam.dynamic_attrapp.wdp.InternalDynamic_attrAppView.wdDoModifyView(InternalDynamic_attrAppView.java:364)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
         at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: java.lang.NoSuchMethodException
         at java.lang.Class.getConstructorImpl(Native Method)
         at java.lang.Class.getConstructor(Class.java:554)
         at com.sap.tc.webdynpro.progmodel.view.ViewElementFactory.createElement(ViewElementFactory.java:150)
         at com.sap.tc.webdynpro.progmodel.view.View.createElement(View.java:177)
         at com.sap.satyam.dynamic_attrapp.Dynamic_attrAppView.wdDoModifyView(Dynamic_attrAppView.java:184)
    Thanks and Regards,
    Nishita

  • How to create a Dynamic UI that can work as a Graphic builder

    Hi Guys
    I have a requirement here
    There should be a Graphic Builder ...........like the way we see our Flex Builder
    But this should be a web application with the following functionality
    Lot of widgets on your left panel like say meter , cricle, chart, line graph etc. All this would be a different flex widgets(say compiled swf file loaded separately in the main application
    On the right Panel there would be dash board where they can drag and drop this above widgets and create a separate page like dragging a chart. user would be given option to configure the points for chart ....................and the data for the live chart would be feed from the backend
    Now I am little confused to how to go about ?
    Creation of separate widgets is ok ?
    Creation of applcation with this widgets is ok
    Giving an option to drag and drop , configure is ok ?
    But the main thing is that If we have to save the pages created by different user ? What is the best way to do that ? Do we use xml to save the customized widget pages including the UI layout information like widget Graph at coordinate x= 120 and y=56 etc etc then parse these xml to get the Layout back and putting the widget back to their location as the way the user created those pages
    Any suggestion ..................
    Regards
    Biswamit

    assign your library images each a class.  you can then use the "new" constructor to create instances dynamically.

  • How to change the images dynamically in a table.

    Hai,
                     How to change the images dynamically in a table based on the condition in webdynpro abap.
    Edited by: Ravi.Seela on Oct 13, 2011 2:17 PM

    This has been much discussed earlier. Do search posts.
    For your scenario i would do the following.
    inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
    create a  supply function for the node image .
    Supply method now has a Element (Parent element ) and node.
    Based on your record in element, set the right image source to path attribute and bind the node.
    This will make sure that the framework calls the image supply function for every row in a table.

  • ABAP OO, Creating object dynamically

    Hi everybody,
         I’m currently working on some Abap OO examples. Everything is working ok except for the following: Creating objects dynamically.
    This is what I’d like to do:
    Lets say we obtain a bunch of sales orders using a simple select statement and place them in an internal table. For each entry in our internal table, I’d like to generate a new sales order object. This salesorder object is a simple class with a constructor with an Id and some other attributes.
    When this is done, I’d like to append every object to a new object, say basket, so that this basket contains something like an internal table within each record a reference to the salesorder. Is this easy to do? I’m using the example that is described in the sap guide (create object pointer type (class_name) but it looks to me that you still have to declare the reference variables before you can create the object.
    Hmm, I think Java is better suited for a job like this.
    Hope you can help,
    Cheers and Best wishes
    Laurens Steffers
    The Netherlands.

    Hi,
    Its not all that difficult in ABAP as well. The following code is based on Chapter 5, Listing 5.20 from book ABAP Objects.
    What you need is an internal table of type <your sales object> e.g.
    DATA: BEGIN OF obj_sales_order
            sales_order_no LIKE <sales_order_no_type>,
            <...>,
            objref TYPE REF TO <SALES_ORDER_CLASS>
          END OF obj_sales_order,
          reftab LIKE SORTED TABLES OF obj_sales_order
                      WITH UNIQUE KEY sales_order_no
                                      <other key attributes>.
    Now all you need to do is to do a SELECT...ENDSELECT loop, and:
    SELECT ...
    obj_sales_order-sales_order_no = <selection result>
    obj_sales_order-<other key attr> = <selection result>
    READ TABLE reftab INTO obj_sales_order
                      FROM obj_sales_order.
    IF sy-subrc <> 0.
      CREATE OBJECT obj_sales_order-objref
             EXPORTING ...
             EXCEPTIONS ...
      IF sy-subrc <> 0.
        MESSAGE ...
        CONTINUE.
      ELSE.
        INSERT obj_sales_order INTO TABLE reftab.
      ENDIF.
    ENDIF.
    CALL METHOD obj_sales_order-objref-><method>.
    ENDSELECT.
    Hope this help.
    Regards

  • Adobe form - Printing images dynamically

    I have created a simple read-only (not interactive) Adobe form. At the end of the document, I need to print a signature depending upon the approver (which I can access from the data structure imported into the form.).
    If I create an image field, how do I assign the image dynamically depending on the approver?
    I have thought of an alternative solution of creating 3 separate forms each with a static image of the signature and calling a separate form in the program depending on the approver. But I was wondering if I can assign images dynamically so that I can have only one form.
    Any help will be greatly appreciated.
    Jitendra Mehta

    Hello . The solution is easy, I have posted the solution into IFbA forum under NeWeaver many times. And I can recommend you to read this article where there is a complete solution for your problem:
    http://www.docstoc.com/docs/2540673/How-To-Integrate-ADOBE-form-on-WebdynPro-for-ABAP-and-Deploy-it-
    It was originally SAP SDN blog, but I am not able to locate it on sap site any more. Hope this solves your problem, regards Otto

  • Creating a Dynamic Node for a Dynamic Graphic - Tutorial

    Hi everyone,
    I'm sharing my first tutorial, hope it'll be helpful for you.
    In the Layout tab, it's possible to create an UI element "Business Graphic". It's a very simple tool that only requires a context node with a category attribute (that means, the values that will appear in the 'x' axis) and one or more series (each one with a color, generally a numerical value). It's possible to add a label for each series for better understanding of the Graphic.
    Although it's a very powerful tool, there are some problems when we must create a graphic with N series and different labels. If the graphic use an ALV or internal table to fetch data, during runtime we can have more or less series. The definition of a static node and generic series is not enough in this case. That's why I'd like to present you this little tutorial to create a dynamic node that fetchs a dynamic graph:
    In the WDDOINIT or Event Handler method that starts the application (once the data is available) we should create the dynamic node in the following way:
      DATA: lr_node_info    TYPE REF TO if_wd_context_node_info,             
                 lt_attributes      TYPE cl_abap_structdescr=>component_table,
                 attribute           LIKE LINE OF lt_attributes,
                 struct_type       TYPE REF TO cl_abap_structdescr,
                 lo_dyn_node    TYPE REF TO if_wd_context_node.
    * Let's suppouse we can LOOP at the data table, so we can fetch the
    * category data type (for example company name, month, year, ...)
    * and each series with a numeric type
      attribute-name = 'CATEGORY'.
      attribute-type ?= cl_abap_datadescr=>describe_by_name( 'STRING' ).
      INSERT attribute INTO TABLE lt_attributes.
      attribute-name = 'SERIE1'.
      attribute-type ?= cl_abap_datadescr=>describe_by_name( 'I' ).
      INSERT attribute INTO TABLE lt_attributes.
      attribute-name = 'SERIE2'.
      attribute-type ?= cl_abap_datadescr=>describe_by_name( 'I' ).
      INSERT attribute INTO TABLE lt_attributes.
    * Once we have all the attributs for the node, we create a formal structure
      struct_type = cl_abap_structdescr=>create( lt_attributes ).
    * Now we can get the context information to add a new node
      lr_node_info = wd_context->get_node_info( ).
    * Create the node
      lr_node_info = lr_node_info->add_new_child_node(
                        name = 'GRPH_DYN'
                        IS_MANDATORY = ABAP_false
                        IS_MULTIPLE = ABAP_true
                        STATIC_ELEMENT_RTTI = struct_type
                        IS_STATIC = ABAP_false ).
    * Now we should populates the node, I'll create a hardcoded table,
    * simulating the internal table that you should already have
      TYPES: BEGIN OF tw_alv,
                        category  TYPE string,
                       SERIE1    TYPE i,
                       SERIE2    TYPE i,
                    END OF tw_alv.
      TYPES: tt_alv TYPE STANDARD TABLE OF tw_alv.
      DATA: lw_alv  TYPE tw_alv,
                  lt_alv   TYPE tt_alv.
      lw_alv-category = 'Alfa'.
      lw_alv-serie1   = 3.
      lw_alv-serie2   = 8.
      APPEND lw_alv TO lt_alv.
      lw_alv-category = 'Beta'.
      lw_alv-serie1   = 4.
      lw_alv-serie2   = 4.
      APPEND lw_alv TO lt_alv.
      lw_alv-category = 'Gamma'.
      lw_alv-serie1   = 1.
      lw_alv-serie2   = 3.
      APPEND lw_alv TO lt_alv.
    * Now let's call the recently created node and bind the lt_alv table.
    * Get node from context
      lo_dyn_node = wd_context->get_child_node( name = 'GRPH_DYN' ).
    * Bind table with ALV Container
      CALL METHOD lo_dyn_node->bind_table
        EXPORTING
          new_items = lt_alv.
    * It's always good to check if the table was succesfully binded.
    * I refresh the lt_alv table and get the values from the node for controlling
      REFRESH lt_alv.
      lo_dyn_node->get_static_attributes_table( IMPORTING table = lt_alv ).
    There are other ways of adding a node structure in the method add_new_child_node, but it works for me only with STATIC_ELEMENT_RTTI. The node is now created and has the data required for the graphic. Now, we should go to WDDOONMODIFYVIEW, or save the target view as a parameter, to create the graphic, bind the category and series and show it on the screen.
      DATA: lr_graph       TYPE REF TO cl_wd_business_graphics,
                  lr_cat           TYPE REF TO cl_wd_category,
                  lr_series1    TYPE REF TO cl_wd_simple_series,
                  lr_series2    TYPE REF TO cl_wd_simple_series,
                  lr_container TYPE REF TO cl_wd_uielement_container,
                  lr_flow         TYPE REF TO cl_wd_flow_data.
    * Get the root element from the Layout or the specific
    * container you have created for the graphic
      lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    * Creates a line busniess graph
      lr_graph = cl_wd_business_graphics=>new_business_graphics(
            BIND_SERIES_SOURCE = 'GRPH_DYN'
            CHART_TYPE = cl_wd_business_graphics=>e_chart_type-lines
            HEIGHT = 340
            WIDTH = 750
            ID = 'GRAPH'  ).
    * Create the flow data for the new UI Element business graphic
      lr_flow = cl_wd_flow_data=>new_flow_data( element = lr_graph ).
    * Set graph in the root container from the Layout tab
      lr_container->add_child( lr_graph ).
    * Bind the category from the dynamic node to the dynamic graphic
      lr_cat = cl_wd_category=>new_category(
                      view = view
                      bind_description = 'GRPH_DYN.CATEGORY'
                      tooltip = 'Company Name' ).
      lr_graph->set_category( lr_cat ).
    * Bind the two series from the dynamic node to the dynamic graphic
      lr_series1 = cl_wd_simple_series=>new_simple_series(
                      bind_value = 'GRPH_DYN.SERIE1'
                      label = 'Sales'
                      view = view
                      tooltip = 'Average Sales' ).
      lr_graph->add_series( lr_series1 ).
      lr_series2 = cl_wd_simple_series=>new_simple_series(
                      bind_value = 'GRPH_DYN.SERIE2'
                      label = 'Purchases'
                      view = view
                      tooltip = 'Average Purchases' ).
      lr_graph->add_series( lr_series2 ).
    Finally we have created our business graphic. Test the application and you'll see something like the attached image.
    Hope you'll find it useful.
    Daniel Monteros.

    Hi,
    http://htmldb.oracle.com/pls/otn/f?p=26372
    then ApEx>Trees and pick a level.
    Use Help for more information.
    I you think that tree could help I will put more explanation into help page.
    Konstantin

  • How to create a dynamic class

    Hiya,
    I want to create classes dynamically. I know that this can be done by extending ClassLoader and defineClass method. My problem is i dont know what goes in byte[] coz my program needs to get the class name, attributes and methods from the user.
    For example something like visual modeler that loads up the UI than lets the user to create the classes, attributes and methods.
    The generic class called gentity is as follows:
    public class Gentity {
    private String gname;
    public Gentity(String mgname) {
    gname=mgname;
    public void setGname(String mgname)
    gname=mgname;
    public String getGname()
    {return(gname);
    This class will then be used in my main class which is as follows:
    public class GentityClassLoader extends ClassLoader
    Gentity customer=new Gentity("HSBC");
    public static void main(String argv[])
    byte b[]=new byte[1];
    GentityClassLoader obj = new GentityClassLoader();
    try{
    // this is my problem here, i dont know what goes in bytes
    Class cls = obj.defineClass(obj.customer.getGname(),b,0,b.length);
    Class x=obj.loadClass(obj.obj.getGname());
    obj.resolveClass(x);
    System.out.println(x.toString()+"asdf");
    }catch(Exception e)
    System.out.println("Error");
    Cheers,
    Deepak

    You start by reading the JVM spec.
    http://java.sun.com/docs/books/vmspec/html/VMSpecTOC.doc.html

Maybe you are looking for

  • Baseline date in Accounting document changed after creation of Invoice List

    Hi all, 1) User Requirement:- Creation of Invoice document(using VF01), Transfer u201CGoods Issue Dateu201D to FI accounting as a Baseline date instead of Invoice creation date. To meet the above requirement I did enhancement name: SDVFX008 user exit

  • Viewing images this way...

    Hi. I want to put thumbnail images on my site and when you click on them, they don't open in a new window, but there is that sun-like indicator that shows it is loading, and it opens a pop up of the entire image while making the actual website dimmer

  • Red Light, followed by successful deltas in Process chain

    Hello, I have a DELTA dataload the runs in the AM and then again in the PM.  This occurs every day. 2 days ago the load Red lighted.  It loads to an ODS.  I didn't notice this redlight and the chain kept running.  So the subsequent loads were success

  • AIA XREF Functions in Jdeveloper

    Hi, I am using XREFs and DVMs in my flows using AIA 3.0. I am not able to see the functions like generate-guid(), functions related to XREF and DVM in the XSLT designer. I remember having installed a AIAXpathFunctions patch for JDeveloper in SOA 10g.

  • Upgrading Mac OS X v10.3.9 to v10.7?

    I recently "inherited" an original Mac Mini that is currently running on OS X version 10.3.9. I was wondering what do I need to get in order to update it to the latest Mac operating system? (OS X Lion 10.7?) I really don't know much about Macs, but I