Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

can't insert images into cell

I setup ImageList and ItemImage properties but still can't insert images into cell, and I saw a previous post who had the similar issue and fixed it by changing the FixedRowHeight, which I tried but still doesn't work


  • Can you post your code for analysis?
  • edited June 2018
    ImageList = ''
    ImageList<1> = "C:\path\print.bmp":@VM:4:@VM:"Auto"
    set_property(theControl, "OLE.ImageList", ImageList)
    set_property(theControl, "OLE.ItemImage[":myIndex$:";1]", 1)

    just want to make the first record to have the image for testing
  • edited June 2018
    The wiki was incorrectly documenting the ImageList property. My sincerest apologies. I updated it to reflect correct usage. In your case, simply replace @VMs in your code above with @FMs.
  • Hi, tried replace @vm to @fm, still doesn't work. Could you show me a small project that has about 20 lines? thank you
  • edited June 2018
    Equ Dflt_ImageList$ to '.\images\rtstatus.png':@fm:31
    Set_Property(CtrlEntID, 'OLE.Imagelist', Dflt_ImageList$) ; * Set the imagelist so all report tables have access to the same status icons by default

    If you want images within the table itself you need to look at the ColumnDataSource property

    This tells the reporttable that this column has images instead of or as well as text.
    Then you just use the various list properties to update the image by passing the integer that points to the imagelist frame you want to use.
    You could also use the itemimage property but the column still needs to know beforehand to expect images
  • edited June 2018
    Hi AusMarkB

    I have tried that, still doesn't work, my code is like:

    ImageList = ''
    ImageList<1> = "C:\1-print.bmp":@FM:1

    set_property(reportTable,"OLE.ColumnDataSource[":index$:"]", "Image")

    then I use:
    data = ''
    data'<'rowNumber, index$'>' = 1 //forget about the single quote, otherwise could not display properly
    set_property(reportTable, 'OLE.List', data)


    set_property(reportTable, "OLE.ItemImage[":index$:";":rowNumber:"]", 1)
    data = ''
    set_property(reportTable, 'OLE.List', data)

    both not working
  • edited June 2018
    Here is a sample setup. Perhaps it will help us narrow down the issue. I suspect order of operations might be at play. Column and Item properties do nothing if those columns or items do not yet exist.

    Ctrl = @Window:".OLE_REPORT" // Set the images Set_Property(Ctrl, "OLE.ImageList", "BMPS\bmreport.bmp":@FM:10:@FM:RGB(255, 0, 255)) // Set up four columns Columns = "" Columns<-1> = "State" :@VM:"T":@VM:80 Columns<-1> = "County" :@VM:"T":@VM:80 Columns<-1> = "Subject":@VM:"T":@VM:150 Columns<-1> = "Number" :@VM:"N":@VM:80:@VM:@VM:@VM:@VM:@VM:@VM:@VM:"Right":@VM:@VM:"$#,##0.000":@VM:1:@VM:@VM:@VM:"R" Set_Property(Ctrl, "OLE.ColumnList", Columns) // Column-specific properties must be set after creating columns Set_Property(Ctrl, "OLE.ColumnDataSource[1]", "ImageAndText") // Load a bunch of data, which includes images in the first column Data = "" Data := 5:@SVM:"Oregon":@VM:"Klamath":@VM:"Under 5 years":@VM:4000:@FM Data := 5:@SVM:"Oregon":@VM:"Klamath":@VM:"5 to 9 years":@VM:3964:@FM Data := 5:@SVM:"Oregon":@VM:"Klamath":@VM:"10 to 14 years":@VM:4179:@FM Data := 5:@SVM:"Oregon":@VM:"Klamath":@VM:"15 to 19 years":@VM:4605:@FM Data := 5:@SVM:"Oregon":@VM:"Klamath":@VM:"20 to 24 years":@VM:4271:@FM Data := 5:@SVM:"Oregon":@VM:"Klamath":@VM:"25 to 29 years":@VM:3607:@FM Data := 5:@SVM:"Oregon":@VM:"Jackson":@VM:"Under 5 years":@VM:11942:@FM Data := 5:@SVM:"Oregon":@VM:"Jackson":@VM:"5 to 9 years":@VM:11775:@FM Data := 5:@SVM:"Oregon":@VM:"Jackson":@VM:"10 to 14 years":@VM:12582:@FM Data := 5:@SVM:"Oregon":@VM:"Jackson":@VM:"15 to 19 years":@VM:13249:@FM Data := 5:@SVM:"Oregon":@VM:"Jackson":@VM:"20 to 24 years":@VM:12176:@FM Data := 5:@SVM:"Oregon":@VM:"Jackson":@VM:"25 to 29 years":@VM:11908:@FM Data := 6:@SVM:"California":@VM:"Orange":@VM:"Under 5 years":@VM:191691:@FM Data := 6:@SVM:"California":@VM:"Orange":@VM:"5 to 9 years":@VM:198769:@FM Data := 6:@SVM:"California":@VM:"Orange":@VM:"10 to 14 years":@VM:210195:@FM Data := 6:@SVM:"California":@VM:"Orange":@VM:"15 to 19 years":@VM:227689:@FM Data := 6:@SVM:"California":@VM:"Orange":@VM:"20 to 24 years":@VM:213601:@FM Data := 6:@SVM:"California":@VM:"Orange":@VM:"25 to 29 years":@VM:215362:@FM Data := 6:@SVM:"California":@VM:"Sacramento":@VM:"Under 5 years":@VM:101063:@FM Data := 6:@SVM:"California":@VM:"Sacramento":@VM:"5 to 9 years":@VM:98112:@FM Data := 6:@SVM:"California":@VM:"Sacramento":@VM:"10 to 14 years":@VM:99820:@FM Data := 6:@SVM:"California":@VM:"Sacramento":@VM:"15 to 19 years":@VM:105680:@FM Data := 6:@SVM:"California":@VM:"Sacramento":@VM:"20 to 24 years":@VM:101908:@FM Data := 6:@SVM:"California":@VM:"Sacramento":@VM:"25 to 29 years":@VM:107922 Set_Property(Ctrl, "OLE.List", Data) // Put an image into the column header Set_Property(Ctrl, "OLE.ColumnImage[1]", 1) // Item-specific properties can only be used after items have been added to the table Set_Property(Ctrl, "OLE.ItemImage[1;1]", 7)
  • @AusMarkB, you do not need to change ColumnDataSource in order to use ItemImage. You just have to make sure you set ImageList and List properties before calling ItemImage.
  • edited June 2018
    Hi Kevin, thank you for posting the sample code,
    I tried but can only add the image in the column header not in the cell, which is the same problem I have, below is a screenshot:

    You can see that the print image is added to the column header but not in the first cell?

    by the way, I was thinking the image might too big so I resized the image to be very tiny, but still doesn't display the image in the cell

Sign In or Register to comment.