Using Floe to generate Excel reports and more

[fusion_builder_container hundred_percent=”no” hundred_percent_height=”no” hundred_percent_height_scroll=”no” hundred_percent_height_center_content=”yes” equal_height_columns=”no” menu_anchor=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” status=”published” publish_date=”” class=”” id=”” background_color=”” background_image=”” background_position=”center center” background_repeat=”no-repeat” fade=”no” background_parallax=”none” enable_mobile=”no” parallax_speed=”0.3″ video_mp4=”” video_webm=”” video_ogv=”” video_url=”” video_aspect_ratio=”16:9″ video_loop=”yes” video_mute=”yes” video_preview_image=”” border_size=”” border_color=”” border_style=”solid” margin_top=”” margin_bottom=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=””][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ spacing=”” center_content=”no” link=”” target=”_self” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” background_color=”” background_image=”” background_image_id=”” background_position=”left top” background_repeat=”no-repeat” hover_type=”none” border_size=”0″ border_color=”” border_style=”solid” border_position=”all” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”” margin_bottom=”” animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=”” last=”no”][fusion_imageframe image_id=”13|large” max_width=”” style_type=”” blur=”” stylecolor=”” hover_type=”zoomin” bordersize=”” bordercolor=”” borderradius=”” align=”none” lightbox=”no” gallery_id=”” lightbox_image=”” lightbox_image_id=”” alt=”” link=”” linktarget=”_self” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=””]http://devel.floe.arch.co.uk/wp-content/uploads/2019/02/letters-2794672_1920-1024×256.jpg[/fusion_imageframe][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent=”no” hundred_percent_height=”no” hundred_percent_height_scroll=”no” hundred_percent_height_center_content=”yes” equal_height_columns=”no” menu_anchor=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” status=”published” publish_date=”” class=”” id=”” background_color=”” background_image=”” background_position=”center center” background_repeat=”no-repeat” fade=”no” background_parallax=”none” enable_mobile=”no” parallax_speed=”0.3″ video_mp4=”” video_webm=”” video_ogv=”” video_url=”” video_aspect_ratio=”16:9″ video_loop=”yes” video_mute=”yes” video_preview_image=”” border_size=”” border_color=”” border_style=”solid” margin_top=”” margin_bottom=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=””][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ spacing=”” center_content=”no” link=”” target=”_self” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” background_color=”” background_image=”” background_image_id=”” background_position=”left top” background_repeat=”no-repeat” hover_type=”none” border_size=”0″ border_color=”” border_style=”solid” border_position=”all” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”” margin_bottom=”” animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=”” last=”no”][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=””]

NEW UPDATE: RE-PUBLISHED FOR FLOE EMAIL BUILDER, MAY 2019

Many times over the years customers have asked for reports to be sent in Excel format, and of course there are various approaches for generating such files. Traditionally, however, it has always been a bit painful to generate beautifully formatted reports for Word or Excel. In this blog I will explain how Floe can be used to generate reports that can be consumed by many different applications and devices.
Floe is an email generator, so not the obvious choice as a reporting tool. But using Floe you can easily generate files for emails or for other documents using a simple html template.
Let’s consider a simple example.

Here is a table defined in Floe Email Builder:

We can see that there is a header row and the a repeating row containing some variables.

[/fusion_text][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=””]

Data user-exit

Then we add some code in the email data user-exit in the SAP back-end:

[/fusion_text][fusion_syntax_highlighter theme=”” language=”sql” line_numbers=”” line_wrapping=”” copy_to_clipboard=”” copy_to_clipboard_text=”Copy to Clipboard” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” font_size=”” border_size=”” border_color=”” border_style=”” background_color=”” line_number_background_color=”” line_number_text_color=”” margin_top=”” margin_left=”” margin_bottom=”” margin_right=””]ICBUWVBFUzogQkVHSU4gT0YgdHlfb3V0cHV0LAogICAgICAgICBlY2F0ICAgICAgICAgICBUWVBFIC9GTE9FL0VDQVRfQ09ERSwKICAgICAgICAgZXR5cGUgICAgICAgICAgVFlQRSAvZmxvZS9ldHlwZV9jb2RlLAogICAgICAgICBldHlwZV9uYW1lICAgICBUWVBFIC9mbG9lL2V0eXBlX25hbWUsCiAgICAgICAgIGVzdWJqZWN0X3Nob3J0IFRZUEUgL2Zsb2UvZXN1YmplY3Rfc2hvcnQsCiAgICAgICAgIEVORCBPRiB0eV9vdXRwdXQuCioKICBEQVRBOiBsdF9vdXRwdXQgVFlQRSBUQUJMRSBPRiB0eV9vdXRwdXQuCioKICBTRUxFQ1QgIGV0YWJ+ZWNhdCBldGFifmV0eXBlIHR0YWJ+ZXR5cGVfbmFtZSB0dGFifmVzdWJqZWN0X3Nob3J0CiAgICBJTlRPIFRBQkxFIGx0X291dHB1dAogICAgRlJPTSAoIC9mbG9lL2V0eXBlIEFTIGV0YWIgaW5uZXIgSk9JTiAvZmxvZS9ldHlwZXQgQVMgdHRhYiBPTiB0dGFifmV0eXBlIEVRIGV0YWJ+ZXR5cGUgKQogICAgV0hFUkUgdHRhYn5zcHJhcyBFUSBzeS1sYW5ndS4KKgogIENBTEwgTUVUSE9EIC9mbG9lL2NvcmU9PmdldF9kYXRhX2Zyb21fdGFibGUKICAgIEVYUE9SVElORwogICAgICBpbV90YWJsZSA9IGx0X291dHB1dAogICAgSU1QT1JUSU5HCiAgICAgIGV4X3ZhcnMgID0gY2hfdmFyaWFibGVzLgoq[/fusion_syntax_highlighter][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=””]

Here we perform the database selection into an internal table, and then convert that table into Floe variables using method /floe/core=>get_data_from_table.

Now we’re ready to start testing.

Using the Preview and Test view in Floe Email Builder, preview the email type and see the simple report in the app:

If we send the email, then the report can be viewed in the email client – it works on any mobile device, web-based client, or in Outlook.

Generating the report as an attachment.

We can turn the Floe report output into a document. The easiest way to do this is to define a second Floe email type, and use the ‘Attachment’ user-exit for the document generation.
Here we call the Floe API function, with the preview flag set, and then convert the output to an xstring, then append this to the attachments parameter:

[/fusion_text][fusion_syntax_highlighter theme=”” language=”sql” line_numbers=”” line_wrapping=”” copy_to_clipboard=”” copy_to_clipboard_text=”Copy to Clipboard” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” font_size=”” border_size=”” border_color=”” border_style=”” background_color=”” line_number_background_color=”” line_number_text_color=”” margin_top=”” margin_left=”” margin_bottom=”” margin_right=””]ICBEQVRBOiBsX2JvZHkgVFlQRSBzdHJpbmcsCiAgbHhfYm9keSBUWVBFIHhzdHJpbmcsCiAgbHNfYXR0YWNobWVudCBUWVBFIC9mbG9lL2F0dF9zLgoqCiAgQ0FMTCBGVU5DVElPTiAnL0ZMT0UvRU1BSUxfT1VUJwogICAgRVhQT1JUSU5HCiAgICAgIGltX2V0eXBlICAgICAgPSAnQUEwOCcKICAgICAgaW1fZWxhbmcgICAgICA9IGltX2VsYW5nCiAgICAgIGltX3JlY19lbWFpbHMgPSBpbV9yZWNpcGllbnRzCiAgICAgIGltX3ByZXZpZXcgICAgPSAnWCcKICAgIElNUE9SVElORwogICAgICBleF9lYm9keSAgICAgID0gbF9ib2R5LgoqCiAgQ0FMTCBGVU5DVElPTiAnU0NNU19TVFJJTkdfVE9fWFNUUklORycKICAgIEVYUE9SVElORwogICAgICB0ZXh0ICAgPSBsX2JvZHkKICAgIElNUE9SVElORwogICAgICBidWZmZXIgPSBseF9ib2R5LgoqCiAgbHNfYXR0YWNobWVudC1hdHRfZmlsZW5hbWUgPSAnRW1haWxUeXBlLmh0bScuCiAgbHNfYXR0YWNobWVudC1hdHRfZGVzY3JpcHRpb24gPSAnRW1haWwgVHlwZXMnLgogIGxzX2F0dGFjaG1lbnQtYXR0X2RhdGEgPSBseF9ib2R5LgogIEFQUEVORCBsc19hdHRhY2htZW50IFRPIGNoX2F0dGFjaG1lbnRzLgoq[/fusion_syntax_highlighter][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=””]

Now when we trigger Floe to send the email, the first email appears as an attached document within the second email:

Double-click on the attachment to open it using the default browser. This will work on any device:

If you save the attachment locally it can be opened (and freely edited) in Excel and Word:

So, for an email generator, Floe is remarkably versatile! A simple email, which took 15 minutes to develop, can create a report that can be seamlessly consumed from SAPGUI, Fiori, any email client, any browser, Excel and Word.

[/fusion_text][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

Leave a Reply