简体   繁体   English

打印到纸张选定的数据

[英]Print to paper selected data

I've a database (image1) and using PHPMaker i created the graphic interface (image2). 我有一个数据库(image1)并使用PHPMaker我创建了图形界面(image2)。 What i want is to add a button at the bottom of the page that will print the selected data from the selected fields (image3). 我想要的是在页面底部添加一个按钮,打印所选字段中选定的数据(图像3)。

Can anyone tell me how to do that? 谁能告诉我怎么做?
Do i have to use php code or a javascript? 我必须使用PHP代码或JavaScript吗?

在此输入图像描述在此输入图像描述在此输入图像描述

Just add a print link by echoing the following to create a "Print" link on the page 只需通过回显以下内容添加打印链接,即可在页面上创建“打印”链接

echo "<a href='#' onclick='javascript:window.print();'>Print Page</a>";

Button click will make the browser present the user with the default print dialog. 单击按钮将使浏览器向用户显示默认打印对话框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM