1Ci Support Help Center home page
Submit a request
Sign in
  1. 1Ci Support
  2. 1C:Enterprise Platform FAQ
  3. Development

How to dynamically size and place a picture to a spreadsheet (print form)?

  • Development
    • How to read and write data to/from a 1C:Enterprise info base to an XML file?
    • How to show totals for dynamic list fields on the form
    • How to setup and work with distributed infobases in 1C:Drive, alternative way, when the subordinate databases will not be created from the main infobase
    • Is it possible to cumulatively select and deselect rows of a form table by just left clicking on them?
    • How to filter a dynamic list via programming
    • How can I create a Dynamic List via programming?
    • How to filter a value table on a form by changing the query filling the value table
    • How to insert a value table to a query as a parameter
    • Conditional Appearance: How to set it up from the Designer
    • An example on how the asynchronous methods work
See more

Question:

In my print form of a catalog (document etc.), a table with data gets printed. I want to add a picture to the righthand side of the table, and I want to add it such that the height of the picture will be equal to the height of the table. The problem is, I cannot know beforehand the exact count of lines to be show on the table, as it dynamically changes depending on which element is being printed and depending on the amount of data in the database. How can I make it so that the height of the picture dynamically matches the height of the table?

 

Answer:

The screenshot below shows an excerpt from the print procedure from the manager module of a catalog.

Here, “Spreadsheet” refers to the document to be sent to print, it is a parameter which is automatically given to the procedure by the print wizard. In most cases, we modify the Spreadsheet via the “Template”, in our case, we won’t be using the Template for adding the picture though (as the Template do not allow changing the size of the picture dynamically), we’ll work directly on the Spreadsheet. For the picture to be shown, we do not add any areas or drawings to the Template, both the area and drawing will be addede via programming which is shown in the screenshot below.

“PictureData” refers to the Binary Data which is obtained via the AttachedFiles functionality of the default 1C configurations. If we want to show the picture on the Spreadsheet, it must be of Picture data type, that’s why in the beginning we change the Binary Data to Picture data.

The below code works right after the table gets “put” on the spreadsheet.

 

screen_1.png

© 2020-2022 1C INTERNATIONAL LLC www.1Ci.com Support policy