@(Html.TelerikReporting().ReportViewer() // Each report viewer must have an id - it will be used by the initialization script // to find the element and initialize the report viewer. .Id("reportViewer1") // The URL of the service which will serve reports. // The URL corresponds to the name of the controller class (ReportsController). // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html. .ServiceUrl(Url.Content("~/api/reports")) // The URL for custom report viewer template. The template can be edited - // new functionalities can be added and unneeded ones can be removed. // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html. // .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-11.0.17.406.html")) // Strongly typed ReportSource - TypeReportSource or UriReportSource. .ReportSource(new TypeReportSource() { TypeName = "WebApplication2.Report.Report1, WebApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" }) // Specifies whether the viewer is in interactive or print preview mode. // PrintPreview - Displays the paginated report as if it is printed on paper. Interactivity is not enabled. // Interactive - Displays the report in its original width and height with no paging. Additionally interactivity is enabled. .ViewMode(ViewMode.Interactive) // Sets the scale mode of the viewer. // Three modes exist currently: // FitPage - The whole report will fit on the page (will zoom in or out), regardless of its width and height. // FitPageWidth - The report will be zoomed in or out so that the width of the screen and the width of the report match. // Specific - Uses the scale to zoom in and out the report. .ScaleMode(ScaleMode.Specific) // Zoom in and out the report using the scale // 1.0 is equal to 100%, i.e. the original size of the report .Scale(1.0) // Sets whether the viewer’s client session to be persisted between the page’s refreshes(ex. postback). // The session is stored in the browser’s sessionStorage and is available for the duration of the page session. .PersistSession(false) // Sets the print mode of the viewer. .PrintMode(PrintMode.AutoSelect) .ClientEvents( events => events .PrintBegin("PrintRepo") ) )
using above code to host report in .cshtml
I need to access client side api in javascript.
var viewer = <%=ReportViewer1.ClientID%> // Not able to access reportViewer object in .cshtml
<script type="text/javascript">
function PrintRepo() {
PrintDocument(); //if I get the access of reportViewer, then I can use PrintDocument() function
}
</script>
Any help is appreciated. Thanks

I have multiple reports created in Report Designer with the same error condition. Each has one or more report parameters that have an entity datasource (sql server stored procedure) and set to multivalue=true and set to null=yes and have no initial value set. These are passed as arguments to the stored procedure for the main datasource. Having no selections is a valid condition.
When run through our web application, when the report initially displays each of those multi-select parameters it displays the "Please input a valid value" error message. Usually when this happens, the report engine pauses, additionally displays the "Please input valid data for all parameters" message as well, then waits for more user input.
However this is not happening: the "Please input..." message is not being displayed, and the report jumps right in and does an initial rendering to the web page. This indicates it thinks it does not have any invalid parameters. Yet, the Preview button is not clickable indicating it thinks there are invalid parameters. Very confusing.
The work-arounds include:
1) Select one item in the parameter list, then un-select it. Now the Preview button works.
2) In report designer, force an initial selection of one item in the report parameter.
3) In report designer, change the report parameter to be single value instead of multi value.
4) In report designer, run the report in preview mode - it runs fine with no error messages.
None of these are good solutions of course. So I need to know how to suppress the seemingly erroneous parameter errors.
Telerik 11.0.17.118 Windows 10 VS 2015 SQL Server 2016. This happens when running locally through VS as well as when deployed to a separate server.
Thanks.
I need to create a graph with a huge information everyday (data created every 5 seconds). The problem is, there is too many record rendered on the graph and it's hard to see (as image attached below). Is there any possible way to group the x-axis (datetime) to show as interval for every hour and every record still plot on the graph.
Thank you.
I have a main report having subreport whose reportsource has to be set dynamically based on the field value (Response type) of the sqldatasource of mainreport ,
I tried to get the value of Responsetype from the dataobject in detail_itemdatabinding event and stored in a variable .
I subreport_itendataBinding event tried to set Telerik.Reporting.SubReport.reportsource to new object of TypeReportSource class, then invalidcastexception is ocurring
Unable to cast object of type 'Telerik.Reporting.Processing.SubReport' to type 'Telerik.Reporting.SubReport
'Telerik.Reporting.Processing.SubReport does not have REportsource property so i used Telerik.Reporting.SubReport, but exception is happening
Kindly assist on this issue
public partial class InterviewReport : Telerik.Reporting.Report
{
protected string reportSourceValue = "";
public InterviewReport()
{
//
// Required for telerik Reporting designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
private void detail_ItemDataBinding(object sender, System.EventArgs e)
{
Telerik.Reporting.Processing.DetailSection item =
(Telerik.Reporting.Processing.DetailSection)sender;
object o = item.DataObject["ResponseType"];
if (o is string)
{
if (string.Equals(o, "Text Response"))
{
this.reportSourceValue = "ReportLibrary.Reports.Response, ReportLibrary, Version=1.0.0.0, Culture=neutral, " +
"PublicKeyToken=null";
}
else if (string.Equals(o, "Check Box"))
{
this.reportSourceValue = "ReportLibrary.Reports.ReportCheckBox, ReportLibrary, Version=1.0.0.0, Culture=neutral, " +
"PublicKeyToken=null";
}
}
}
private void subReport1_ItemDataBound(object sender, System.EventArgs e)
{
// Telerik.Reporting.Processing.ReportItemBase item =
// (Telerik.Reporting.Processing.ReportItemBase)sender;
Telerik.Reporting.SubReport sub = (Telerik.Reporting.SubReport)sender;
Telerik.Reporting.TypeReportSource typeReportSource2 = new Telerik.Reporting.TypeReportSource();
typeReportSource2.Parameters.Add(new Telerik.Reporting.Parameter("LocalEngID", "= Parameters.LocalEngID.Value"));
typeReportSource2.Parameters.Add(new Telerik.Reporting.Parameter("InterviewQuestionsID", "=Fields.InterviewQuestionsID"));
typeReportSource2.TypeName = reportSourceValue;
sub.ReportSource = typeReportSource2;
}
}
Regards,
Mary Jain
Greetings!
I need help with receiving parameters from a report. The following code allows me to alter the DataSource of such Report, however I still need to intercept and alter the parameters used on that report.
01.public Telerik.Reporting.ReportSource Resolve(string report)02. {03. ReportSource reportInstance;04. 05. //retrieve an instance of the report06. var connectionString = "Data Source=OurServer;Initial Catalog=OurDataBase;User ID=xxxxxxxx;xxxxxxx;";07. ReportConnectionStringManager csm = new ReportConnectionStringManager(connectionString);08. 09. var appPath = HttpContext.Current.Server.MapPath("~/");10. var reportsPath = Path.Combine(appPath, "Reports");11. var uri = Path.Combine(reportsPath, report);12. 13. var sourceReportSource = new UriReportSource() { Uri = uri };14. 15. reportInstance = csm.UpdateReportSource(sourceReportSource);16. 17. return reportInstance;18. }Is it possible to receive and modify parameters from the report call utilizing HttpContext.Current ? Or is there a Telerik Class/Method that allows me to do so?
Thanks in advance! Best Regards.
I'm developing a WPF application, using Visual Studio 2017 Community and SQL Server 2.016. The version of the report generator is R2 2017 11.1.17.503
The strange thing is that the data appears when the DataSource is configured. However, when you run Preview, the detail line data is invisible.
My stored procedure uses a temporary table and creates the SQL command dynamically.
Could someone please help?
