NetTalk Central

Author Topic: Creating pdf documents silently in the background  (Read 3006 times)

johncorry

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Creating pdf documents silently in the background
« on: February 15, 2013, 03:02:49 AM »
There have been a few discussion threads over the past couple of years exploring how to produce reports in pdf format silently for email attachment. No clear solution is described.

I am using SV pdf reporter and it all works well, the pdf doc is created, attached to the email and then sent. But I cant stop the document preview. If I click no preview then there is a compile error relating to  set target requests. Preview at runtime marked false either fails or if I call a result page fills the screen with HTML.

I am wondering if this is a problem with the SV pdf reporter.  My memory Bruce is that you use a different pdf maker and I am wondering if you can turn preview off with that?

Thanks
John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Creating pdf documents silently in the background
« Reply #1 on: February 15, 2013, 03:08:25 AM »
Perhaps you can post a small example of where you're at John, and i can tweak it to show what to do?

cheers
Bruce

johncorry

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Re: Creating pdf documents silently in the background
« Reply #2 on: February 15, 2013, 01:01:27 PM »
Thanks Bruce, I will work on the example. In the meantime this is  the compile error in context when the print preview is unchecked. However no procedure SetReportTarget  is being cr.eated but is when print preview is checked.

  ! Report procedure should have prototype of (<NetWebServerWorker p_web>)
  If Not p_Web &= NULL
      SELF.SetReportTarget(PDFReporter.IReportGenerator)
    self.SkipPreview = True
    ProgressWindow{prop:hide} = 1
    loc:ProgressName = p_web.GetValue('_ProgressName_')
    p_web.SetProgress(loc:ProgressName,1) ! report has started
    loc:URL = '\reports\$$$' & format(random(1,99999),@n05) &'.pdf'
    loc:PDFName = clip(p_web.site.WebFolderPath) & loc:URL
     loc:PDFName = clip(p_web.site.WebFolderPath)&'\Data\'&WQName
  End


If I delete the call it then wants to print it etc
John