I followed the intructions to add reporting to a new asp.net core website from here: https://docs.telerik.com/reporting/html5-report-viewer-asp-net-core-2
I am using version 12.0.18.125 so I updated my html page to the html below.
When I launch the html page I get a popup saying: "Kendo is not loaded. Make sure that Kendo is included.
If I click ok i see an empty report.
How should I configure kendo? Where is it loading from?
I don't have a script like this: <script src="telerikReportViewer.kendo-11.2.17.913.min.js"></script>
Html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.common.min.css" rel="stylesheet" />
<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.blueopal.min.css" rel="stylesheet" />
<script src="telerikReportViewer.kendo-11.2.17.913.min.js"></script>
<script src="/api/reports/resources/js/telerikReportViewer-12.0.18.125.min.js"></script>
<style>
#reportViewer1 {
position: absolute;
left: 5px;
right: 5px;
top: 50px;
bottom: 5px;
overflow: hidden;
font-family: Verdana, Arial;
}
</style>
</head>
<body>
<div id="reportViewer1">
loading...
</div>
<script>
$(document).ready(function () {
$("#reportViewer1")
.telerik_ReportViewer({
serviceUrl: "api/reports/",
reportSource: {
//report: "Telerik.Reporting.Examples.CSharp.ReportCatalog, CSharp.ReportLibrary",
report: "Barcodes Report.trdp",
parameters: {}
},
viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
scale: 1.0,
});
});
</script>
</body>
</html>
I am following this guide -> https://docs.telerik.com/reporting/mvc-report-viewer-extension-embedding
Hi, I am new in telerik reporting and I am getting some errors.
Here is the Scenario:
I created an empty ASP .NET MVC Application and I am trying to output the reportViewer I created. This is what I selected
I chose the sample report definition.
After that it generated 3 files. A ReportsController, a trdp file and a cshtml file
1. I created a HomeController, and renamed the Action "Index" to "Reports".
2. I Renamed the cshtml file to "Reports.cshtml" and putted it under the Views/Home Folder.
3. Then I created a folder under the Controllers folder called "api" so it now looks like this Controllers/api and moved the ReportsController to that "api" folder
4. I also changed the default route action from "index" -> "reports"
Problem: Whenever I run my program, nothing shows at all. Its just an empty page. What am I doing wrong?
Note: I also posted this question here -> https://stackoverflow.com/questions/58600533/telerik-reporting-using-asp-net-mvc
Hi Admin,
Is it possible to pass the object datasource outside a report and then inside the constructor of the report there is a parameters for that datasource which will be used by the report? Is that possible using Type Resource Report? I am using asp .net MVC
also is it possible to pass an object or data table inside the TypeReportSource parameter?
something like this
public ActionResult Index()
{
var organisation = _organisationLogic.GetOrganisation();
var typeReportSource = new TypeReportSource()
{
TypeName = typeof(OrganisationReportSample).AssemblyQualifiedName
};
var sample = new Sample();
var samples = new DataTable();
samples = sample.GetReportData();
typeReportSource.Parameters.Add(new Parameter("samples", samples));
return View(typeReportSource);
}
I am passing a data table inside the Report constructor and will use it like this..
public OrganisationReportSample(DataTable samples)
{
//
// Required for telerik Reporting designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.DataSource = samples;
}
is this possible or not?
Here is my controller which I am using a instance report
public ActionResult Index()
{
//===============================================================================
var objDts = new ObjectDataSource();
objDts.DataSource = new Sample();
objDts.DataMember = "GetSample";
var orgSampleReport = new OrganisationSample();
orgSampleReport.DataSource = objDts;
var reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = orgSampleReport;
return View(reportSource);
//===============================================================================
}
and here is the logic that I am puling from
[DataObject]
public class Sample
{
public int Id { get; set; }
public string Name { get; set; }
public Sample GetSample()
{
var sample = new Sample
{
Id = 1,
Name = "Sample 1"
};
return sample;
}
}
whenever I run the program and go to the report viewers it shows "No Report"
I am trying to pass a model to the report using typeReportResource to set it as its dataSource, am I doing this wrong?
This is my Controller
public class ReportViewerController : Controller
{
private IOrganisationLogic _organisationLogic;
public ReportViewerController(IOrganisationLogic organisationLogic)
{
_organisationLogic = organisationLogic;
}
public ActionResult Index()
{
var organisation = _organisationLogic.GetOrganisation();
var typeReportSource = new TypeReportSource();
typeReportSource.TypeName = typeof(OrganisationSample).AssemblyQualifiedName;
typeReportSource.Parameters.Add(new Parameter("flag", true));
typeReportSource.Parameters.Add(new Parameter("organisation", organisation));
return View(typeReportSource);
}
}
And here is the report design that i've created...
public partial class OrganisationSample : Telerik.Reporting.Report
{
private IOrganisationLogic _organisationLogic;
public OrganisationSample(bool flag, OrganisationLogic organisation)
{
//
// Required for telerik Reporting designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
if (flag)
{
this.DataSource = organisation;
}
}
}
what is the best approach I could do? Iwant to set the objectDataSource dynamically, each report has its own objectDataSource and I just want a single viewer that can use render multiple reports.
Hi,
I have a hard time trying to configure a Graph with line series in the stand alone Report Designer.
I need a simple chart with one or more line series. The line series are Numerical on both axes (it's a temperature (X) vs value (Y) plot).
The data for the Graph will be provided at runtime.
My data source format is thus:
```
class Data
{
List<double> Temperature {g;s;}
List<double> Value {g;s}
}
```
I was able to 'import' the dll to the designer and the data source was set up correctly (I know this because I'm able to use other data sources to successfully populate other elements of the report).
----------------------------------
What I did so far?
* I inserted a new line graph into the report
* I tried setting the Category to Temperature and Value to Value in the Wizard
* I named the graph to be able to find it at runtime and set it's DataSource
* In various attempts to configure the graph I tried setting the X and Y axes of the Graph to Numerical type or X to Category and Y to Numerical (I get the legend and axes preview in the designer)
* At runtime I set the DataSource of the Graph the same way as DataSource of a Table (which works ok for the table): `((Graph)(report.Items.Find("nameOfGraph", true)[0])).DataSource = dataSourceObject;`
The problem I have is that there are no series in the generated report in the Graph while other parts of the report are populated correctly.
Could you please provide me with a walktrough of how to configure a line Graph in Report Designer with the assumption that the data will be provided at runtime?
Thanks!
I have an MVC ASP.Net 4.61 application. I have a report defined with a parameter and a filter. When I view the preview in the designer, the default parameter works fine and the report is filtered, but when I run the application and it is using RenderReport it appears that the filter is passing a null value to the query so no data is returned. If I put the parameter in a text box I see the Id. My id's are GUIDs stored in a varchar field. If I take off filtering it shows multiple records properly.
var PDFSource =
new
TypeReportSource();
PDFSource.TypeName =
typeof
(rptEmail).AssemblyQualifiedName;
PDFSource.Parameters.Add(
new
Telerik.Reporting.Parameter(
"Id"
, id));
var ReportProcessor =
new
ReportProcessor();
var result = ReportProcessor.RenderReport(
"PDF"
, PDFSource,
null
);
string
PDFPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
"App_Data"
,
"Test.pdf"
);
File.WriteAllBytes(PDFPath, result.DocumentBytes);