Picture problem

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Apr 10, 2020
Company: HerSüreçYazılım

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?

 
#2
People who like this:0Yes/0No
Administrator
Rating: 23
Joined: Oct 3, 2019
Company:

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.

Download 1.png (13.52 KB)
Download 2.png (74.25 KB)
 
#3
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Apr 10, 2020
Company: HerSüreçYazılım

thank you :)

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.