How can a user Print a View

I want the option for a user to print a view of a record in the database. They have to be logged in under a certain role to be able to use the feature.

How can I do this?

1 Like

Hi @franciscolora0524,

By print a view, what do you mean? Create a PDF of your WeWeb app?

Well, i have a view of some entries. Ideally, I’d like to add it to a CSV or EXcel table and print it.

If not, I can do the PDF. How can I make that view?

For the CSV, you can use our CSV plugin. You can download data as a CSV

Hmm thinking about it again, PDF seems to be the better option. Can I use the PDF element to print the current page?

Just bumping this.

To reiterate, how can I generate a PDF based on the information on the screen the user is viewing?

Hi, to create a PDF, you will need javascript with the function window.print()

It will create a PDF will all your page

Nice, it worked! Thanks for the help!

What happens if I want to make printing the page a paid version? WOuld I have to disable that normal print method somehow? I’m concerned that someone can just go in and print the page normally, as they would with any other site. I want to disable that until they’re a paying member.

You can disable your button / workflow where you add this action for no paid user. But, it’s impossible to prevent user to open the dev tool and enter JS

I try to target a table or section for printing.
I tried with a getElementById, also “Context => Current page=>section[1] and/or => uid”. I still get the same result, i.e. the whole page…
Any ideas?
@Mael