NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: wvanderstek on September 29, 2009, 03:56:59 AM

Title: After generating report/pdf opening default email client
Post by: wvanderstek 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
Title: Re: After generating report/pdf opening default email client
Post by: Mike Grigsby 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.
Title: Re: After generating report/pdf opening default email client
Post by: DonRidley 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
Title: Re: After generating report/pdf opening default email client
Post by: kevin plummer 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?
Title: Re: After generating report/pdf opening default email client
Post by: DonRidley 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
Title: Re: After generating report/pdf opening default email client
Post by: kevin plummer 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.
Title: Re: After generating report/pdf opening default email client
Post by: DonRidley 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
Title: Re: After generating report/pdf opening default email client
Post by: Bruce 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
Title: Re: After generating report/pdf opening default email client
Post by: DonRidley 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
Title: Re: After generating report/pdf opening default email client
Post by: Bruce on December 14, 2011, 04:02:51 AM
myreport(p_web)
Title: Re: After generating report/pdf opening default email client
Post by: DonRidley 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
Title: Re: After generating report/pdf opening default email client
Post by: DonRidley 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
Title: Re: After generating report/pdf opening default email client
Post by: kevin plummer 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...