Sage 100

 View Only
  • 1.  Image embedded in the Item Maintenance Main screen

    Posted 02-10-2020 20:34
    Is it possible to embed an image on the Item Maintenance main screen so that you can see the item image right away, rather than having to go to another tab and click on a link to see image. Currently that is 2 clicks. Client wants to do 0 clicks to see the image as soon as they open Item maintenance.
    Is this possible?

    ------------------------------
    Robin Saacks
    Timac Business Systems
    (310) 571-1200 x21
    www.timacinc.com
    ------------------------------


  • 2.  RE: Image embedded in the Item Maintenance Main screen

    Posted 02-10-2020 22:01
    Perhaps a script to launch the view when pressing enter after entering the item code.

    ------------------------------
    Jeff Schwenk
    FORMER 90M Board Member
    Bottomline Software, Inc.
    Waynesboro VA
    540-221-4444
    ------------------------------



  • 3.  RE: Image embedded in the Item Maintenance Main screen

    Posted 02-11-2020 08:14

    Not a bad idea, but then you'd still have to close the view when done. Would be good if an image can be embedded in the panel itself as a UDF etc. Not sure if this is possible.

     

    Robin Saacks

    TimAc Inc

    t 310.571.1200 x21

    c 310.709.1358

    f 310.234.0100

    www.timacinc.com

    Business Systems

     



    ------Original Message------

    Perhaps a script to launch the view when pressing enter after entering the item code.

    ------------------------------
    Jeff Schwenk
    FORMER 90M Board Member
    Bottomline Software, Inc.
    Waynesboro VA
    540-221-4444
    ------------------------------


  • 4.  RE: Image embedded in the Item Maintenance Main screen

    Posted 02-12-2020 01:02
    Edited by David Speck II 02-12-2020 01:26
    Should be doable with a simple post read event script on CI_Item while checking for the current UI task being Item Inquiry/Maintenance and that you are on the correct tab where you want the image displayed. As long as you know the path to the file name and you have space on the panel, you can use the 'PICTURE' mnemonic using the oScript.Execute method to execute the needed ProvideX code.
    https://manual.pvxplus.com/PXPLUS/mnemonics/picture.htm
    Here's an example of manually executing the code. I used Custom Office to figure out the general line and column to start with and the width and length to add to the line and column. I did have to pad the starting line to account for the folder and tab height. I'll add that i have not tested this extensively and it may need tweaking before it is ready for production use.

    To clear the image, you use the same line but with a blank file path at the same location.
    If you want to use the filename specified in the image field, you can build the relative path by using ["..\Images\" & oSession.CompanyCode & "\" & ImageFileVariable] if you used the GetValue method on the ImageFile$ field or you can attempt to use the ProvideX variables that should be populated. Below is a snippet if using the ProvideX variables.
    oScript.Execute "IF ImageFile$<>"""" THEN PRINT 'PICTURE'(@X(74),@Y(20),@X(84),@Y(30),""..\Images\""+%C$+""\""+ImageFile$,6) ELSE PRINT 'PICTURE'(@X(74),@Y(20),@X(84),@Y(30),"""",6) END_IF"​
    When passing ProvideX code to the oScript.Execute method, you have to enclose the entire code in double quotes, any double quotes within the code have to be escaped.
    The "6" being passed as the last argument is the scaling mode, refer to the following for possible options.

    display_opt

    Numeric code used to define style and alignment for use when displaying graphic. Supported options are:

           0 = Align at top-left (See Note below)
           1 = Center/crop within region
           2 = Scale to fit (See Note below)
           3 = Tile bitmaps to fill the given area (See Note below)
           4 = Halftone for enhanced legibility (may lighten black images)
           5 = Scale with proper aspect ratio but output in top left of region
           6 = Scale with proper aspect ratio but centered in the region
           7 = Scale picture to completely fill region and center (See Note below) (Added in PxPlus 2019)

    Note:
    For options 0, 2 and 3:
    The image is cropped to fit within the region for the screen and *WINPRT* output. Cropping is not supported with *PDF*; therefore, pictures sent to *PDF* that are larger than their defined region (based on 72 pixels to the inch) will be auto-scaled to avoid displaying outside the defined region.

    For option 3 (tiled):
    When sending to *PDF*, only images that fit completely inside the region will be output (based on 72 pixels per inch).

    For option 7:
    Once the image is scaled to cover, any overage is cropped. (This option is not supported for *PDF*, which uses option 6 instead.)



    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 5.  RE: Image embedded in the Item Maintenance Main screen

    Posted 02-12-2020 10:36

    David,

     

    That is amazing. Thanks very much for explaining this in detail.

     

    Robin Saacks

    TimAc Inc

    t 310.571.1200 x21

    c 310.709.1358

    f 310.234.0100

    www.timacinc.com

    Business Systems

     



    ------Original Message------

    Should be doable with a simple post read event script on CI_Item while checking for the current UI task being Item Inquiry/Maintenance and that you are on the correct tab where you want the image displayed. As long as you know the path to the file name and you have space on the panel, you can use the 'PICTURE' mnemonic using the oScript.Execute method to execute the needed ProvideX code.
    https://manual.pvxplus.com/PXPLUS/mnemonics/picture.htm
    Here's an example of manually executing the code. I used Custom Office to figure out the general line and column to start with and the width and length to add to the line and column. I did have to pad the starting line to account for the folder and tab height. I'll add that i have not tested this extensively and it may need tweaking before it is ready for production use.

    To clear the image, you use the same line but with a blank file path at the same location.
    If you want to use the filename specified in the image field, you can build the relative path by using ["..\Images\" & oSession.CompanyCode & "\" & ImageFileVariable] if you used the GetValue method on the ImageFile$ field or you can attempt to use the ProvideX variables that should be populated. Below is a snippet if using the ProvideX variables.
    oScript.Execute "IF ImageFile$<>"""" THEN PRINT 'PICTURE'(@X(74),@Y(20),@X(84),@Y(30),""..\Images\""+%C$+""\""+ImageFile$,6) ELSE PRINT 'PICTURE'(@X(74),@Y(20),@X(84),@Y(30),"""",6) END_IF"​
    When passing ProvideX code to the oScript.Execute method, you have to enclose the entire code in double quotes, any double quotes within the code have to be escaped.
    The "6" being passed as the last argument is the scaling mode, refer to the following for possible options.

    display_opt

    Numeric code used to define style and alignment for use when displaying graphic. Supported options are:

           0 = Align at top-left (See Note below)
           1 = Center/crop within region
           2 = Scale to fit (See Note below)
           3 = Tile bitmaps to fill the given area (See Note below)
           4 = Halftone for enhanced legibility (may lighten black images)
           5 = Scale with proper aspect ratio but output in top left of region
           6 = Scale with proper aspect ratio but centered in the region
           7 = Scale picture to completely fill region and center (See Note below) (Added in PxPlus 2019)

    Note:
    For options 0, 2 and 3:
    The image is cropped to fit within the region for the screen and *WINPRT* output. Cropping is not supported with *PDF*; therefore, pictures sent to *PDF* that are larger than their defined region (based on 72 pixels to the inch) will be auto-scaled to avoid displaying outside the defined region.

    For option 3 (tiled):
    When sending to *PDF*, only images that fit completely inside the region will be output (based on 72 pixels per inch).

    For option 7:
    Once the image is scaled to cover, any overage is cropped. (This option is not supported for *PDF*, which uses option 6 instead.)



    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 6.  RE: Image embedded in the Item Maintenance Main screen

    Posted 02-12-2020 13:42
    Edited by David Speck II 02-12-2020 13:45
    Here's a simple script you can test with.
    It must be set on the target panel's post load and post exit event as well as the main table's post read event.
    I included as many variables as i could to make it easier to move around.
    Use Custom Office on the target panel to determine the values to use for the StartingColumn, StartingLine, WidthInColumns, and HeightInLines variables You may need to tweak the StartingLine plus or minus 1-3 to account for folder and tab height.
    If you need to tweak the StartingLine, make sure you compile All Scripts each time you tweak it before testing with a new instance of the target task after compiling the scripts.
    Refer to attached images for examples.
    TargetLibrary = "IM_Item.m4l"
    TargetPanel = "PADDL"
    StartingColumn = 74
    StartingLine = 17
    WidthInColumns = 10
    HeightInLines = 4
    EndingColumn = StartingColumn + WidthInColumns
    EndingLine = StartingLine + HeightInLines
    ' Valid Display Modes
    ' 0 = Align at top left
    ' 1 = Centre/crop within region
    ' 2 = Scale to fit
    ' 3 = Tile bitmaps to fill the given area
    ' 4 = Half-tone for enhanced legibility (may lighten black images)
    ' 5 = Scale with proper aspect ratio but output in top left
    ' 6 = Scale with proper aspect ratio but centred in the region
    DisplayMode = 6
    If IsObject(oSession) Then
    	If oScript.UIObj > 0 Then
    		Set oUIObject = oSession.AsObject(oScript.UIObj)
    		If UCase(oUIObject.GetScreenName()) = UCase(TargetLibrary) Then
    			CMD_STR = "XPRINT 'IMAGE'(""ImageFileGroup""),'PICTURE'(@X(" & StartingColumn & "),@Y(" & StartingLine & "),@X(" & EndingColumn & "),@Y(" & EndingLine & "),""""," & DisplayMode & "),'IMAGE'(DELETE ""ImageFileGroup"")"
    			If InStr(UCase(oScript.GetCurrentProcedure()), UCase("Exit")) = 0 And UCase(oUIObject.GetFolderName()) = UCase(TargetPanel) Then CMD_STR = CMD_STR & "; IF ImageFile$<>"""" THEN PRINT 'IMAGE'(""ImageFileGroup""),'PICTURE'(@X(" & StartingColumn & "),@Y(" & StartingLine & "),@X(" & EndingColumn & "),@Y(" & EndingLine & "),""..\Images\""+%C$+""\""+ImageFile$," & DisplayMode & ") END_IF"
    			oUIObject.SetVar "CMD_STR$", CMD_STR
    		End If
    		Set oUIObject = Nothing
    	End If
    End If
    ​
    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 7.  RE: Image embedded in the Item Maintenance Main screen

    Posted 02-12-2020 13:53

    Will try it. Thanks very much.

     

    Robin Saacks
    TimAc Inc
    t 310.571.1200 x21
    c 310.709.1358
    f 310.234.0100

    www.timacinc.com

    Business Systems

    timac-logo-final signature

     

     



    ------Original Message------

    Here's a simple script you can test with.
    It must be set on the target panel's post load and post exit event as well as the main table's post read event.
    I included as many variables as i could to make it easier to move around.
    Use Custom Office on the target panel to determine the values to use for the StartingColumn, StartingLine, WidthInColumns, and HeightInLines variables You may need to tweak the StartingLine plus or minus 1-3 to account for folder and tab height.
    If you need to tweak the StartingLine, make sure you compile All Scripts each time you tweak it before testing with a new instance of the target task after compiling the scripts.
    Refer to attached images for examples.
    TargetLibrary = "IM_Item.m4l"
    TargetPanel = "PADDL"
    StartingColumn = 74
    StartingLine = 17
    WidthInColumns = 10
    HeightInLines = 4
    EndingColumn = StartingColumn + WidthInColumns
    EndingLine = StartingLine + HeightInLines
    ' Valid Display Modes
    ' 0 = Align at top left
    ' 1 = Centre/crop within region
    ' 2 = Scale to fit
    ' 3 = Tile bitmaps to fill the given area
    ' 4 = Half-tone for enhanced legibility (may lighten black images)
    ' 5 = Scale with proper aspect ratio but output in top left
    ' 6 = Scale with proper aspect ratio but centred in the region
    DisplayMode = 6
    If IsObject(oSession) Then
    	If oScript.UIObj > 0 Then
    		Set oUIObject = oSession.AsObject(oScript.UIObj)
    		If UCase(oUIObject.GetScreenName()) = UCase(TargetLibrary) Then
    			CMD_STR = "XPRINT 'IMAGE'(""ImageFileGroup""),'PICTURE'(@X(" & StartingColumn & "),@Y(" & StartingLine & "),@X(" & EndingColumn & "),@Y(" & EndingLine & "),""""," & DisplayMode & "),'IMAGE'(DELETE ""ImageFileGroup"")"
    			If InStr(UCase(oScript.GetCurrentProcedure()), UCase("Exit")) = 0 And UCase(oUIObject.GetFolderName()) = UCase(TargetPanel) Then CMD_STR = CMD_STR & "; IF ImageFile$<>"""" THEN PRINT 'IMAGE'(""ImageFileGroup""),'PICTURE'(@X(" & StartingColumn & "),@Y(" & StartingLine & "),@X(" & EndingColumn & "),@Y(" & EndingLine & "),""..\Images\""+%C$+""\""+ImageFile$," & DisplayMode & ") END_IF"
    			oUIObject.SetVar "CMD_STR$", CMD_STR
    		End If
    		Set oUIObject = Nothing
    	End If
    End If
    ​
    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------