Closed mufeng272933 closed 2 years ago
xltpl uses xlrd to read and xlwt to write xls file. xlrd does not extract images, datavalidations or autofilter. xltpl uses openpyxl to read and write xlsx file. openpyxl uses Pillow to fetch image object. If Pillow not installed or Pillow can not locate image file. {%img v%} will be ignored.
I'm sure that pillow is installed, but the example don't work on my computer
Would you like to upload the generated files, and provide version numbers of the os, python, xltpl, openpyxl, pillow?
examples.zip This is my configuration and thank you.
It seems that the images other than the last one in the 'image' worksheet have been deleted or moved, causing {%img v%} to be ignored.
I am looking forward to your continuous improvement
{%img v%} must be in the first cell of the range covered by the image.
isn’t it right? I don't think I violated what you said
The first cell of the range covered by the image is the cell corresponding to the coordinates of the top-left of the image. It could be part of a merged cell, and is not visible. In such a case, you can unmerge the merged cell and move the variable to the appropriate cell.
in fact it's not a merged cell. I stretched it.
Upgrade your xltpl and retry.
it doesn't work either.
Upload your file. Let's see how to make it work.
You need to insert an image as a reference so that xltpl can determine the position, size of the image to be generated.
I'm ready to give up. Maybe xlwings is also a good choice
ok
Inserted a reference image in Sheet1.
lo_info={'pic':pic} lo_info={'test':'test'}
changed to
lo_info={'pic':pic} lo_info['test'] = 'test'
i'm sorry about that but it doesn't work.Thank you just the same.
At 2022-01-19 11:43:11, "Zhang Yu" @.***> wrote:
Inserted a reference image in Sheet1.
lo_info={'pic':pic} lo_info={'test':'test'}
changed to
lo_info={'pic':pic} lo_info['test'] = 'test'
xlstpl_test.zip
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>
The image function in the example does not work.