By selecting the worksheet with the print area you activate the print function for your app. This enables you to save the content of your calculation as a PDF file and send it by email.
- Activate "print as PDF" functionality
- Add "print as PDF" action button with additional options
- Define the PDF file name
- Upload recorded data
- Hide and show "print as PDF" action button depending on conditions
Activate "print as PDF" functionality
First, make sure your source Excel file contains a worksheet that contains the relevant info for your print data. For more information about how to define print areas, please visit the article "Set or clear a print area on a worksheet".
If you want the printout to be in landscape orientation, change the page orientation in your source file. (See: "Print a Worksheet in Landscape or Portrait")
To enable the print functionality in your app, please proceed as follows:
- Open your app in the web portal.
- Navigate to "Edit".
- Select "Print functionality
- Select the print sheet.
- Save the changes and update your app.
Attached please find a sample file in which the worksheet "angebot" is used as a print sheet for the app.
Please be advised that charts will not be visible in the PDF, especially if your source file is a .xlsx file. Sometimes charts are printed if you save your file as .xls and use this version as source file for your app. In this article, you can find out how to switch/update the source file of your app: https://support.openasapp.net/hc/en-us/articles/207939275
You can find a step by step guide on how to build an app with print functionality here: "Create a license calculator with print functionality".
Add "print as PDF" action button with additional options
It is possible to print different sheets from Excel, depending on which action button the user clicks.
To add a "PDF Print" button to your app, do the following:
- Open your app in the web portal.
- Navigate to the Pages & Elements view in the left menu.
- Click on the "+" icon on the right.
- Grab the box "Action Button".
- Place the button at the desired location of your app.
- Open the editor for this item by clicking on the gear icon.
- Enter a caption for this element in the "Main" tab of the editor. This text will be displayed in the action button.
- In the "Action" drop-down, select the "Print" function.
- Specify which worksheet's print area should be turned into a PDF when the button is pressed:
- (1) by selecting the print sheet
- (2) by defining the cell in your spreadsheet that contains the sheet name of the range you want to print
- Save your changes.
- Update your app.
The hierarchy for the print area is structured as follows: 1. print area from a cell -> 2. print area selected in the drop down -> 3. print area set in the global print setting
Now you have a button in the app which generates the PDF file immediately after clicking on it.
Define the PDF file name
(1) Define the name in the element or (2) make it a dynamical name from a cell in your spreadsheet
Upload recorded data
Uploads the current app data to the server, before triggering the main action. You can later access this data via the "show change protocol" view. This is based on "allow sending calculations" functionality.
Hide and show "print as PDF" action button depending on conditions
Enter the address of the cell in the workbook whose value decides if this element is shown or not. The cell should evaluate to TRUE or FALSE.
More about the functionality can be found here: Show or Hide elements based on conditions
Comments
0 comments
Please sign in to leave a comment.