or
@Html.Hidden("Report", Url.Action("Reports"))<script id="OHSTemplate" type="text/html"> <tr> <td class="formno">${formNo}</td> <td class="name">${ name }</td> <td class="online">-</td> <td data-bind="click: $parent.PrintCurrent.bind($data, fileName)" class="print"></td> </tr></script>PrintCurrent: function (file) { var Url, d; Url = $('#Report').val(); d = { fileName: file }; $.ajaxSettings.traditional = true; $.ajax({ type: "GET", url: Url, data: d, contentType: "application/json;", dataType: "json", success: function (response) { //response will give success or failure text (response.Result) } }); }public class Results { string result; public Results() { } public string Result { get { return this.result; } set { this.result = value; } } }public JsonResult Reports(string fileName) { if(fileName != null) { Results results = new Results(); List<Report> reports = new List<Report>(); //Add each Telerik report you have that you'll be searching through Report r = new Report(); r = (from c in reports where c.Name == fileName select c).FirstOrDefault(); //Configure Printer Settings System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings(); if (printerSettings.CanDuplex) { printerSettings.Duplex = System.Drawing.Printing.Duplex.Default; } printerSettings.DefaultPageSettings.Color = false; //Initialize ReportProcessor Telerik.Reporting.Processing.ReportProcessor rp = new Telerik.Reporting.Processing.ReportProcessor(); //Print Report try { rp.PrintReport(r, printerSettings); results.Result = "Print Successful"; } catch (Exception e) { results.Result = "Failed to print report because: " + e.InnerException; } return Json(results, JsonRequestBehavior.AllowGet); } return null; }Public Shared Function VoorschrijverLabels(ByVal selection As Object(), ByVal reportItem As Object) As String Dim labels As String = String.Empty Try Dim processingReport As Telerik.Reporting.Processing.Report = TryCast(reportItem, Telerik.Reporting.Processing.ReportItemBase).Report Dim report As rptDagstaat = TryCast(processingReport.ItemDefinition, rptDagstaat) Dim da As New SqlDataAdapter(report.dsVoorschrijvers.SelectCommand, report.dsVoorschrijvers.ConnectionString) Dim ds As New DataSet da.Fill(ds) For Each row As DataRow In ds.Tables(0).Rows If labels.Length > 0 Then labels += "; " If selection Is Nothing OrElse selection.Contains(row("VoorschrijverID").ToString) Then labels += row("Voorschrijver") End If Next Catch ex As Exception End Try Return labels End Function