-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image in a table column #12
Comments
Right now a table is only meant for simple tabular text display. If you need more complex layouts you can use sections which are more flexible. |
How add various images with data when I generate report? # data.toImageSectionData[0].image is a base64 image
report = Report(report_definition, data, is_test_data, additional_fonts=additional_fonts) when I add image to template, get something like this - the same picture in multiple rows of section |
you can pass images as base64 encoded or I/O object. See data parameter in the method documentation |
What type should I use for it in frontend? List type contains only simple types. I need various picture for each section row. I want to do smth like this If I use List->Text field in frontend to pass base64 image from dataset I get an error (it looks for image type, I guess). # 'test_image' = $items[0]['preview']
ptType = copy(report.context.parameters['test_image'].type)
report.context.parameters['items'].fields['preview'].type = ptType It works normally, and set base64 image from dataset without errors. Why option 'List'->'Image' not included in type select input , can I add it by some settings? |
you're right, Image type should be allowed in a list. We will add this in the next version. With a text parameter used for an image you can pass a url (starting with "https://" or "http://"). In the next version we'll also allow specifying a file path (starting with "file:" ). |
Is it possible to have the image specified via a URL load within the builder? Ie, i wish to see the image whilst I'm editing |
there is no preview of image links in the Designer. You could download the file and select it for the image file. Then you get a preview and for rendering the image link will be used. |
Thanks for your response. Is there a way to integrate the loading of an image via a URL? It does make it difficult to design a report around an image that is only seen as a box. A scenario would be a dynamic background image that is loaded, that has placeholder spaces. I need to be able to place (on top of the image/background) certain fields. |
image preview for images specified by url is now supported |
Thank you for all these new features/bugfixes. These are fantastic!! |
Further to the above, should I be able to have an image, with the 'Source' being from a dynamic parameter such as a URL? |
you can have a parameter (type: text) which contains the url and an image with the source containing the parameter. The image will be shown when the report is generated. The preview does only work in case the url is directly set as image source and not by parameter because the parameter is evaluated at runtime. So I guess that's still a problem in your case? We'll see if we can use the parameter test data for image preview in case a parameter is used. |
The preview is not an issue in this instance. However, I think I found a further 'bug'. The suggested function only works if it is not a child object. Only top-level parameters seem to work in the suggested manner. If I am using a child as the image source I get a 'Parameter not found' error. |
You're right, when the parameter (containing the image url) used for image source belongs to a collection parameter it doesn't work. We'll try to fix this with the next update. |
Using a parameter with image url inside a collection is now possible with the latest release 1.5.0 |
Hello! I try to display an image in the table column with following steps:
As a result, I would expect my images to be rendered in the table column/rows. Unfortunately, I see that my cell contains the base64-encoded image data displayed as a string. What am I doing wrong? |
You should use a section because images in tables are not supported. |
Is there any way on inserting an image into a table column? What about multiple images in a single row?
The text was updated successfully, but these errors were encountered: