webERP Forum

Full Version: Display option along with PDF print
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,
Is it possible to add a "display" option in reports so that every time a PDF does not get downloaded.
its a good option when we just have to have a look at the reports.
Thanks
Hi, newuser990.
Why not try to build a 3rd party
PDF viewer to help with the "PDF displaying"? I suggest you select some professional PDF Toolkits whose way of processing is simple and fast to help you. It can be much more convenient. Google it and select one to have a try. I hope you success. Good luck.



Best regards,
Arron
Dear Arron,

I have a PDF viewer. I meant to say that instead of always downloading a PDF, some places it is best if it just displays on screen. Like when I just have to have a glance some category of stock, then in the "inventory Quantities" it should allow me to just view on screen rather than download a pdf and then open it.
Hi,

The best solution should be to code an html view interface for your requirements. Currently, most PDF files are set to download instead of review because the Main Menu interface will be disappear when we review PDF files in browser. And a back option is forbidden usually. Then users have to manually change the http link.
Best regards´╝ü

Exson
We could use the css media attribute so that when displayed on the screen it shows a normal webERP screen complete with header data and footer, and when displayed on a printer it hides everything but the data table. This means that with hardly any change to the code every data table that is shown in weberp becomes a printable report.

Tim
I think Tim's suggestion is good.
Or may be it can open the HTML view in a separate Tab of the browser if the Header & Footer is too much to incorporate.
I think it will be a really usefull option for a lot of users.
It's very easy to do, just change line 40 of includes/header.inc to:

echo '<link href="' . $RootPath . '/css/'. $_SESSION['Theme'] .'/default.css" media="screen" rel="stylesheet" type="text/css" />';

and immediately after it add the line

echo '<link href="' . $RootPath . '/css/default.css" media="print" rel="stylesheet" type="text/css" />';

then create the css file css/default.css where only the tables are set to visible and everything else is hidden. Then when you do a print page in your browser only the tables should get shown.

Tim
Hi, Dear all,

I think it's only workable for those which has html table. But usually, those scripts create pdf file has no html table. That means the css created have no place to apply.

Am I missing something?

Best regards!

Exson
Well using this technique we would use the same code for displaying on the screen as printing to paper, or outputting to pdf. This will make the code easier to change for people who want to amend reports, and make the generation of reports quicker to do. Seemed good to me :-) It xsimplifies the code, makes it more readable, and makes it faster. What could be better?

Tim
Dear Tim,
I tried making the changes that you mentioned but could not get it to work.
It still downloads a PDF.
Pages: 1 2
Reference URL's