NetTalk Central

Author Topic: Generate and download report with one button click  (Read 2667 times)

olu

  • Sr. Member
  • ****
  • Posts: 351
    • View Profile
    • Email
Generate and download report with one button click
« on: March 04, 2015, 12:01:27 AM »
Hi Everyone is there a way to click on a button that would create a report without preview and download it, all in one button click?

So what I mean is from the browse or form when they click get report button all this process happens and all what the user needs to do will be select where they want to save the generated pdf file.

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Generate and download report with one button click
« Reply #1 on: March 05, 2015, 10:52:54 AM »
Olu, did you call the report using NetWebPage procedure?

If yes, maybe this can help
In the Header  Routine put the following code
  ! Start of "End of Header Routine"
  ! [Priority 5000]
      p_web.ForceNoCache = 1
      p_web.HeaderDetails.ContentDisposition = 'attachment; filename="'&CLIP(p_web.SessionID) & CLOCK() & '.pdf'&'"'
      p_web.ReplyContentType =  'application/pdf'
      p_web.ReplyContentFixed = true
      packet.setvalue('')
      p_web.SetHeader200()

The file name can be whatever you want. In my case i use that name to make sure reports doesn't get mix.



[attachment deleted by admin]

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Generate and download report with one button click
« Reply #2 on: March 05, 2015, 11:19:31 AM »
An example calling the report directly asking for download. Check the MailboxesReport procedure. (Bruce example modified)

Hope it helps. Cheers @ Ura

[attachment deleted by admin]

olu

  • Sr. Member
  • ****
  • Posts: 351
    • View Profile
    • Email
Re: Generate and download report with one button click
« Reply #3 on: March 06, 2015, 02:35:07 PM »
Thank you very much Urayoan that was what i was looking for, you have just made my day.Cheers.

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Generate and download report with one button click
« Reply #4 on: March 06, 2015, 02:50:43 PM »
Your welcome olu