Results 1 to 5 of 5

Thread: Web View - Won't open pdf viewr with variable in name

  1. #1
    Senior Member
    Join Date
    Jan 2016
    Posts
    160

    Web View - Won't open pdf viewr with variable in name

    So I am trying to save a pdf of a webview and have it opened by the default pdf viewer on the computer. The following code does this:

    cPDFfile = "invoice" + "55555fix" + ".pdf"
    owv = Lianja.get("Form_View.form").webview
    owv.print("","Portrait","PDF",cPDFfile)
    showdocument(cPDFfile)

    When I change 55555fix to a character variable, it still creates and saves the file, but no longer opens the pdf viewer.

    cPDFfile = "invoice" + cEditinvno + ".pdf"
    owv = Lianja.get("Form_View.form").webview
    owv.print("","Portrait","PDF",cPDFfile)
    showdocument(cPDFfile)

    Anyone have an idea why?

  2. #2
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,186
    Hi r,

    the cEditInvo would have to have valid filename characters: what is it's value?

    Hank

  3. #3
    Senior Member
    Join Date
    Jan 2016
    Posts
    160
    cEditinvno contains a string of numbers such as 43532. It does create a valid filename and you can open the pdf manually by clicking on the file, but it does not open it automatically like the first section of code.

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    probably has spaces in it.
    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
    Senior Member
    Join Date
    Jan 2016
    Posts
    160
    You were correct, it was leading spaces, I did an alltrim() and that solved the problem. Thanks.
    Last edited by rdd1963; 2018-01-26 at 22:28.

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