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

Send ReportViewer result to mail

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
JOSE
Top achievements
Rank 1
JOSE asked on 09 Aug 2018, 02:28 PM

Hi, I'm too newer in Telerik Reporting, and I not have idea to when make a ReportViewer or Telerik.Reporting.Report, I have an example works fine, is a report with 2 parameter, and I can see it on screen or sent to printer, now I want to sent it to user mail, without interaction of user, how I can do this? I'm work in WPF with VS2013,  annexed my code:

 

in XAML:
<tr:ReportViewer Name="ReportViewer1" Width="800" Height="500" >
    <tr:ReportViewer.ReportSource>
        <telerikReporting:TypeReportSource TypeName="ReportLibrary, ReportLibrary" />
    </tr:ReportViewer.ReportSource>
</tr:ReportViewer>
in .cs:
var TRS = new TypeReportSource();
TRS.TypeName = typeof(pgoRelacionCobranza).AssemblyQualifiedName;
ReportViewer1.ReportSource = TRS;

FechaIni = dpFechaIni.SelectedDate.Value.Day.ToString() +"/" + dpFechaIni.SelectedDate.Value.Month.ToString() + "/" + dpFechaIni.SelectedDate.Value.Year.ToString();
FechaFin = dpFechaFin.SelectedDate.Value.Day.ToString() + "/" + dpFechaFin.SelectedDate.Value.Month.ToString() + "/" + dpFechaFin.SelectedDate.Value.Year.ToString();
               
var TRS = new TypeReportSource();
TRS.TypeName = typeof(pgoRelacionCobranza).AssemblyQualifiedName;
TRS.Parameters.Add(new Telerik.Reporting.Parameter("pFechaIni", FechaIni));
TRS.Parameters.Add(new Telerik.Reporting.Parameter("pFechaFin", FechaFin));
ReportViewer1.ReportSource = TRS;
if (rbPantalla.IsChecked == true)
{
    ReportViewer1.RefreshReport();
    stkReportView.Visibility = System.Windows.Visibility.Visible;
}
else
{
    System.Windows.Forms.PrintDialog printDlg = new System.Windows.Forms.PrintDialog();
    printDlg.AllowSomePages = true;
    printDlg.AllowCurrentPage = false;
    printDlg.UseEXDialog = true;
    DialogResult result = printDlg.ShowDialog();
    // If the result is OK then print the document.
    if (result == DialogResult.OK)
    {
        ReportProcessor reportProcessor = new ReportProcessor();
        reportProcessor.PrintReport(TRS, printDlg.PrinterSettings);
    }
}

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 14 Aug 2018, 07:04 AM
Hello Jose,

We have available KB article on how to Send Telerik Report in an E-Mail. The goal of the KB is to provide one possible solution to implement emailing of reports, and help get the project started. 
As a side note, emailing the report from the report viewers is part of Telerik Reporting Roadmap for the upcoming release (R3 2018 Sep)

Regards,
Silviya
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
JOSE
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or