Standard Report & Image Column

Hi everybody,
I have a standard report for employees in this report there is an image column displaying the employee photo.
Of course if there is no image in the database for the employee the report won't display anything.
What I want is that if the image column is NULL the report will display a standard NO_PHOTO.JPG image for this employee.. is this possible??
My select statment is simple:
select
       "EMP_ID",
       "EMP_FIRST_NAME",
       "EMP_SECOND_NAME",
       "EMP_FAMILY_NAME",
       dbms_lob.getlength("EMP_PHOTO") "EMP_PHOTO"
from   "T_EMPLOYEE"

One method is to use a Dynamic Action to insert the default image when there isn't one in the report. This avoids having to modify the report query or attributes.
h4. When
Event: After Refresh
Selection Type: Region
Region: <your report region>
h4. True Action
Action: Execute JavaScript Code
Fire On Page Load: Yes
Code:
$('#emp-report td[headers="PHOTO"]')
  .contents()
  .filter(function() {
    return this.nodeType === 3; // report cell contents is a text node, not an img element
  .replaceWith('<img src="&WORKSPACE_IMAGES.NO_PHOTO.jpg" alt="No photo">');Another is to put the logic in the query and get the image source programatically:
select
       "EMP_ID",
       "EMP_FIRST_NAME",
       "EMP_SECOND_NAME",
       "EMP_FAMILY_NAME",
          '<img src="' || nvl2(photo, apex_util.get_blob_file_src('P2_PHOTO_FILE', employee_id), '&WORKSPACE_IMAGES.NO_PHOTO.jpg')
       || '" alt="' || nvl2(photo,  "EMP_FIRST_NAME" || ' ' || "EMP_FAMILY_NAME", 'no photo') || '">' "EMP_PHOTO"
from   "T_EMPLOYEE"Where <tt>P2_PHOTO_FILE</tt> is the file browser item used to upload the photos.
The Display As column attribute for the EMP_PHOTO column must be changed to Standard Report Column when using this method.

Similar Messages

  • How do I retain the default 3 column sort order in a standard report

    I have a standard (not interactive) report of about 12 columns in which I set column 1 as the primary sort, column 2 as the second sort within that and column 3 as another sort within 1&2. I have also made other columns sortable by the user. However, once a sort is done by the user on one of the other columns, the default sort order never seems to come back, even if the application is closed. Is there something I need to set?

    Standard report sort columns are stored persistently as user preferences. The <tt>apex_util.remove_sort_preferences</tt> method can be used to remove them, resetting reports to the default sort order. However this is not a precision instrument: it removes the user's sort preferences for all reports...
    It is possible to remove the sort preference for individual reports using the <tt>apex_util.remove_preference</tt> method by reverse engineering the required sort preference name from the admin user preference report, but I wouldn't recommend it. I recently worked on an application where this had been done for one report, but we removed this "feature" as: (1) no one could remember why it had been done in the first place; (2) it was completely inconsistent with the behaviour of the other app reports; (3) the implementation was Byzantine (get non-obvious pref value and have page re-request itself with additional parameters) and lead to (4) poor page performance.
    Unless users are jumping up and down demanding this I'd stick to the status quo...
    (Please update your forum profile with a better handle than "user719232".)

  • Need help to show a thumbnail image column in report

    Hi, Gurus:
    I need to display a column of thumbnail images in a classical report. I follow the thread https://kr.forums.oracle.com/forums/thread.jspa?threadID=2201667
    I am using APEX 4.1, Oracle 11gR2
    Here is my table:
    CREATE TABLE "SORS"."SOR_IMAGE"
       (     "IMAGE_ID" NUMBER(10,0),
         "OFFENDER_ID" NUMBER(10,0) NOT NULL ENABLE,
         "IMAGE" BLOB CONSTRAINT "SOR_IMAGE" NOT NULL ENABLE,
         "THUMBNAIL" BLOB,
         "MIME_TYPE" VARCHAR2(50 BYTE),
          CONSTRAINT "SOR_IMAGE_PK" PRIMARY KEY ("IMAGE_ID")
    )Here is my procedure:
    create or replace
    procedure dl_sor_thumbnail (p_offender_id IN NUMBER) as
       v_mime_type VARCHAR2(48);
       v_length NUMBER;
       v_name VARCHAR2(2000);
       v_image BLOB;
    BEGIN
      SELECT 'IMAGE/JPEG', dbms_lob.getlength(thumbnail), thumbnail
      INTO v_mime_type, v_length, v_image
      FROM sor_image
      WHERE offender_id = p_offender_id
      and image_id = (select max(image_id)from sor_image where offender_id = p_offender_id) ;
    -- setup the HTTP headers
    owa_util.mime_header(nvl(v_mime_type, 'application/octet'), FALSE);
    htp.p('Content-length: '||v_length);
    --htp.p('Content-Disposition: attachment; filename="' || substr(v_name, instr(v_name,'/') + 1) || '"');
    --htp.p('Content-Disposition: attachment; filename="'somemmmmmfilename.jpg'");
    -- close the headers
    owa_util.http_header_close;
    -- download the Photo blob
    wpg_docload.download_file (v_image);
    END dl_sor_thumbnail;here is my report:
    select distinct 'MAP', '<img src="#OWNER#.dl_sor_thumbnail?p_offender_id='||so.offender_ID||'"/>' detail,
    so.doc_number as "DOC Number", so.offender_id as "Offender_ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
    so.checksum as "checksum",
    so.last_name as "Last Name",
    so.first_name||' '|| so.middle_name as "First Name",
    (select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
    (select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
    (select sc8.description from sor_code sc8 where sc8.code_id=so.hair_color) as "Hair Color",
    (select sc9.description from sor_code sc9 where sc9.code_id=so.eye_color) as "Eye Color",
    replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, '-'),'#'),',') as "Address",
    replace(replace(nvl2(sl.physical_address1,sl.physical_address1||' '||sl.physical_city ||' '||sl.physical_county||' '||(select sc4.description from sor_code sc4 where sc4.code_id=sl.physical_state)||' '||sl.physical_zip, '-'),'#'),',')  as "Physical Address",
    sl.status as "Status",
    to_char(sl.ADDRESS1_LATITUDE) as "Address Latitude",to_char(sl.address1_longitude) as "Address Longitude",
    to_char(sl.physical_address_latitude) as "Physical Latitude",to_char(sl.physical_address_Longitude) as "Physical Longitude",
    decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
    decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated"
    from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv
    where rox.offender_id=so.offender_id
    and sllv.offender_id(+)=so.offender_id
    and sl.location_id(+)=sllv.location_id
    and rox.status not in ('Merged')
    and rox.REG_TYPE_ID=:F119_REG_ID
    and upper(rox.status)='ACTIVE'
    and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
    and (((select sc11.description from sor_code sc11 where sc11.code_id=so.race and sc11.code_id=:P5_SL_RACE) is not null ) or (:P5_SL_RACE is null))
    and (((select sc12.description from sor_code sc12 where sc12.code_id=so.sex and sc12.code_id=:P5_SL_SEX) is not null ) or (:P5_SL_SEX is null))
    and (((select sc13.description from sor_code sc13 where sc13.code_id=so.hair_color and sc13.code_id=:P5_SL_HAIR_COLOR) is not null ) or (:P5_SL_HAIR_COLOR is null))
    and (((select sc14.description from sor_code sc14 where sc14.code_id=so.eye_color and sc14.code_id=:P5_SL_EYE_COLOR) is not null ) or (:P5_SL_EYE_COLOR is null))
    and (exists ( (select sm.offender_id from sor_mark sm, sor_code sc15 where sm.offender_id=so.offender_id and  sc15.code_id=sm.code and sc15.code_id=:P5_SL_OTHER_MARKS  and sm.description is not null) ) or (:P5_SL_OTHER_MARKS is null))
    and ((exists (select sm1.description from sor_mark sm1 where sm1.offender_id=so.offender_id and upper(sm1.description) like upper('%'||:P5_TF_OTHER_MARKS_DESCRIPTION||'%'))) or (:P5_TF_OTHER_MARKS_DESCRIPTION is null))
    and ((floor(to_number(sysdate-so.date_of_birth)/365)-:P5_TF_AGE between -5 and 5) or (:P5_TF_AGE is null))
    and ((to_number(:P5_TF_HEIGHT_FEET)*12+to_number(nvl2(:P5_TF_HEIGHT_INCHES, :P5_TF_HEIGHT_INCHES, '0')-(floor(so.height/100)*12+mod(so.height, 100))) between -6 and 6) or (:P5_TF_HEIGHT_FEET is null))
    and ((so.weight-:P5_TF_WEIGHT between -25 and 25) or (:P5_TF_WEIGHT is null))and I set detail column as standard report column.
    however, the report shows no image, just an icon which indicates the image is not available. Would anyone help me on this problem?
    Thanks a lot.
    Sam
    Edited by: lxiscas on Apr 16, 2013 1:59 PM

    lxiscas wrote:
    I need to display a column of thumbnail images in a classical report. I follow the thread https://kr.forums.oracle.com/forums/thread.jspa?threadID=2201667
    Bad choice. Only one person involved in that thread knew what they were doing...and you copied from the wrong one.
    Here is my procedure:Lose it. Custom download procedures are overcomplicated and now almost never required.
    See the recommendation to use declarative BLOB support, as shown in the Thumbnail image problems.

  • Link based on value in column of a Standard Report

    I have a Standard Report the displays only the images (BLOBs) in a column of a table. In that same table I have a ciolumn that hold url's. I want to have the image link to its corasponding url.
    Currently I am displaying the image using a BLOB format mask. IMAGE:LC_SCSC_SPONSOR_CATALOG:SCSC_LOGO:SCSC_UID
    The url is in a column named SCSC_URL.
    I am running Application Express 4.0.1.00.03
    Thanks for any help.

    I know where to create templates but do not know how to make a "named column report template".Unfortunately the documentation is particularly pathetic on this important topic. Unfortunate as Custom Named Column templates are one of the best features in APEX. They can be used to do some cool stuff fairly simply.
    See:
    <li>About Generic Column Templates and Named Column Templates
    <li>Report Column Template Attributes for Named Column Templates
    and the online help from the property labels on the Report Row Template page.
    1. Go to: Shared Components > Templates > Create
    2. In the wizard select: Report > From Scratch
    3. Enter/select:
    Name: Photo/link list
    Theme: [Your current theme]
    Template Class: Custom 1
    Template Type: Named Column (row template)
    4. Click Create.
    5. Click the Photo/link list link in the Templates report.
    6. Enter the following properties:
    Row Template 1
    <li><a href="#SCSC_URL#">#SCSC_LOGO#</a></li>
    Before Rows
    <ul>
    After Rows
    </ul>

  • Center image and table in Standard Report

    Team,
    I am having an image and a table to be printed. I use the Standard Report format. Customer's requirement is to make the table columns to be of different widths, center the table and make the image to be of the same size as the table. I have achieved different column widths by customizing the Report Generation VIs. For the next items - centering the table & choosing the image size, I have considered A4 as paper size and set the left and right margins & set the image size accordingly. Now the problem is the customer prefers not to limit the paper size to A4. So is there a way to set the center-alignment to the image & table (instead of me setting the suitable margins to make it appear centered)? There is an alignment control in Append Image to Report VI, but this is not used by the Standard Report. Is there a workaround for this and the table? Any help is greatly appreciated.
    P.S.: HTML report is not an option, since I need the ability to choose a printer and print to it from our software. HTML reports, by default, prints to the printer configured in the default browser, using the margins configured in the browser.
    Thanks,
    Priyadarsini S

    Hi Kamlesh,
    the variation is set to 'do not explode' in the report 1SLK-001 (S_ALR_87013614)
    You can check this  using the following path in transaction GRR3 (library 1VK) report 1SLK-001:
    Menu: Edit -> Variation, you will see that the variation is set to 'Do not explode'.
    This is why navigation between the different reports or variation is not
    available in this report, (the icons are greyed out).
    Iif you wish to have this functionality, then you can copy the report and change
    the variation as follows:
    -> via GRR1 create a copy of the standard report using report 1SLK-001 as
        a reference, ('Copy from'-field).
    ->  in this new report you can then via Edit->Variation change 'Cost Element
         from 'Do not explode' to 'explode', and CO area from 'Do not explode'
         to 'Variation sing. val'."
    Regards,
    Greta

  • Use same image column twice in a report

    Hello,
    I have a question  which is, can I use a same image column (example column A) twice in a report? first occurrence (column A) will show the image thumbnail and the second occurrence (column A) will show  image download link which opens image in a new window. Is it possible?
    Thanks
    Pravish

    LA-APEX-DEv wrote:
    Yes, it's possible. However, if you intent to have two different images, then I would suggest you use a javascript to link or download the blob.
    What on Earth for? Why is JavaScript necessary to download two different images? Even if this were in any way true, the OP is clear that the displayed thumbnail and download link involve the same image.
    To accomplish this task, you either use decode or create a union query.
    No, all that should be necessary is to reference the image column twice in the report query projection, and apply a download format mask to one column and an image mask to the other. That the OP has apparently failed to do this probably indicates that they are unnecessarily complicating things.
    For example:
    select '<a href="javascript:downloadImg(' || image_id || ');"><img src="/i/download.gif"></a>' link_col
    from table
    where allow_view = 'Y'
    union all
    select '<img src="/i/folder.gif">' link_col
    from table
    where allow_view = 'N'
    or
    select decode(allow_view,'Y',
              '<a href="javascript:downloadImg(' || image_id || ');"><img src="/i/download.gif"></a>',
              '<img src="/i/folder.gif">') link_col
    from table
    What is downloadImg? it is not a standard APEX JavaScript API. It is therefore highly unlikely that this is of any use to the OP.

  • Add Image column in classic sql report to open a pop page

    I have sql report I want to add a new column which will have image to click, Once user clicks the image a popup page should open.

    Hi Vikram,
    Sorry to bother you, I am very new to apex. Here is my sql query for sql report. Can you please help me.
    <xmp>select
    case
    when ISUPPORT_NUMBER is null or ISUPPORT_NUMBER = 'N/A' then '<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Enter SR Number</p></a>'
    else '<span style="background-color:red;font-weight:bold">'
    || ISUPPORT_NUMBER
    || '</span>'
    end ISUPPORT_NUMBER,
    case
    when ISUPPORT_NUMBER is not null and ISUPPORT_NUMBER != 'N/A' then '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#FF0000;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
    else '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
    end MACHINE_NAME,
    FUNCTION,
    VERSION,
    VENDOR_CLUSTER,
    case when used_by is null then '<a href="javascript:myFunc2(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
    when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc5(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || used_by || '</p></a>'
    else used_by
    end used_by,
    case
    when loaned_to is null and ( upper(used_by)=v('APP_USER') or used_by is null) then '<a href="javascript:myFunc(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
    when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc6(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || loaned_to || '</p></a>'
    else loaned_to
    end loaned_to,
    LOANED_TO_EXPIRY_DATE,
    LOAN_INFO,
    decode(SCAN_NAME,null,'<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>','<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>') SCAN_NAME,
    USERNAME,
    VNC_PASSWORD,
    LAST_UPDATED_BY , </xmp>
    <b>Here I want to add a image column where I can give a link like above to open popup </b>
    from install_dbqa_machines
    Edited by: Sivaramaraju on Jun 19, 2012 9:06 AM
    Edited by: Sivaramaraju on Jun 19, 2012 9:07 AM
    Edited by: Sivaramaraju on Jun 19, 2012 9:08 AM

  • Cannot edit a field that is "Standard Report Column" when new row added

    Hi everyone,
    I have created a master-detail form from the wizard and within the detail report region source I have used apex_item.xxx API
    example;
    select C1, C2,
    CASE when C2 ='N' then
    apex_item.select_list_from_query(3, C3,'select a1 d, a2 r from table1', 'ENABLED', 'NO',null,null, 'f03_#ROWNUM#')
    else
    apex_item.select_list_from_query(3, C3,'select a1 d, a2 r from table1', 'DISABLED', 'NO',null,null, 'f03_#ROWNUM#')
    END C3
    from table;
    All columns C1,C2,C3 are defined as "Standard Report Columns".
    The results allows the column C3 field to be enabled or disabled for input depending on a condition.
    The problem is when you hit the default button "Add Row" to add a new row. The row is non-editable and is populated with null values.
    What I want is to allow input when a new row is inserted into the multi-row detail form.
    Can any one help?
    Is there a way to change the Display As field for the new row columns to "text field" from "standard report column" dynamically?

    I think you will need to use the old way of adding rows instead of the new one. I remember having headaches trying to get it working.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Image column in an interactive report (APEX 4.0)

    Hi,
    I have added a new blob column containing images to an interactive report, but get the following error:-
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    If the "IMAGE" column is removed from the report using the "actions:select column" control, the report is ok.
    The column contains the following settings in the "BLOB Download Format Mask":-
    IMAGE:WINEDETAILS:IMAGE:WINE_ID::MIMETYPE:FILENAME:::inline:Download
    Have I missed something?
    Regards
    Tim

    Firstly, did you run: GRANT EXECUTE ON DISPLAY_IMAGE TO PUBLIC
    Yes..
    Secondly, is "OBJEKT" a reserved word in your language version of Oracle?
    No, objekt is not reserved word.
    Lastly, is your table defined in the same way as mine:
    CREATE TABLE "A_IMAGES"
    "IMAGE_ID" NUMBER(10,0) NOT NULL ENABLE,
    "FILE_NAME" VARCHAR2(4000) NOT NULL ENABLE,
    "BLOB_CONTENT" BLOB,
    "MIME_TYPE" VARCHAR2(4000),
    CONSTRAINT "A_IMAGES_PK" PRIMARY KEY ("IMAGE_ID") ENABLE
    Script of my table:
    CREATE TABLE PROD.TOB_DOKUMENTI
    ID NUMBER(10) NOT NULL,
    PARENT_ID NUMBER(3) NOT NULL,
    ID_VALUE NUMBER(10),
    NAZIV_DOKUMENTA VARCHAR2(500 BYTE),
    VELICINA NUMBER,
    OBJEKT BLOB,
    LINK VARCHAR2(1000 BYTE),
    DATUM_OD DATE NOT NULL,
    DATUM_DO DATE,
    STATUS VARCHAR2(1 BYTE) DEFAULT 'D' NOT NULL,
    ID_KUPCA NUMBER(10) NOT NULL,
    ID_VRSTE NUMBER(6) NOT NULL,
    ID_DOC_ORIGINAL NUMBER,
    FILE_NAME VARCHAR2(4000 BYTE),
    MIME_TYPE VARCHAR2(100 BYTE)
    I also think that everything is set up correctly, but it still not working..
    THNX for Your reply..
    Kreso..
    (apart from the table and field names)
    Andy

  • Display BLOB (image) column in (interactive) report

    Hi,
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query. if possible, i would like to control the size of the picture rendered within the report like say 40*50.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    in my query.
    The above also makes the report column as of type "number". is this expected?
    Any help would be much appreciated.
    Regards,
    Ramakrishnan

    You haven't actually said what the problem is?
    >
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    >
    Something like:
    select
              name
            , description
            , dbms_lob.getlength(picture) picture
    from
              details
    if possible, i would like to control the size of the picture rendered within the report like say 40*50.For images close to this size it's easy to do this for declarative BLOB images in interactive reports using CSS. Add a style sheet with:
    .apexir_WORKSHEET_DATA td[headers="PICTURE"] img {
      display: block;
      width: 40px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }where the <tt>PICTURE</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)
    However, scaling large images in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. For improved performance and image quality, and where you require image-specific scaling you can use the database ORDImage object to produce thumbnail and preview versions automatically, as described in this blog post.

  • Can "Standard Report Column" be the Default Instead of "Display as Text"

    Almost every report region I write has some html in at least one column, whether it's a break or an apex_item or something else. Hence, when the region renders with the default settings, the column shows the html code - I have to change the column display type from "Display as Text" to "Standard Report Column".
    Is there some setting to make "Standard Report Column" the default? (Isn't that kind of what the word Standard implies?)
    Thanks,
    Gregory

    That Other Fellas Brother wrote:
    Almost every report region I write has some html in at least one column, whether it's a break or an apex_item or something else. Hence, when the region renders with the default settings, the column shows the html code - I have to change the column display type from "Display as Text" to "Standard Report Column".
    Is there some setting to make "Standard Report Column" the default? (Isn't that kind of what the word Standard implies?)In earlier versions of APEX "Standard Report Column" was the default. The default was changed in APEX 4.0 to "Display as Text" (which escapes HTML-sensitive characters) as a security measure to limit vulnerability to XSS attack. This is necessary for the protection of users and (so-called) developers who are not security conscious/HTML savvy.
    There's no option to change this, and I doubt that one will be provided in the future. The indications are that the Oracle APEX team are committed to blocking as many security holes as possible by default, leaving it to the developer to consciously make any modifications that increase the surface exposed to attack.

  • Need help with Javascript to get value of standard report column

    Hello All,
    Apex version 3.1
    I have a SQL Query (Updateable report) region where I need to do some validations using an OnDemand Applicaiton Process and javascript. For this validation I need to use the serial number and the item id from the same report row. The function is called when the serial number is changed. I can get the serial number easily because it is a Text field, however the item id is a standard report column (making it a text field or hidden gives me a checksum error, long story). How do I get the value for the standard report column in order to set the value for an Application item to be used in my Application Process along with the serial number? Here is my code below.
    <script>
    function f_ValidateSerial(pThis)
      // The row in the table
      var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        //alert('Row is '+vRow);
      // Display the serial number
        //alert('The Serial Number is '+html_GetElement('f21_'+vRow).value);
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=ValidateSerial',0);
    get.add('F101_SERIAL_NUMBER',html_GetElement('f21_'+vRow).value);
    get.add('F101_INVENTORY_ITEM_ID',+html_GetElement(?????+vRow).value);   // Here's where I need to get the item id to set application item!!
    gReturn = get.get();
    if (gReturn)
          alert(gReturn);
      if(gReturn)
          html_GetElement('f21_'+vRow).value = '';
    </script>

    jarola wrote:
    Hi,
    Ok, No standard report column do not have name attribute-
    You can add one extra column to report that is your Item Id with different alias.
    Then change that column Display as to "Hidden".
    Now you have hidden input where is your Item Id. Than input have name and id.
    Regards,
    JariBut this puts me back to my initial problem. When making the column hidden I get the checksum error...
    Error in mru internal routine: ORA-20001: Error in MRU: row= 0, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process...
    The item id is NOT in the table which I am updating (I use a subquery to get the data) so I think it has to be a standard report column. Hidden and Text Item (which have an item id) all generate the checksum error.
    So I think I'm back to my original question. Given a standard report column on a row in a sql query (updateable report) region how do I get the value using Javascript?
    Edited by: blue72TA on Aug 2, 2011 12:07 PM

  • Image won't use full width of page in Standard Report

    Using LabVIEW 2012 in both Windows XP and Win7
    Specifically, I'm trying to use a cluster control  with strings and numerics for a generic report page.  I stuff the strings and numerics with the info that's needed to create the desired page content.
    I am creating a standard report.  The use of Word or Excel is not considered due to compatibility issues when either NI or Microsoft release version upgrades.
    I have tried setting the report margins as well as leaving them at default; the results are the same.
    I set the header text and footer text to indicate where the report generation function believes the margins to be.  Both header and footer honor the margin settings and appear on the report page as they are expected.
    When I "append control image to report" using the reference to the cluster control, the resulting image is 6.2" wide and hugs the left margin regardless of what size the control actually is.  If the control is widened, it is rescaled to 6.2" wide.  I tried using picture and array controls; results are the same.  I tried using the "append front panel image to report"; same results.  The "Alignment" input seems to have no effect.  The issue seems to be with the way images are handled in the report generation.
    Oddly enough, the height seems to behave quite normally.  If the object is too large in height, it is simply truncated at the bottom margin.
    I tried using landscape orientation which functionally exhibits the same issue; object hangs on left margin and will not fill the width of the page.
    I tried HTML which centers the image on the page but doesn't honor margins and prints info at top and bottom that I can't get rid of.
    I contacted NI support and generated an active support question reference# 7369484.  So far, no solution.
    Any help would be appreciated!

    Similar problem using LV2011. I have to print labels on a 100x70 mm paper without borders. No chance to scale the control image to fit.
    Calculating the size of the initial picture (480x360 pixels) scaled at 96 DPI would result in a size of 127x95 mm.
    Actually the height printed is exactly this, but the width shrinked to about 45-50 mm.
    A part of the solution might be to create an image (use 'create/invoke node/get image') and send this to the printer (how to do this?). Actually the HTML report creates an 96 DPI image together with the html page.
    In my case I should create an image of at least 150 DPI (300 or 600 DPI prefered). But there are no options in either the 'get image' or append control image to standard report to set the resolution.
    Bad thing!
    Attachments:
    CT0181860494.jpg ‏26 KB

  • Standard Report - Append Control Image Width Problem / Limitation or Bug?

    I am trying to create a Standard Report and am having a hard time placing a XY Graph control on the report. My problem is I want to use the maximum page area to view the graph. For this reason, I am keeping the margins small and increasing the size of the control so that it occupies almost all of the page. What I find is that after a certain limit, the XY graph image output on the report does not increase in size even if you increase the control size. In fact the image will get worse with larger size once beyond the limit. No matter How I try, the Image will not occupy all the area between the Horizontal Margins.
    Either this is a bug or undocumented limitation.
    Ahh.. One other possibility exists, that I am not smart enough. But if some one can help me here, It will be greatly appreciated.
    I am Using LV 8.2 on XP machine.
    I am attaching the VI and two PDF files, In "MyReport w1000.pdf" The XY Graph is 1000 Pixels Wide. In "MyReport w2000.pdf" I made it 2000 Pixels wide, however the size of the image did not increase on the report. Also You can notice the difference in quality between the two reports.
    To use my vi just size the graph to different sizes and run it, It will output to the default Printer. If you have a PDF writer set as default printer, It will save it to file.
    If anyone can help, I thank you and wish you...
    Good Luck!
    Mache

    I do not like Vivek's workaround. "Use HTML report"  is not acceptable when the question is about Standard report. People may want to use Standard report and there is a reason it is called standard.
    Anyway one solution is to size the image to most optimum size - as large as possible but retaining the graphical quality. This will still leave you with large white spaces around your graph object.
    Second solution that I am using is to Put the graph object and any other elements that I want on my report on a Front panel of a VI. Size the objects and front panel and objects appropriately and then use Print Panel to Printer method to Print the whole VI front panel. In my app. This VI which mimics the report is called from my app and is called Print Preview.  There is even a Vi that allows you to choose the printer. http://zone.ni.com/devzone/cda/epd/p/id/1327
    I am attaching a Sample Report and Code Snippet to look at.
    Good Luck!
    Mache
    Attachments:
    Labview Document.pdf ‏21 KB
    Print Code.jpg ‏30 KB

  • Displaying leading spaces in a Standard Report Column

    Is there a way to display leading spaces in a standard report column in APEX?
    I am using the following hierarchy query to left pad the metric title with spaces to indent subordinate records. The problem is that the APEX report truncates the leading spaces when the data is displayed.
    I have replaced the spaces with an underscore, however the end users prefers white spaces for readability.
    Any help is greatly appreciated.
    SELECT
    t.group_id,
    t.metric_id,
    LPAD(' ',(LEVEL - 2)*5,' ') || d.metric_title metric_title,
    d.business_unit,
    get_name(d.data_owner) data_owner,
    d.metric_status,
    t.group_sort
    FROM tbl_health_metric_groupings t JOIN tbl_health_metric_definition d ON t.metric_id = d.metric_id
    WHERE t.group_id != 0
    START WITH t.group_id = 0
    CONNECT BY t.parent_group_id = PRIOR t.group_id
    ORDER SIBLINGS BY t.group_sort, d.metric_title

    Thanks Tony your comment got me pointed in the right direction.
    LPAD only pads a single character to the left so doing something like LPAD(' ',(LEVEL -2)*5,' ') does not produce the expected results however placing LPAD inside a replace function does...
    The following works as expected and places leading spaces at the begining of the metric title based on the hierarchy:
    SELECT
    t.group_id,
    t.metric_id,
    replace(LPAD(' ',(LEVEL - 2)*5,' '),' ',' ') || d.metric_title metric_title,
    d.business_unit,
    get_name(d.data_owner) data_owner,
    d.metric_status,
    t.group_sort
    FROM tbl_health_metric_groupings t JOIN tbl_health_metric_definition d ON t.metric_id = d.metric_id
    WHERE t.group_id != 0
    START WITH t.group_id = 0
    CONNECT BY t.parent_group_id = PRIOR t.group_id
    ORDER SIBLINGS BY t.group_sort, d.metric_title

Maybe you are looking for

  • Leopard installer disc won't eject...

    Hi, I'm getting really frustrated... got tons of work to do, and I can't use my mac. I accidentally rebooted my mbp with leopard's installer disc inside. Now every time my mac boots it will enter leopard's installation. I tried the CommandOption+OF t

  • Need to Count Items in PO

    I want to count the items monthly wise those are using first time in that year (APR - MAR). For example if we use a item for PO in the month of April, May, June, .... the item should count in the month of April only I developed one query for that but

  • Futures account

    Hi, Is there any validation for Business partner (Depository role) with futures account? For example I want to create a currency future with Business partner (counterparty role) and futures account with same business partner  (Depository role), Will

  • Cldapsdk for linux 64 bit AMD

    We are using sun's cldapsdk as client library to connect to LDAP server. Since we need to support our software for linux 64 bit AMD platform we are in great need for cldapsdk for the same platform. Please let me know when are you planning the release

  • Finder Saved State Issue

    I don't know why, but just starting today I have 3 apps that open on a restart or login. These are not login items. Firefox ICal (which displays repeated reminders of three weekly events, some going back several days. cancelling only stops them in th