Creating And Styling Excel Document

Last Updated: 07/15/2016 Introduced in Verision: 2.0

This tutorial demonstrates how to Create an Excel Document in the Flow. Additionally, this tutorial demonstrates how to apply different Styles to this Excel Document. Create New Excel File step can be found under Data > List > Excel and CSV category in the ToolBox in the Flow Designer. Different Style Steps that can be applied to the Excel Document located in the Data > List > Excel and CSV > Styling category in the ToolBox.

 

Example:

We begin in the Designer Folder with clicking Create Flow button on the Folder Actions panel.

 createFlow

Next, we name our Flow and click Create to proceed to the Flow Designer.

 nameFlow

In the Flow Designer we use Flow Designer Wizard to add Create New Excel File step from All Steps [Catalog] > Data > List > Excel and CSV category.

 createNewExcel

Next, we add Set Values In Row step from the same category in the Flow Designer Wizard.

 setValuesInRow

Then, we select Create New Excel File step on the workspace and configure it using Step Information Layer. We select Constant Mapping type for fileName and sheetName fields and provide these fields with desirable Values.

 mappingCreateNewExcelFile

Next, we select Set Values In Row step and click Show Mapping Editor option from step’s Action menu.

 showMappingEditorSetValuesInRow

In the Mapping Editor we map data to this step as follows. We use the Excel File that was created in the First Step in our Flow as an input field. Other fields defined Constant. Then, we click Ok to save and close Mapping Editor.

 mappingForSetValuesInRow

Back in the Flow Designer we add Set Values In Column step from All Steps [Catalog] > Data > List > Excel and CSV category.

 setValuesInColumnStepAdd

Next, we open Mapping Editor for this step…

 showMappingEditorSetValuesInColumn

We map data for this step in the similar manner we mapped data for Set Values In Row step. When finished, click Ok to save and close Mapping Editor.

mappingForSetValuesInColumn

Next we are going to apply some styles for our Excel Document. We expand All Steps [Catalog] > Data > List > Excel and CSV > Styling category in the Flow Designer Wizard and add Increase Font Size step to our Flow.

 increaseFontSizeStep

We open Mapping Editor for this step…

 showMappingForIncreaseFontSize

In the Mapping Editor we connect file field to the Excel File that was created in the First step in our Flow. We define other fields Constant and provide them with desirable Values. Click Ok to close and save Mapping Editor.

 mappingForIncreaseFontSize

Next, we add Set Background Color step from All Steps [Catalog] > Data > List > Excel and CSV > Styling category…

 addSetBackgroundColor

And map data in the following manner using Mapping Editor.

 setBackgroundColorMapping

From the same Styling category, we add Set Bold step…

 addSetBoldStep

Then, we call Mapping Editor…

 showMappingForSetBold

And map data for this step…

 mappingForSetBold

Finally, we add Set Font Color step from Styling category…

 addSetFontColor

Open Mapping Editor…

showMappingSetFontColor

And map data…

 mappingForSetFontColor

Every time we make changes to the Excel File in the Flow we need to update it. For this purposes we add Update File With Data step from All Steps [Catalog] > Data > List > Excel and CSV category in the Flow Designer Wizard.

 updateFileWithData

We open Mapping Editor for this step…

 showMappingEditorForUpdateFileStep

And map data in the following manner… We use the Excel File that was created in the First step in our Flow as an input field to this step. When finished, we save and close Mapping Editor.

 mappingForUpdateStep

Lastly, we add Download File Form step from Flows, Rules, Forms and Reports > Forms[Interaction] > [Current Folder] category in the Flow Designer Wizard.

 addForm

This Form was predesigned for this tutorial. It simply has an Action Button control and File Download control. It was designed for user to be able to download the Excel Document that we have created.

 formDesign

Next, we select this Form step on the workspace and configure data mapping using Step Information Layer. For DownloadFile Mapping type we choose Select Value. Then, using Value Picker we select the File that we have created in the First Step in this Flow.

 mappingForForm

We connect all steps in the Flow as follows… This completes our Flow. We can click Debug Flow link from the Top panel of the Flow Designer to test our Flow.

Note that in Decisions version 3.5 and higher, you’ll need to click Test Flow to access the Debugger.

3.5 Test Flow Shot

 debugFlow

When our Form opens in the Debugger we click Download File…

 downloadFileInDebugger

We confirm that we want to save the File. Then, we select the location for our File, Name it and Save.

 saveFile

Decisions informs us that the File was saved…

 fileSaved

And we click Done button on the Form in the Debugger to close the Form.

 closeForm

Flow Diagram in the Debugger indicates that our Flow ran to the End Step with no errors.

 flowDiagramSuccess

Next, we can locate and open Excel Document to confirm that all the styles applied as we have designed.

 result

 

 

Additional Resources