Zum Hauptinhalt gehen

Suche

Suche

Default Image

Kommentare

4 Kommentare

  • Avatar
    Shotaro Ito

    Hi kevinha1,

     

    Do you mean you have a data sourced picture which file name is coming from database field,

    and if there's no such file in a folder, show a default picture?

     

    There should be more suitable method to do that - 

    however one idea is place the default picture below the data sourced picture. 

    Set the picture's error handling to [Never abort print job] to avoid error message.

     

    So if the data sourced picture is not shown, the default picture appears. 

    only works if default picture's size is the same or smaller than the data sourced pictures.

    0
  • Avatar
    Legacy Poster

    Thank You for you reply. This method is how I am testing it now. It does work but there should be a better way.

    0
  • Avatar
    Legacy Poster

    After further testing this is not a valid option. many of the item images are smaller than the default image. I need a way to place default image only if the item image is missing.

    0
  • Avatar
    Shotaro Ito

    Try this..

    Create a picture as data source, get database value from database field, then give share name to data source (ex. PICPATH)

    Create another (default) picture, set value as default picture file. In datasource's transform, add VB Script  - if picture file is exists, change data source to empty.

     

    'hide this picture when file PICPATH in "c:\pic" exists
    Set fso = CreateObject("Scripting.FileSystemObject")
    'Named datasource PICPATH have filename of another picture.
    path = "c:\pic\" & PICPATH
    
    'If the file exists, this picture shows nothing. 
    If fso.FileExists(path) = True Then
       Value = ""
    End If
    Set objFileSys = Nothing
    
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.