Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Printing Webview Section

  1. #1

    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.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    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.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    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.

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    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.
    Last edited by barrymavin; 2015-11-11 at 00:30.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    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?

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    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.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    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
    Last edited by barrymavin; 2015-11-11 at 01:12.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #8
    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.

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    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.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #10
    sorry, it's look like this. VFP codes in a HTML table.

    <tr>
    <td>&nbsp;</td>
    <td><%
    if val_aptype = 'MA'
    ?artrans.attplace
    else
    ?cmonth(artrans.attdate)+' '+str(day(artrans.attdate))+', '+str(year(artrans.attdate))
    endif
    %></td>
    <td>&nbsp;</td>
    <td align="right"><strong><%
    ?transform(artrans.atamt,'999,999,999.99')
    %>
    </strong></td>
    </tr>

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us