Formatted Document

The 1C:Enterprise developers forum

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

Hello,

I made a design for FORMATTED DOCUMENT (Picture-1, Picture-2). But I'm recording like picture-3. When I recall it after recording, its format is broken (Picture-4). Can you help me?

Save operation;
& AtServer
Procedure HSY_OnReadAtServerBefore (CurrentObject)
        FormattedDocument = CurrentObject.HSY_ContentHTML.Get ();
EndProcedure

Reading process;
& AtServer
Procedure HSY_BeforeWriteAtServerAfter (Cancel, CurrentObject, WriteParameters)
       CurrentObject.HSY_ContentHTML = New ValueStorage (FormattedDocument);
EndProcedure

Note: Screenshots are in word document.

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

Dear Ertuğrul,

i think you could to swap the read and write procedures. Please see the code below:

saving procedure

Code
&AtServer
Procedure BeforeWriteAtServer(Cancel, CurrentObject, WriteParameters)
   
       CurrentObject.ContentHTML = New ValueStorage(FormattedDocument);
   
EndProcedure


reading procedure
Code
&AtServer
Procedure OnReadAtServer(CurrentObject)
   
        FormattedDocument = CurrentObject.ContentHTML.Get();
   
EndProcedure


The result looks something like this - please see the screenshot.

Also attaching the unloading of the program code where this mechanism is implemented.


Best,
Aleksandr

Download 1.png (55.67 KB)
 
Subscribe
Be the first to know tips & trick 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.