-
Printing Webview Section
hi,
Just in case you have an idea on this. I am printing a report from a web view section on a dot matrix printer but the output doesn't look like what appeared on the web view section. It seems that it's using a different font.
Does it has something to do with the lianja app builder? I hope it's not.
Thanks.
-
You do not mention how you are printing.
Dot matrix printer? What make/model of printer are you referring to?
There are a wide range of options for the print() method and printPreview().
Try saving as a pdf and printing that to check your formatting.
-
hi barry,
Yes I'm printing on a dot matrix printer model Epson LX-300+II.
I do use the printPreview() method then click on the print button to select printer and print.
-
If you are trying to print a Webview section that you have visible in the UI it will be scaled for the printer.
You need to dynamically create a Webview using createObject("Webview"), set its dimensions to match your paper size then load it with the HTML you generate for a report.
You should then be able to print correctly.
When printing a Webview you are not printing characters you are printing the graphics context so the dimensions are important to prevent scaling occurring.
Try generating the HTML, save it to a file and opening it in your web browser then printing it. Same principal.
-
What I am loading to the webview section is not a html file but a rsp file. Can I load that rsp file to the webview object?
-
Take a look at execRSP() in the documentation.
http://www.lianja.com/doc/index.php/EXECRSP()
This provides you with the ability to generate an HTML file from a .rsp file and output the HTML to a specified file.
-
Yes you can specify your .rsp file as the url property on the Webview or as described previously generate an external HTML file using execRSP() to test in a desktop browser.
http://www.lianja.com/doc/index.php/Webview
-
I forgot to mention that the .rsp file that I load to webview section already contain an HTML codes. What happens in my code is that a VFP codes inside a HTML codes.
-
Sorry I don't understand what you mean.
You can generate HTML dynamically with .rsp pages by assigning the url of the Webview with the name of the .rsp page.
-
sorry, it's look like this. VFP codes in a HTML table.
<tr>
<td> </td>
<td><%
if val_aptype = 'MA'
?artrans.attplace
else
?cmonth(artrans.attdate)+' '+str(day(artrans.attdate))+', '+str(year(artrans.attdate))
endif
%></td>
<td> </td>
<td align="right"><strong><%
?transform(artrans.atamt,'999,999,999.99')
%>
</strong></td>
</tr>