I have a Visual Studio solution that contains two different projects. One is a class library that I used to create a simple report that lists users and some of their standard info. The DataSource for the report is a class with some hard coded data as a JSON string:
using Newtonsoft.Json;using System;using System.Collections.Generic;using System.ComponentModel;namespace AdventureWorksReports { public class UsersObject { public string UserId { get; set; } public string LastName { get; set; } public string FirstName { get; set; } public DateTime? LastLogin { get; set; } } [DataObject] public class Users { [DataObjectMethod(DataObjectMethodType.Select)] public static IEnumerable<UsersObject> GetUsers() { var json = <LONG-JSON-STRING>; return JsonConvert.DeserializeObject<List<UsersObject>>(json); } }}Using
the report designer I have a simple report (UsersList.cs [Design] in
the AdventureWorksReports project) that uses the above GetUsers() method
for populating the report. Nothing fancy, but it's displaying the data.
I'm
having no success getting anything to display in a second project in
the solution. This second project is a .NET MVC web application. I have a
ReportController that inherits from ApiController to serve as the
reporting server that does return the same JSON that works in the stand
alone report above:
using AdventureWorksReports;using System.Collections.Generic;using System.Web.Http;namespace WebApp.Controllers { public class ReportController : ApiController { [HttpPost] public IEnumerable<UsersObject> Post() { var users = Users.GetUsers(); return users; } }}
I feel like I have no idea how to set up the ReportViewer control in razor. I have the following, but it is obviously lacking:
@(Html.TelerikReporting().ReportViewer() .Id("reportViewer1") .ServiceUrl("~/api/report/") .TemplateUrl("~/ReportViewer/templates/telerikReportViewerTemplate.html") .ReportSource() .ViewMode(ViewMode.Interactive) .ScaleMode(ScaleMode.Specific) .Scale(1.0) .PersistSession(false) .EnableAccessibility(false) .Deferred())
Can anybody give me some clues as to what is missing at this point? It seems like none of the tutorials I've found address the situation as I'm trying to build it.
thanks
-Josh
Hi,
I have upgraded to the Telerik Reporting R2 2018 SP1 (old version: prior to r3-2016).
Now I get an exception like:
System.Security.SecurityException:
The assembly MyAssembly is not permitted to be used by an
ObjectDataSource component. Please include it in an AssemblyReferences
element in the Telerik.Reporting configuration section of your
application configuration file.
(I am using ObjectDataSource).
I have added an entry as described in https://docs.telerik.com/reporting/objectdatasource#configuration
and in https://docs.telerik.com/reporting/standalone-report-designer-extending-configuration
to my app.config.
But the exception is still thrown.
Note: the standalone designer works fine after I have added a similar entry to its config file.
Thanks in advance
Wolfgang
Hello,
I'm trying to build a chart and prepared a classes:
public class ReportIndicators
{
public Item item1 { get; set; }
public Item item2 { get; set; }
}
public class Item
{
public int value1 { get; set; }
public int value2 { get; set; }
public string itemType { get; set; }
}
In the report I return the data:
return new ReportIndicators
{
item1 = new Item
{
value1 = 10,
value2 = 15,
itemType = "type1"
},
item2 = new Item
{
value1 = 20,
value2 = 15,
itemType = "type2"
}
};
The chart looks good (chart.jpg), but the groups of columns are not centered above each label, why is this? If I'll add more items, the columns will be narrower. How I can fix that? I tried to change Scale.SpacingSlotCount property, but it did not help me.
When I built the chart, I used the item 'Add Graph Series' in the context menu on the graph and set the values as on the screen 1.jpg, 2.jpg. Is it correct?
Hello,
I would like to show negative currency values with the negative symbol instead of bracket in the telerik report. E.g. -$101.00 instead of ($203.00) or -€101.00 instead of (€101.00) - we use different currencies in the app. I set this.Culture.NumberFormat.CurrencyNegativePattern = 1; in the *.Designer.cs file. The application compiles correctly and the values show properly, but the report in the design mode has an error:
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
Do you have the information how to fix the issue?
Hello,
I'm using version Q2 2015 of Telerik Reporting and have the following need which I'm not sure how to do.
When we create a report we display it in the Reportviewer.
When we physically print it, it is printed on paper where the corporate identity is pre printed.
On the report I've included this with empty headers and footers to have room for this.
Some external clients also receive some reports in PDF or Excel.
When we save the report using the Save button the corporate identity is not displayed on the resulting document.
So, I like to have a difference in saving and printing whether the corporate identity is shown.
My thoughts now are to display the corporate identity on the report, and when printed hide the content of the headers and footers.
Is this possible, are there other options?
Thanks in advance,
Jeroen
Hello!
Please help me. I have two tables 'crosstab1'and' cross tab 2'. In them I do numbering on the lines: Row Number ('crosstab1') and Row Number ('cross tab 2'). how can I combine these two numbers into one?
Hi,
I have a report which is displayed using the the HTML5 viewer and can be exported/printed using the command buttons at the top of the viewer. Locally, under IIS Express, the report is fine and renders on a Legal size page with small margins (0.3cm and 0.4cm left/right) without overflowing to the right. However when deployed to a hosting provider the report overflows (when printing or exporting to PDF) such that the right hand parts of the report are rendered onto a new page. Its as though its picking up some settings like paper size or margins from the server rather than the report definition (trdx), is that possible? Are there any setting when rendering that are picked up from the server?

Hello
We have a problem with the page footer. In the page footer are two textboxes:
Textbox 1: ="Page " + PageNumber + " of " + PageCount
Textbox 2: © text123
When we export the report to pdf there is no problem. But when we export the report to Excel (xls or xlsx) we get the following text in our textboxes:
Textbox 1: .504 Page 1 of 34
Textbox 2: .504 © text123
We don't know what this ".504" is and how we can fix it. We have approximately 50 reports on our systems and this is the first time we have this problem.
We tried following:
- Delete the textboxes and create new one
- Use HTML text box instead of the "normal" text box
- Use single quotes (') instead of double quotes (")
Does anybody have an idea how we can fix it?
Best regards
Diego
