NetTalk Central

Author Topic: After generating report/pdf opening default email client  (Read 5670 times)

wvanderstek

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
After generating report/pdf opening default email client
« on: September 29, 2009, 03:56:59 AM »
Hello,

We have generated a report in PDF format and it is automatically opened. We are using the Report to PDF template.

Is it possible to send the generated PDF document as an attachment to the email client instead of viewing after generating it ?

If so, can we also send some additional text and a subject ?

Thanks,
Wilco

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: After generating report/pdf opening default email client
« Reply #1 on: September 29, 2009, 10:01:53 AM »
Yes. I think there is an example of some interface between web server and the NetTalk email, somewhere. One easy thing to do is save the file name and email address (depending on how you want to implement it) and use the NTWS example to send the email with report attached. I think you'll have to dig into the example to figure out how to do it, but it should be relatively easy.

Okay, it is example 11 from NTWS. So you'll probably want to chain together the sequence somehow. Print the report. Save the name (your should generate a unique name), then you can send it using the form, or you could jump past the form and prefill the variable in the SendEmail proc.
Mike Grigsby
Credify Systems
Central Oregon, USA

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: After generating report/pdf opening default email client
« Reply #2 on: December 13, 2011, 08:41:46 AM »
Can someone help me on this?  Right now, I do not want to open the default email client.  I would rather send the email as in NetTalk Example 11 with a PDF attachment.

Right now I can:

Create the PDF file without it being deleted (Per Bruce's instructions in another thread)

After generating the PDF, I can send the email with an attachment.

However, this is what I want....

I want the user to (in this order):
1. Click a button
2. Report's PDF file is generated (with no preview)
3. Email is sent with PDF file as attachment.

Thanks,

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: After generating report/pdf opening default email client
« Reply #3 on: December 13, 2011, 02:26:24 PM »
so how are you sending the PDF via email now?

Isn't it a matter of just copying Example 11 code and sticking it just after the report finish's?

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: After generating report/pdf opening default email client
« Reply #4 on: December 13, 2011, 04:59:09 PM »
I guess so but my report is generating and displaying.  I just want the PDF to be created and then perform the emailing process.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: After generating report/pdf opening default email client
« Reply #5 on: December 13, 2011, 06:13:18 PM »
What tool are you using to generate PDF's? There must be an option to turn off preview after the report is generated otherwise you would have the same prob serving pdf's back to the users browser.

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: After generating report/pdf opening default email client
« Reply #6 on: December 13, 2011, 06:24:10 PM »
Using SV's PDF generator. 

That was the first thing I thought of.  Turning off preview does nothing.  Matter of fact, if I uncheck the preview box, I get compile errors.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: After generating report/pdf opening default email client
« Reply #7 on: December 14, 2011, 12:04:01 AM »
So I think you're just over-thinking it Don.

a) make a button.
b) user clicks button
c) starts report procedure.
d) emails result to user

The button shouldn't "submit" it shouldn't have aURL or anything. It should be just a simple button, where you do step (c) and (d) from the normal server button embed code.

cheers
Bruce

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: After generating report/pdf opening default email client
« Reply #8 on: December 14, 2011, 03:35:13 AM »
How do I call a NetTalk enabled report procedure with normal embed code?

I get a prototype error.

That's what is holding me up now.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: After generating report/pdf opening default email client
« Reply #9 on: December 14, 2011, 04:02:51 AM »
myreport(p_web)

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: After generating report/pdf opening default email client
« Reply #10 on: December 14, 2011, 03:55:46 PM »
THANK YOU!!!!!

That did it.  The report still opens but the email is sent after that.  Sending the file as an attachment.  Pretty cool stuff!

Don
« Last Edit: December 14, 2011, 04:07:17 PM by DonRidley »
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: After generating report/pdf opening default email client
« Reply #11 on: December 14, 2011, 07:29:42 PM »
I thinking this...

The handy dandy new progress control keeps the user from viewing their report until they click on, "Click here to download file."

Maybe there's a way to modify this to email the PDF file out during the progress bar and then say, "Email Sent."  Would be pretty cool.

Just thinking out loud...  ;D

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: After generating report/pdf opening default email client
« Reply #12 on: December 14, 2011, 10:21:48 PM »
If you are emailing them, why make your clients sit watching a progress bar. Add a button, run your report and email on a worker thread and then update a message on the screen that the report is in progress and will be emailed shortly. Just a thought...