Print out screen content on button click

Good Morning

Staff need help

Create a screen where you would like to print it by clicking a button. I researched but I couldn't find a way that I could develop, if someone can help I am grateful

follows the screen image to be printed

Hi @Jone Berti 

Check the oml if is that you need.

Regards

Gonçalo Almeida

PrintScreen.oml


Hello

I am grateful for the answer. 

When opening this giving error in the PrintScreen module

What is the error?

Can you take a screenshot of it, please

Hello
copied and pasted only on one page

already updated the dependencies but stopped here in these errors


mvp_badge
MVP
Solution

Hi Jone,

For that you can use window.print() javascript action. Here is reference a https://www.w3schools.com/jsref/met_win_print.asp

Keep in mind that this will print complete screen so all the menu will also be visible. To avoid it you have two options:

  1. Create a separate layout in your application and use that for screen where you want the content to be printed.
  2. Use no print CSS styles for the which you want to skip printing (like menu in your case). Here is the refernece link https://stackoverflow.com/a/356123

Hi Jone,

Please check this post , it may help you,

https://www.outsystems.com/forums/discussion/35638/print-functionality-on-button-click/

Regards,

Komal

Thanks for the answer

but I can’t associate the dependencies because I’m in reactive mode.

this would serve me but I couldn't put your dependency on the reactive

https://www.outsystems.com/forge/component-overview/1414/simple-reports-pdf
mvp_badge
MVP

Hi Jone,

You can try this forge component for printing the screen content in reactive apps

https://www.outsystems.com/forge/component-overview/9761/reactive-print-pdf-button

Good Morning

this one also served me correctly both in the configuration and in the practicality of implementation

but the quality comes dull

I don't know if it's all the methods or just this one.
Guys what I managed to implement by the forge was only files that generates images from Html and passes to PDF, in other words, the quality is much lower

If anyone can help, I appreciate it.
mvp_badge
MVP
Solution

Hi Jone,

For that you can use window.print() javascript action. Here is reference a https://www.w3schools.com/jsref/met_win_print.asp

Keep in mind that this will print complete screen so all the menu will also be visible. To avoid it you have two options:

  1. Create a separate layout in your application and use that for screen where you want the content to be printed.
  2. Use no print CSS styles for the which you want to skip printing (like menu in your case). Here is the refernece link https://stackoverflow.com/a/356123

Hi @Jone Berti 

Check the oml if is that you need.

Regards

Gonçalo Almeida

PrintScreen.oml


Hello

I am grateful for the answer. 

When opening this giving error in the PrintScreen module

What is the error?

Can you take a screenshot of it, please

Hello
copied and pasted only on one page

already updated the dependencies but stopped here in these errors


Try this one.

If still has an error, please go to the service center and take a screenshot from the error

Regards

Gonçalo Almeida

PrintScreenExt.oml

Hello Gonçalo almeida

This error that is showing up here for me when trying to run after published


PrintScreen.oml


That's right I'm looking for

Thank you so much

Do you know how to tell me how to delete the button print that appears?

Hi Jone.

If you check on the example on my link I added the possibility to not print some elements that are on the screen


For that, I created a CSS class no-print and applied it to the element.

Applied to the button as well. You can check on my link.

Regards

Gonçalo Almeida

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.