27

如何将SAP C4C自定义BO中类型为图片的附件用PDF文档显示出来

 3 years ago
source link: https://segmentfault.com/a/1190000023823063
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

My series of Cloud Application Studio Blogs

Requirement

You have created your custom BO with attachment upload functionality available via this blog Step by step to enable your custom BO with attachment upload functionality .

And now you have successfully uploaded two images as attachment to a given BO instance:

1460000023823067

1460000023823066

1460000023823069

You would like that once preview button is pressed, the PDF will be generated which display these two images from uploaded attachment.

The rendered PDF looks as below:

1460000023823068

This requirement just needs a few enhancement on the form template itself, whose development is already introduced in blog Step by Step to create an Adobe Print form in Cloud application Studio .

(1) Open the form template via Adobe Form Designer, menu File -> Form Property:

1460000023823071

Set PDF Render Format as Dynamic XML Form:

1460000023823070

(2) Select your body page and set the Content property as “Flowed” instead of “Positioned”:

1460000023823073

(3) Drag a table control from control toolbox, select table header node and DO NOT bind any BO nodes to it.

1460000023823072

Select table row node, bind it to path: $.TestBO.Attachment.DocumentList[*] and mark the checkbox “Repeat Row for Each Data Item”:

1460000023823074

Select the last column field in table row, change its type for Text Field to Image Field:

1460000023823075

And use relative binding to bind its path to the corresponding BO field BinaryObject which stores the binary data of an attachment.

1460000023823076

After that in the runtime when the PDF is rendered, the table row will automatically be created based on the number of uploaded images as attachment, this behavior is called as “Data Driven Layout process”.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

1460000021316561


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK