This is a migrated thread and some comments may be shown as answers.

ReportViewer.Html5 and SendEmail

10 Answers 507 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
SSirica asked on 18 Jan 2021, 05:21 PM

For the love of god has anyone successfully used the SendMail specifically with Telerik.ReportViewer.Html5.WebForms???  I'm not talking Telerik.ReportViewer.WebForms...god knows there are 50 examples using this, but as soon as you try and use a HTML5 viewer with RenderReport the whole process goes into the waste management receptacle.  I would even be happy with code the uses a Telerik.ReportViewer.Html5.WebForms ReportViewer and saves it as a pdf.  VB.Net would be preferable, but at this point I'll take in in Klingon and convert it.  

Telerik you need to update your sample/example/demo code to include Telerik.ReportViewer.Html5.WebForms and not just Telerik.ReportViewer.WebForms casue they are NOT even close to the same.  

I can't even explain how frustrated with this process I am.  

Let me recap I'm trying to attach a report as a pdf to an email message that originates from a Telerik.ReportViewer.Html5.WebForms ReportViewer NOT Telerik.ReportViewer.WebForms.  

This ought to be good.  

10 Answers, 1 is accepted

Sort by
0
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
answered on 20 Jan 2021, 01:41 PM
I mean, you give us a way to pop up a send email form, but then have no events to associate with an action.  Would be nice to have a SendEmail event or a ItemCommand event.  Something!
0
Todor
Telerik team
answered on 21 Jan 2021, 12:39 PM

Hello SSirica,

Here are the send email-related events exposed by the Html5 Report Viewer and all its wrappers, including the Html5 WebForms viewer:

I noticed that we have missed these events in the Html5 WebForms viewer Client Events article. We will update the article.

You may also use the approach from the KB article Send Telerik Report in an E-Mail.

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
answered on 21 Jan 2021, 02:43 PM

Thank you for your response.  I had previously found these links and I'm still in Telerik limbo.  Secondly, still no working example. And like Big Foot one may or may not exist.  

How hard would it be to give the report viewer a SendMail server event?  That's what I would have done if I designed this control, because it makes sense.  Not some half baked under documented method that may or may not work depending on the phase of the moon.  It's like cars...I'm convinced that the people who design them never have to actually work on them.  If they did, they would realize that maybe the oil filter should go somewhere else.  Why this makes sense, because it's a security risk to send email from the client browser.  

Sorry if I come off as a class A jerk, but this is frustrating.  

0
Todor
Telerik team
answered on 26 Jan 2021, 09:38 AM

Hi SSirica,

Thank you for the additional feedback.

The Send Email server-side functionality is entirely up to the user implementation in the ReportControllers SendMailMessage virtual method. You may attach the PDF in this method to the email. We don't provide an example, as it will be dependent on the utilized SmptClient, and probably won't be a working one for most of our users.

Note that the Html5 WebForms viewer is a wrapper of the pure Html5 Viewer, which itself is a pure client-side widget.

We have a feature request you may want to vote for - Email Sent or Error Message.

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
answered on 26 Jan 2021, 02:38 PM

When I put in the SendMailMessage function the way it's specified in the article I get the error

function 'SendMailMessage' cannot be declared 'Overrides' because it does not override a function in a base class.

I've tried to get that to work 50 times.  All it does it make me want to smash things.  

Client events do me no good.  95% of what our programs do is server based.  Sending mail is Server based.  

I don't care about the SMTP piece of the process.  I have a email web service that handles all that.  What I want is a server event that will serve me up the report from an html5 viewer, so I can get it into a a Byte stream and attach it to something. 

Apparently my request has too many working parts, so let me dial it back.  Does and example exist of how to programmatically save a HTML5 viewer report to a PDF.  If I can traverse that I can handle the rest.  All of your examples are report viewer based, and do not use the HTML5 report viewer.  I don't care if it's a wrapper or not...it's not apples to apples.  The properties and attributes are not interchangeable.

 

0
Todor
Telerik team
answered on 29 Jan 2021, 09:01 AM

Hello SSirica,

I implemented the SendMailMessage method of the ReportsController with the test mail server from this forum post. Here is a link to a silent video that demonstrates that it works as expected.

The reports are generated by the REST Service and sent to the Html5 Viewer with the response to the corresponding request Get Document. Hence, report document creation happens server-side and it may be an overhead to get the document from the viewer for the described scenario.

If the Send Email functionality of the viewer doesn't work for you, you may generate the report in PDF programmatically with the ReportProcessor and send it to the user. An example and further details may be found in the KB article Print a report directly at the client-side without displaying it in a Viewer. You may skip the Device Info setting related to the Adobe JavaScript needed to invoke the print dialog of the browser.

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
answered on 29 Jan 2021, 02:03 PM

It would appear that my situation has no actionable answer.  All we are doing is rehashing the same crap.  It's like putting the washing machine drain hose back into the washing machine.  

One of the links you referred to has a shock wave file in it.  Shockwave's Life ended back in 2019.  That video does me no good without a DeLorean and Doc Brown. 

The link to generate the PDF programmatically I have been over 10 times.  NOWHERE on that page does it mention the HTML5 viewer and once again there is no working sample/example to be found.  

I'm abandoning this process.  Someday when we can cross breed apples and oranges to get a orangle I may re-visit this, but the easy answer is to give the report viewer a SendEmail event.  

0
Rahul
Top achievements
Rank 1
Veteran
answered on 19 Feb 2021, 12:16 PM

Finally , after getting frustrated by not getting enough information about the telerik sendMail feature through javascript and html5.,

my state of mind is getting same as yours.

0
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
answered on 19 Feb 2021, 01:06 PM
Trying to get an answer about this is worse than trying to get an answer from a politician.  No answers and nothing but double talk.  
0
Todor
Telerik team
answered on 24 Feb 2021, 05:59 AM

Hello SSirica and Rahul,

Let me clarify that the Html5 Report Viewer doesn't produce any reports. It is a client that just makes requests to the Telerik Reporting REST Service that processes and renders the report documents. The viewer only displays the reports that it receives from the service in one of the HTML5 formats. The send email functionality on the viewer side populates the mail message according to the user's requirements and sends it to the SendMailMessage method of the ReportsController, which handles the rest of the process through the SMTP client. The user specifies the desired report format from the viewer, but the report itself gets rendered and attached to the mail on the server. Therefore, when sending a report as an email attachment there are no specifics related to the Html5 Viewer other than its built-in Send Email UI. We are aware that it is not fully functional and we will improve it in our future releases.

Meanwhile, you may use the ReportProcessor to generate the reports and handle the mail sending as required server-side. An example is available in the Send Telerik Report as an email attachment code library post. Although the post is old and you may need to adapt it to work for a newer environment, the general approach hasn't changed.

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

SSirica
Top achievements
Rank 3
Iron
Iron
Iron
commented on 15 Sep 2023, 06:19 PM

2 1/2 years later and this still doesn't work.  smh
Todor
Telerik team
commented on 18 Sep 2023, 11:08 AM

Hi SSirica,

Can you specify what is not working in your scenario?

We have tests for the Send Email functionality and it works when we have a proper SendMailMessage implemented in the ReportsController.

Did you debug whether the SMTP client is properly called in your implementation of the SendMailMessage? Are there any errors thrown by the SMTP client?

Tags
General Discussions
Asked by
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
Todor
Telerik team
Rahul
Top achievements
Rank 1
Veteran
Share this question
or