Attach a Report On Web to Email???? Xojo

Sergey Pashkov sergey_pashkov at valentina-db.com
Fri Oct 31 15:11:20 CDT 2014


Hi Richard,

But EmailAttachment.LoadFromFile loads a file by path.

I think, you should construct EmailAttachment with a contents of report,
instead of WebFile.

Something like that:

dim rep1 as VReport
rep1 = vlProject.MakeNewReport( "CEUCertificateManu",
 Session.sesWebDB.gsWConnectionStr, lsSql)

dim spdfData as String = rep1.PrintToBuffer(EVReportPrintType.kToPDF, 1)

file = new emailAttachment
*file.Data = spdfData*
*file.MIMEType =  "application/pdf"*

*file.Name = "report.pdf"*

--
Best regards,
Sergey Pashkov

On Fri, Oct 31, 2014 at 8:20 PM, Richard Albrecht <Rich at ralbrecht.net>
wrote:

> Hi,
>
> I have followed the example on the web on how to create a PDF Report and
> download it.
>
>   dim rep1 as VReport
>   rep1 = vlProject.MakeNewReport( "CEUCertificateManu",
>  Session.sesWebDB.gsWConnectionStr, lsSql)
>
>   dim spdfData as String = rep1.PrintToBuffer(EVReportPrintType.kToPDF, 1)
>
>   rep1.PrintToDisk( lfiSavePDF, EVReportPrintType.kToPDF)
>
>   mPDF = New WebFile
>   mPDF.MIMEType = "application/pdf"
>   mPDF.Filename = "report.pdf"
>   mPDF.ForceDownload = False
>   mPDF.Data = spdfData
>
>   vlProject.Close
>
>   ShowURL(mPDF.URL, True)
>
> mPDF is a Property of the form
>
> Then in another Method:
>
>   dim file as emailAttachment
>
>   file = new emailAttachment
>   file.LoadFromFile cnt1.mPDF.Download <————————-No matter what I Use I
> get an error.  Parameter not compatable.
>   Msg.Attachments.Append file
>
> No matter what property of mPDF I use I get an error.
>
>
> --Richard S Albrecht--
> 2019 Salem Rd
> Elgin, IL 60123
> 847-652-3563
>
> Skype: HawkCode
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20141031/200655f6/attachment.html>


More information about the Valentina mailing list