I'm trying to add a pie chart to a report that I've been working on and im at a loss. The chart itself is great, my problem is the Legend. Its showing the wrong column and I cant figure whats wrong with it. I have a query that returns 3 rows and two columns. The query results look something like this:
Category | Amount
--------------------------
Chats | 51
Phone calls | 379
Emails | 2602
When I create the pie chart in the report designer, all the slices are the right size and labeled with the correct percentages. However in the legend, it just has "Amount" shown as the key for each item in the legend. I want it to display the actual category, but cannot seem to get this to work. I followed the documentation listed at https://docs.telerik.com/reporting/graphhowtocreatepiechart, but it still shows "Amount" in the legend instead of the actual categories. I have attached a screenshot of the report designer to show what the pie chart looks like as of now.
I have a report being displayed properly in a 3.1 app and after switching it to net5.0 with RC-2 installed I get the attached error. Can someone perhaps point me in the right direction?
Thank you,
Scott
We are busy with a POC and we have 4 sub reports on our main reports. In each subreport there is an aggregated total in the footer that we want to return and display as a summary value in the main report header section.
Is it possible to write an expression to access the value on a text box in the sub report from the main report?
Or is there a different way to do this?
Hi folks
I'm having problem with Telerik Reporting using Angular 8. it throwing this error ERROR Error: Uncaught (in promise): Invalid clientID.
the below is how i setup viewer.
<tr-viewer #viewer1
[containerStyle]="viewerContainerStyle"
[serviceUrl]= "'http://example/api/reports'"
[templateUrl]="'/assets/template.html'"
[reportSource]="{
report: 'BillingDetails.trdx',
parameters: {}
}"
[viewMode]="'INTERACTIVE'"
[scaleMode]="'SPECIFIC'"
[scale]="1.0">
</tr-viewer>
WEB API
[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")]
[RoutePrefix("api/reports")]
protected override Telerik.Reporting.Cache.Interfaces.ICache CreateCache()
{
return CacheFactory.CreateFileCache();
}
protected override Telerik.Reporting.Services.Engine.IReportResolver CreateReportResolver()
{
string reportsPath = HttpContext.Current.Server.MapPath("~/ReportFiles");
var r = new ReportFileResolver(reportsPath).AddFallbackResolver(new ReportTypeResolver());
return r;
}
Client side is separated from webAPI, i'm making Http calls to request resources from web API. JQuery and/or Angular 8 solutions will be appreciated.
Thanks
I'm working in a ASP.net core 3.1 web application. I want to display a Report without using the report viewer as well as not embedding the datasource into the report. The data for the report will be determined at runtime. So this is what I have done so far.
Defined a report with the report designer that has just one field = Fields.Title
The report does render with the correct number of lines that I expected. However there is no data. The data object that gets assigned to the report datasource does have values. Five values from the database. It's just that the those values don't bind to the ["Fields.Title] property of the report. All I see is
Title
Title
Title
Title
Title
Here's the code
Controller Method that gets called from the GUI
public FileContentResult GetTasksReports()
{
return File(_reportService.GetTaskReport(), "application/pdf");
}
Service methods
public byte[] GetTaskReport()
{
//get data from db. This returns data
var tasks = _taskRepository.GetAllList();
//Populate a List of Classes that will serve as the Reports datasource
List<
MyTasks
> taskList = new List<
MyTasks
>();
foreach (Task t in tasks)
{
MyTasks ts = new MyTasks()
{
Title = t.Title
};
taskList.Add(ts);
};
return getReport(taskList, "TasksNoEmbeddedDS.trdp");
}
private byte[] getReport(dynamic ds, string telerikReportName)
{
string reportName = "Reports\\Tasks\\" + telerikReportName;
ReportPackager reportPackager = new ReportPackager();
Telerik.Reporting.Report report = null;
using (var sourceStream = System.IO.File.OpenRead(reportName))
{
report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream);
//assign the data to the Report Datasource
report.DataSource = ds;
}
return RenderMyReport(report);
}
private byte[] RenderMyReport(Telerik.Reporting.Report report)
{
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
InstanceReportSource instanceReportSource = new InstanceReportSource()
{
ReportDocument = report
};
var configuration = ConfigurationHelper.ResolveConfiguration(webHostEnvironment);
ReportProcessor reportProcessor = new ReportProcessor(configuration);
RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo);
return result.DocumentBytes;
}
public class MyTasks
{
public string Title;
}
Hello!
I use HTML5Viewer with Telerik.Reporting.Trial and I can't see XLS export options in viewer.
As far as I now XLS format not need third-party libraries (like OpenXML), but I installed this libraries too and add assembly redirect. It is not working.
Then I try add option programmatically in GetDocumentFormats() override method in my controller and I can see XLS option, but report return error "XLS rendering format is not available".
I readed article "Missing DOCX, XLSX, PPTX, XPS export options in viewers or "X rendering format is not available" error message", but this recommendations not help me.
Can you help me?
My JSON configuration for extention:
"extensions"
: [
{
"name"
:
"XLS"
,
"description"
:
"XLS"
,
"visible"
:
"true"
}
]
Hi,
I have a report, where the user wants to be able to filter the data based on 2 parameters. Is it possible to make those parameters optional? The point is to be able to filter the results, but to be able to see them all as well.
Example: Let's say I have parameters Location and SalesmanId. I want to be able to filter by Location to show all the Salesmen and also to be able to set Location and SalesmanId to see only sales of the particular salesman in the location.
If I use in the SqlDataSource query condition WHERE, both parameters will be required, otherwise the query won't be valid. How to make the parameters optional? - that the query will show all salesmen in all locations, if none of the parameters is set.
Thank you in advance for your help.
Radovan
Hello telerik team,
Can you help me with this, I need a reporting table to display (and group by name) some images, these images comes from my D.B and they are base64 strings, so I convert them to Image like this: Base64ToImage(myDBstring), this part works fine, but when i run it on my chsarp .net web project, the telerik reporting show me this error:
An error as occurred while proccesing PictureBox 'picture1' Could not find part of the path C:\Myproyect\MyWebSite\System.Drawing.Bitmap.
See attached image (left is a single image box and right is the table with the error)
Note 1: I already did this with a single picture box succesfully, but now i need it in a table with two columns, Name and Image.
Note 2: I Dont use paths, i use D.B base64 images and merge them with a Dataset.