Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Picture problem

Forum

Search UsersRules
Picture problem
#1
Active user
Points:: 0
Joined:: Apr 10, 2020

Hello,
I've added a new image area to the products file. Field type ValueStorage (Picture-2). This picture is displayed (Picture-1). No problem. However, I cannot bring the picture in this field to the order report (Picture-3). Can you help me?

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

Hello Ertuğrul,

please see the example below.

Suppose you have a catalog "Products" and the image is stored in the "DataPicture" attribute (screenshot 1).

We also have a SpreadsheetDocument that has an Image element named D2 (screenshot 2). In this case, the source code for printing the image will look like this:


Code
&AtClient
Procedure cmdPrint(Command)
   
   PrintDocument = PrintAtServer();
   
   PrintDocument.Show(PrintDocument);
   
EndProcedure

&AtServer
Function PrintAtServer()
   
   PrintDocument = New SpreadsheetDocument;
   
   Template    = Catalogs.Products.GetTemplate("Template");
   PictureArea = Template.GetArea("PictureArea");
   
   Picture = New Picture(Object.Ref.DataPicture.Get());
   
   PictureArea.Drawings.D2.Picture = Picture;
   
   PrintDocument.Put(PictureArea);
   
   Return PrintDocument;
   
EndFunction


The attachment also contains dt file with an example.

Profile
#3
Active user
Points:: 0
Joined:: Apr 10, 2020

thank you :)

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.