How to print

Forum to discuss the new web client version of Servoy.

How to print

Postby marco.rossi » Wed Jun 13, 2018 5:13 pm

Hi,
I would like to print a form loaded within an NGClient.

I tried to (any of those solutions work):

- to use
Code: Select all
"controller.print()"

- calling browser print by using
Code: Select all
"plugins.WebClientUtils.executeClientSideJS('window.print();');"

- to use pdf printer:
Code: Select all
var success = plugins.pdf_output.startMetaPrintJob()
   forms.showWebBrowser_ProjectsReportsDashboard.controller.print(false,true,plugins.pdf_output.getPDFPrinter())
   var pdfData = plugins.pdf_output.endMetaPrintJob()
   plugins.file.writeFile("filepdf.pdf", pdfData)


Thank you
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 54
Joined: Sun Apr 12, 2015 9:33 pm

Re: How to print

Postby mboegem » Thu Jun 14, 2018 10:57 am

Hi Marco,

printing Servoy forms is not possible anymore in NG client.
The WebClientUtils plugin you are trying to use is for the Wicket based web client, not for NG.

If you want to access the browser through Servoy, this can be done through a service web package.
But in order to get nicely styled prints/pdf's you should consider switching to either JasperReports or VelocityReports.
Both plugins can be found on https://www.servoyforge.net

Hope this helps
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1445
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: How to print

Postby marco.rossi » Thu Jun 14, 2018 7:39 pm

Hi Marc,
thank you for your reply.

We are actually using the smart-client in which there is a JFXPanel that shows a Dashboard based on a report loaded within a JasperReportServer (please take a look to the attachment).
We are able to print the dashboard when we are on the Smart Client but we would move the solution on NGClient.

JasperServer has it's own exporter but we disabled it's toolbar.

I should be able to call a URL that generates a pdf of the report but I don't know how to do that within the NGClient.
The URL is something like that: "http://localhost:9090/jasperserver-pro/flow.html/flowFile/report.pdf".
Calling this URL within the same session I should be able to get a pdf ready to be print.

Thank you
You do not have the required permissions to view the files attached to this post.
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 54
Joined: Sun Apr 12, 2015 9:33 pm

Re: How to print

Postby mboegem » Thu Jun 14, 2018 11:05 pm

Hi Marco,

in NGClient you can download ready-to-go webpackage components/services and servoy modules.
In developer you just right click on the webpackage node and select 'download with web packagemanager'.

One of the ready-to-go webpackage components is a pdfViewer which uses PDF.js in the background.
You just drag and drop the component onto your form, specify the URL and off you go.

If you want to do more fancy stuff there's a ton of other possibilities, which is relatively easy to achieve while building your own components and services.

Hope this helps so far.
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1445
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: How to print

Postby marco.rossi » Fri Jun 15, 2018 10:45 am

Hi Marc,
thank you for this information.

I'll start following your suggestion.

Best regards and thank you for your time.

Marco
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 54
Joined: Sun Apr 12, 2015 9:33 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 5 guests

cron