Announcement

Collapse
No announcement yet.

Field type Image Html in Grid app vs Form grid edit

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Field type Image Html in Grid app vs Form grid edit

    Good teams,
    I have code working for view field imagehtml in grid, perfect. the copy paste code in form application type edit grid and not working.

    i know because.

    the copy code for use other people, the name file es equal a value field referencia.png
    in event onrecord

    $longitud1= strlen({Referencia});
    $variable={Referencia};
    $longitud=strlen($variable);
    $itemid=trim({Referencia});
    $serverport=getenv('SERVER_PORT');
    $serverIP=getenv('SERVER_ADDR');

    IF ($serverport<>'80')
    {
    $path_url='HTTP://'.$serverIP.':'.$serverport;
    }
    else
    {
    $path_url='HTTP://'.$serverIP;
    //getenv('SERVER_ADDR');
    }


    $nombre_fichero=[glo_path_img].$itemid.'.png';
    $validfile=getenv('DOCUMENT_ROOT').$nombre_fichero ;

    /**
    * Validar existencia del archivo antes de usarlo en la URL
    */

    if (file_exists($validfile))
    {

    $nombre_fichero=$path_url.[glo_path_img].$itemid.'.png';
    $result = @getimagesize($nombre_fichero);
    list($width, $height, $tipo, $atributos) = @getimagesize($nombre_fichero);
    if ($data = @getimagesize($nombre_fichero))
    {
    $width=(25*$width)/100;
    $height=(25*$height)/100;
    //echo $data[1];
    {IMAGEN}="<img src='$nombre_fichero' border='0' width='$width' height='$height' >";
    $width=(300*$width)/100;
    $height=(300*$height)/100;
    {IMG_SIZE}="<img src='$nombre_fichero' border='0' width='$width' height='$height' >";
    }
    }else
    {

    $path_url='HTTP://'.getenv('SERVER_ADDR').':'.getenv('SERVER_PORT');
    $nombre_fichero=$path_url.[glo_path_img].'error'.'.png';
    list($width, $height, $tipo, $atributos) = @getimagesize($nombre_fichero);
    if ($data = @getimagesize($nombre_fichero))
    {
    $width=(25*$width)/100;
    $height=(25*$height)/100;
    {IMAGEN}="<img src='$nombre_fichero' border='0' width='$width' height='$height' >";
    }

    }
    Last edited by ayepes2003; 11-07-2014, 10:35 AM. Reason: For relation Scriptcase 8 and scriptcase 7

  • #2
    I are applicatio create for quotation sales. i like only view in form edit grid products, and print report pdf image.
    the option imagehtml not work, i create table product only three fields.
    ITEMID nvarchar(20) Checked
    ITEMNAME nvarchar(110) Checked
    picture varbinary(MAX) Checked

    I load image in table for example for one product.
    i create form single record, and add picture, ok perfect.

    next open application quotationdetails form grid edit quotationdetails. and add field virtual name IMAGEBD type imagen from database.
    in event onrecord add code

    /**
    * Selecting a field from another table
    */

    // Check for record
    $check_sql = "SELECT itemid,picture"
    . " FROM itemimage"
    . " WHERE itemid = '" . {ITEMID} . "'";
    sc_lookup(rs, $check_sql,"mssql_moduart");

    if (isset({rs[0][0]})) // Row found
    {
    {IMAGE_BD} = {rs[0][1]};
    }
    else // No row found
    {
    }

    i not view image, please help me.
    i not know this bugs o use the scriptcase 7/8.
    Attached Files

    Comment


    • #3
      Hello,

      Issue reported to our bugs team.

      regards,
      Bernhard Bernsmann

      Comment

      Working...
      X