Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Formatted Document

Forum

Search UsersRules
Formatted Document
#1
Active user
Points:: 0
Joined:: Apr 10, 2020

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.

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

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

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.