Telerik Forums
Reporting Forum
0 answers
167 views

After going through the many posts and examples I finally pieced together a functional MailReport function which I call from an UI for ASP.NET AJAX web application.  It is interesting to note the many ways of the process not working.

using System.IO;
using System.Net;
using System.Net.Mail;
using Telerik.Reporting.Processing;
 
 
        void MailReport(Telerik.Reporting.Report report, string from, string to, string subject, string body)
        {
            string extension = "pdf";
  
            System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
 
            Telerik.Reporting.TypeReportSource typeReportSource =
                         new Telerik.Reporting.TypeReportSource();
            String smptHost = SMTPSender; //set this to your SMTP sender service host
             
            typeReportSource.TypeName = typeof(IRReport.IRReport).AssemblyQualifiedName;
            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", typeReportSource, deviceInfo);
            string fileName = result.DocumentName + "." + result.Extension;
            MemoryStream ms = new MemoryStream();
            ms.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            ms.Position = 0;
            Attachment attachment = new Attachment(ms, report.Name + "." + extension);
            MailMessage msg = new MailMessage(from, to, subject, body);
            msg.Attachments.Add(attachment);
            SmtpClient client = new SmtpClient(smptHost);
            client.Send(msg);
        }

Phil
Top achievements
Rank 1
 asked on 07 Jul 2015
3 answers
505 views
Good morning, I was trying to split page-2 and put some content in page 1, i set keep together to false, but its not working . Does anyone have some idea ? Thx.
Stef
Telerik team
 answered on 07 Jul 2015
4 answers
116 views

how make a customize style for table and give it a class name.

how can add new style to table wizard like normal..,

Stef
Telerik team
 answered on 07 Jul 2015
1 answer
259 views

Hi

anyone able to make reportviewer work with angularjs?

any samples for telerik report viewer for angularjs app (.net mvc/angularjs)

we need to display report along with chart(s) and ability to drill

thanks in advance

 

 

Stef
Telerik team
 answered on 07 Jul 2015
1 answer
131 views

Let me try to explain:

I have a main report , let say: "Main sales report" -this report recieve a parameter that is the seller's name as a string- and I also have (inside de main report) a subreport with some totals and also with the parameter.field with the "name of the seller" so he can sign the report .

My problema is this: when the main report does not have data also the subreport does NOT display anything (of course the subreport query does not has data also) but at least I need the name of the seller (that I'm passing as parameter) displayed in the subreport -so the seller could "sign" the report (even when the report is empty).

Any help will be highly appreciated

 

David .

Nasko
Telerik team
 answered on 07 Jul 2015
9 answers
482 views

Hi,

 I'm setting the connection string dynamically through the Resolve method, but I also need to access the actual report parameter values.  It seems that this is impossible as the way to do it is through the NeedDataSource handler, but that is not called as the data source has already been set by the code that sets up the connection string.  Is there a way to do this?

Stef
Telerik team
 answered on 07 Jul 2015
1 answer
96 views

Hi there,

The demo's on this page: http://demos.telerik.com/reporting/population-density/html5demo.aspx don't work with Internet Explorer and Firefox. Is this a general problem in the newest version or is it a demo problem?

Thanks.

Stef
Telerik team
 answered on 06 Jul 2015
1 answer
75 views

Hi all,

Is there any way of knowing when the <select all> item is selected from a dropdown.

Reason being, I was task to display a certain note when the <select all> item is selected otherwise it will display a different note on the report.

 

Any help will be much appreciated

 

Nasko
Telerik team
 answered on 06 Jul 2015
1 answer
384 views

I'm currently trying to convert some reporting services .rdl's to an equivalent telerik one and have come across a key difference that looks like it should be a common problem but a search across the forum turned up nothing:

 

In my original report, I have 2 datasources, A and B. Within one field, its value is SUM(A.Fixed) + SUM(B.Cost) however I cannot see how to recreate this within report designer as you can only have one connected datasource to reference at a time.

Nasko
Telerik team
 answered on 06 Jul 2015
3 answers
177 views

Hello,

here are two views from the same report: one with the WPF print preview and one from the PDF generated from the same report.

As you can see, the PDF is correct: it has the winning teams marked in bold, but the print preview doesn't show the bold.

Stef
Telerik team
 answered on 06 Jul 2015
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?