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
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.
Comments
2 comments
Hi Damian, thanks for your help article.
I recently had some problems with the printsheet function. I could not get it work.
Then I realized that when I made the page names in the App, some of the page names I made were different from the spreadsheet names
Hi,
I Need to define two different sheets as print in two pages in same app have provided print buttons on both pages, Have tried changing xml but not done.
Please help.
Please sign in to leave a comment.