Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Image position in Excel Cell

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Image position in Excel Cell
 Login/Join
 
Guru
posted
Does anyone have any tricks to try and position and image in a cell? I opened a case and the official word is that it is not possible, but there might be some work arounds. Has anyone accomplished this?

Thanks,

Matt


 DEFINE FILE CAR
 DOT_GRN/A200 WITH CAR = '<img src="/ibi_html/vis/dot_grn.gif" alt="Cheap">';
 DOT_RED/A200 WITH CAR = '<img src="/ibi_html/vis/dot_red.gif" alt="Zowie">';
 DOT_YEL/A200 WITH CAR = '<img src="/ibi_html/vis/dot_yel.gif" alt="Okay">';
 END
 -*
 TABLE FILE CAR
 SUM DEALER_COST

 COMPUTE REPORT_DOT2/A200 = IF DEALER_COST LT 6000  THEN DOT_GRN
 ELSE IF DEALER_COST LE 12000 THEN DOT_YEL
 ELSE                           DOT_RED; AS ''
 BY CAR
 BY MODEL
 ON TABLE PCHOLD FORMAT EXL2K
 END
  

This message has been edited. Last edited by: Kerry,


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
Expert
posted Hide Post
There are other examples of adding custom Excel bits, I think that these will help.

HAve a look here


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
images are tricky b/c with webfocus they don't 'EMBED'; (they do EMBED with 'other products',);
What i had to do, in order to create an order form with pictures of products, and control the height of the row, was trick it.
TYPE=DATA,COLUMN=BLOCK,SIZE= &FONTSIZE ,COLOR=WHITE,$
i created a field called BLOCK which contained a '1' and made it huge in font size, and colored white.
then the picture (you have it defined correctly, although i don't know whether the alt tag would work in excel).. comes as the next field.
so the rows get adjusted in height according to the height of the 'BLOCK' field.
It worked. It still allowed the pictures to float, a bad thing, and not sort. But it worked for us... until we switched products...
IHTH




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
<JG>
posted
The method that I use to achieve this is to use a macro to embed the image.

For example

 
DEFINE FILE CAR
IMAGE/A10=DECODE MODEL(
'V12XKE AUTO' 'a.jpg' 
'XJ12L AUTO'  'b.jpg'
'INTERCEPTOR III'  'c.jpg'
'TR7'  'd.jpg'
'B210 2 DOOR AUTO'  'e.jpg'
'COROLLA 4 DOOR DIX AUTO'  'f.jpg'
'2000 4 DOOR BERLINA'  'g.jpg'
'2000 GT VELOCE'  'h.jpg'
'2000 SPIDER VELOCE'  'i.jpg'
'DORA 2 DOOR'  'j.jpg'
'100 LS 2 DOOR AUTO'  'a.jpg'
'2002 2 DOOR' 'k.jpg'
'2002 2 DOOR AUTO'  'l.jpg'
'3.0 SI 4 DOOR' 'm.jpg'
'3.0 SI 4 DOOR AUTO' 'n.jpg'
'530I 4 DOOR'  'o.jpg'
'530I 4 DOOR AUTO'  'p.jpg'
'504 4 DOOR'  'q.jpg'

END
TABLE FILE CAR
PRINT CAR MODEL IMAGE
ON TABLE PCHOLD FORMAT EXL2K
END 


This simply puts the name of the image in the cell in excel

The images must be in a folder available to the web server such as baseapp
(all required images must exist otherwise it misplaces 1 of the images)


The macro code looks like this, it resolves and embeds the image in the cell and does a little positional adjustment on it

 
Sub Workbook_Open()

' stops the macro running a second time if it's saved
If SheetName <> "Sheet1" Then
' Skip Macro
Else

Sheets(1).Name = "another name"

    Call FindAndInsertPicture

' stops people moving the images about
 ActiveSheet.Protect Password:="password", DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Sub FindAndInsertPicture()
On Error Resume Next
Dim ws As Worksheet
Dim p As Object, t As Double, l As Double, w As Double, h As Double
Dim PictureFileName  As String, LookFor As String, sAddress As String

For Each ws In Worksheets
    jPeg = ".jpg"

    sAddress = ws.Cells.Find(jPeg, , , , xlPart, False).Address
    
    Do While sAddress <> ""
        
    LookFor = ws.Range(sAddress).Value
    
        PictureFileName = "http://webserver/approot/baseapp/" & LookFor
        
        Set p = ActiveSheet.Pictures.Insert(PictureFileName)
        With ws.Range(sAddress)
            t = .Top
            l = .Left
            If CenterH Then
                w = .Offset(0, 1).Left - .Left
                l = l + w / 2 - p.Width / 2
                If l < 1 Then l = 1
            End If
            If CenterV Then
                h = .Offset(1, 0).Top - .Top
                t = t + h / 2 - p.Height / 2
                If t < 1 Then t = 1
            End If
            .Value = ""
        End With
        ' position picture
        With p
            .Top = t + 2
            .Left = l + 9
        End With
        sAddress = ""
        sAddress = ws.Cells.Find(jPeg, , , xlPart, , xlNext, False).Address
    Loop
    
Next
End Sub
 
 
Report This Post
Expert
posted Hide Post
oh this could be the tip o' the year!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Nice solution JG, and goes to show that you don't have to use just WebFOCUS to provide a solution!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Thank you everyone for the suggestions. We will take a look to see if we can implement any of these.


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
<JG>
posted
Happy Christmas,

If you have any problems let me know and I'll post a fully working example.
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Image position in Excel Cell

Copyright © 1996-2020 Information Builders