Email reports - batch operation

Stimulsoft Reports.WEB discussion
Post Reply
JohnW
Posts: 103
Joined: Mon Nov 20, 2017 8:29 pm

Email reports - batch operation

Post by JohnW »

I have a customer who wants to email back completed work product to customers. In this case licenses to applicants. There may be a few hundred emails to send each day to different email addresses. The email information exists in the database used to create the report.

Has anyone implemented this in an ASP.net solution using WebForms? I see some mention of how to code under MVC but not Web in the Programming Reference. I have also not seen any discussion on the forum in this category area.

Please feel to point me to a reference or offer any suggestions as how to approach a solution for this requirement

Thanks,

John W.
JohnW
Posts: 103
Joined: Mon Nov 20, 2017 8:29 pm

Re: Email reports - batch operation

Post by JohnW »

Update
I am trying to set some basic code to send a compiled report via email. Part of the issue is the namespaces, I am still learning them. I am not confident this code is anywhere near correct. If someone with more experience using Stimulsoft could take a look and suggest changes. Some of the code is just place holders. Any suggestion is useful.

Code: Select all

  Dim report As New Stimulsoft.Report.StiReport
        report = New StiReport

        report.Load("")
        report.Compile()
        report.Render()


        Dim opt As New Stimulsoft.Report.Web.StiEmailOptions
        opt.AddressFrom = ""
        opt.AddressFrom = ""
        opt.Subject = ""


        Dim strm As New MemoryStream

        report.ExportDocument(StiExportFormat.Pdf, strm)
        strm.Seek(0, SeekOrigin.Begin)

        Dim newMail As New System.Net.Mail.Attachment(Server.MapPath("filepath"))
JohnW
Posts: 103
Joined: Mon Nov 20, 2017 8:29 pm

Re: Email reports - batch operation

Post by JohnW »

I have sorted out the coding issues. I posted how that was resolved in the other thread.

I am still curious if anyone has schemed out the logic to deal with a report that may have many pages and send each page to a different email address via code. I have multiple licenses issued by date in a single report. So each page in the batch report is a license for a different entity. The customer would like the software I am creating to send each page to the correct recipient via email. This would be done by somehow matching the email in the database to the correct generated report.

I am open to any suggestions about how to logically do it.


Thanks
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Email reports - batch operation

Post by HighAley »

Hello.

There is a PageRange export setting in the StiPdfExportSettings.
You could use next method to export the selected pages only.

Code: Select all

public void ExportDocument(Stimulsoft.Report.StiExportFormat exportFormat, System.IO.Stream stream, Stimulsoft.Report.Export.StiExportSettings settings)
Thank you.
Post Reply