Telerik Forums
Reporting Forum
4 answers
6.0K+ views

Hi,

I have a created a .NET Core application and I have added the Telerik reporting controller as detailed in: http://www.telerik.com/blogs/telerik-reporting-and-aspnet-core

It runs fine when I am using external tdrp reports. 

However I am keen to create a report library and use CLR type names.

Unfortunately I am getting the follow error when trying to view the report:

"Unable to get report parameters.
undefinedReport 'Aliaxis.ReportLibrary.Report1%2C%20Aliaxis.ReportLibrary' cannot be resolved."

 

My viewer report source is set as below :-

                    //ReportSource - report description
                    reportSource: { 
                        // The report can be set to a report file name
                        // or CLR type name (report class definition).
                        //report: "test.trdp",
                        report: "Aliaxis.ReportLibrary.Report1, Aliaxis.ReportLibrary",
 
                        // Parameters name value dictionary
                        parameters: {}
                    }

 

Report 1 is a blank report with a textbox in the center. Its namespace/class name is :-

 

namespace Aliaxis.ReportLibrary
{
    partial class Report1

 

Any advice on why I can't get the report to display and am getting this error?

Kind Regards,

Tom

 

AQEEL KHAN
Top achievements
Rank 1
Veteran
 answered on 10 Aug 2020
4 answers
316 views

Here is the description of my problem. It occurs when using Spring.NET dependency injection:

- Create a new Asp.NET project in C# with Visual Studio 2010 SP1.
- Add a reference to Spring.Core (version 0.0.0.40704)
- Add a new Telerik report called Report1.cs (cancel the wizard).
- Add a new Telerik report called Report2.cs (cancel the wizard).
- Compile the solution.
- Add a new class in your project named Class1.
- Add a new class in your project named Class2.
- Add a new interface named IClass2 and make Class2 implement it.
- In Class1 add the following code:

public int GetValue(Class2 myObject)
{
    return 1;
}

In the code behind of the Global.asax file add the following field and the following method:

private static IApplicationContext _applicationContext;
public static T GetInstance<T>(String objectName)
{
    return (T)_applicationContext.GetObject(objectName);
}

- Update the method Application_Start so that it looks like the following:

void Application_Start(object sender, EventArgs e)
{
    // Code that runs on application startup
    _applicationContext = ContextRegistry.GetContext();
}

- Add the required Spring namespaces in the class (Spring.Context and Spring.Context.Support).
- The configuration of Spring.NET doesn't matter here as we will see later. Actually you don't even need to configure Spring.NET
- In Report1, in the detail section add a sub-report. Set its ReportSource property to point to Report2.
- In Report2, add an ObjectDataSource.
- Set the DataSource property of the ObjectDataSource to Class1.
- Set the DataMember property of the ObjectDataSource to GetValue.
- Keep the parameter value empty.
- In the code-behind of Report2, update the constructor so that it looks like this:

public Report2()
{
    //
    // Required for telerik Reporting designer support
    //
    InitializeComponent();
    //
    // TODO: Add any constructor code after InitializeComponent call
    //
    if (!DesignMode)
    {
        IClass2 myObject = Global.GetInstance<IClass2>("Class2");
        objectDataSource1.Parameters["myObject"].Value = myObject;
    }
}

- If it is open, close the Report1 designer. Compile. Reopen the designer. You get the following errors:

- "Object reference not set to an instance of an object."
- "The variable 'report21' is either undeclared or was never assigned."

If you check the designer-generated code of Report1 you will notice that the variable report21 is correctly declared AND assigned.

Now, go back to Global.asax code-behind and update the GetInstance method so that it looks like this;

public static T GetInstance<T>(String objectName)
{
    return (T)(object)new Class2();
}

- If it is open, close the Report1 designer. Compile. Reopen the designer. It's working fine.

My understanding is that the property DesignMode does not work as expected when it is used from within a SubReport. The code in GetInstance should never be called from within the designer. The fact that I have an error when using Spring.NET (probably due to the fact that my config doesn't handle design-time mode correctly but it's another issue) means that this piece of code is actually called at design time. If I open Report2 directly, it is showing as expected.

My issue is the following: I cannot open a report that contains a subreport which constructor is used to handle parameter of type object which are retrieved through dependency injection with Spring.NET

Am I doing something wrong? Is there any fix or workaround for this issue?

Thanks a lot for your help
Katia
Telerik team
 answered on 10 Aug 2020
4 answers
395 views

Hi,

I have an issue with the row height, if table has dynamic column's width.There is the following table structure: parent table has 4 columns, the last one contains child table with images. This column can be hidden (it depends on report parameter value). In case if this column is hidden other columns' width must be changed. But there is an issue with the rows that can be written in more than 1 line in complete table - they take the same height in case if last column is hidden and text is paced in one line. Please see attached screenshot. How to remove this empty place? Also you can find report sample attached (please remove .jpg from filename). Thank you.

Neli
Telerik team
 answered on 07 Aug 2020
2 answers
221 views

Hello,

I build a Report with the standalone ReportDesigner.

The report is connected with a Ms Access database with Microsoft.ACE.OLEDB.12.0 .The datasource is "embedded".

When i launch the preview in the designer it works fine.

 

Now I want to view the report in my WpfCore app (compile in x86 mode).

I have a error :

Unable to establish a connection to the database. Please verify that your connection string is valid. In case you use a named connection string from the
application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application.
------------- InnerException -------------
Keyword not supported: 'provider'.

 

I try differents things :

- add an appsetting.

- Changing the connection string dynamically (with the sample code in the KB, which work fine with a SqlServer connection)...

- change driver by Jet4.0 driver...

And it doesn't work...  How can I make it works ??

I know that ms access is not the best database engine but i can't change it...

Guittier
Top achievements
Rank 1
 answered on 07 Aug 2020
3 answers
257 views

Hi!

Please answer:

How to display linear objects on the map, such as roads, power lines, pipelines. In your examples, only point and polygon objects are shown. We also need to show linear objects whose geographic data are represented in WKT format in the form: LINESTRING (), not POLYGON (())

It is also interesting - whether it is possible to display all types of objects(points, lines, polygons)  on the map at the same time.

Tom
Top achievements
Rank 2
 answered on 07 Aug 2020
3 answers
3.0K+ views

I have recently started using Telerik reporting my team is using ASP.net Webforms can I have implemented the  Telerik Reporting REST service as detailed here  http://docs.telerik.com/reporting/telerik-reporting-rest-conception and tested the web API which returned the json file. But when using the report viewer to call a trdp file saved on my project folder I get the following error  "Unable to get report parameters.Report 'BarcodesReport.trdp' cannot be resolved". Below is my code for the page, snippet of the error  and API controller. Any feeback is greatly appreciated

 

Report.aspx.cs

public partial class Report : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var clientReportSource = new Telerik.ReportViewer.Html5.WebForms.ReportSource();
clientReportSource.IdentifierType = IdentifierType.UriReportSource;
clientReportSource.Identifier = "BarcodesReport.trdp";
ReportViewer1.ReportSource = clientReportSource;
}

}

}

 

ReportsController.cs

public class ReportsController : ReportsControllerBase
{


static ReportServiceConfiguration configurationInstance;
static ReportsController()
{
var appPath = HttpContext.Current.Server.MapPath("~/");
var reportsPath = Path.Combine(appPath, @"..\..\..\Report");
var resolver = new ReportFileResolver(reportsPath)
.AddFallbackResolver(new ReportFileResolver());
configurationInstance = new ReportServiceConfiguration
{
HostAppId = "Application1",
Storage = new FileStorage(),
ReportResolver = resolver,
// ReportSharingTimeout = 0,
// ClientSessionTimeout = 15,
};
}
public ReportsController()
{
this.ReportServiceConfiguration = configurationInstance;
}
}

 

 

Neli
Telerik team
 answered on 07 Aug 2020
13 answers
345 views

I have a pretty simple bar chart and the first label on the X Axis is ALL. Where does this come from? It is not in the data.

 In the attached screenshot you will also see the bars are not centered above each label, why is this?

 And finally, the bars are very narrow, why is this and how can I make them wider?

Vas
Top achievements
Rank 1
Veteran
 answered on 07 Aug 2020
1 answer
486 views

Good day,

I hope you can help me as I am battling getting the report viewer that is working well in another html/javascript project.

Now converting the application to Angular (8).

This loads the report viewer fine:

  <tr-viewer #viewer1 
  [containerStyle]="viewerContainerStyle"
  [serviceUrl]="http://localhost/RepService/ReportViewer/api/reports"
  [templateUrl]="'http://localhost/RepService/ReportViewer/templates/telerikReportViewerTemplate.html'"
  [viewMode]="'INTERACTIVE'"
  [scaleMode]="'SPECIFIC'"
  [scale]="1.0"
  >
</tr-viewer>

 

But this would need to be reconfigured when deploying, so to do that, this get's the closest:

In html file:

  <tr-viewer #viewer1 
  [containerStyle]="viewerContainerStyle"
  [serviceUrl]="serviceUrl"
  [templateUrl]="'http://localhost/RepService/ReportViewer/templates/telerikReportViewerTemplate.html'"
  [viewMode]="'INTERACTIVE'"
  [scaleMode]="'SPECIFIC'"
  [scale]="1.0"
  >
</tr-viewer>

 

In .ts file:

ngAfterViewInit() {
    this.serviceUrl = "'http://localhost/RepService/api/reports/'";

 

But getting the following:

The serviceUrl is not specified.

 

When I move that line to ngOnInit:

ngOnInit() {
    this.serviceUrl = "'http://localhost/XRSReportingService/api/reports/'";

Getting: Cannot access the Reporting REST service. (serviceUrl = ''http://localhost/XRSReportingService/api/reports/''). Make sure the service address is correct and enable CORS if needed. (https://enable-cors.org)

 

So this doesn't look like a CORS issue to me.

Thanks very much

Neli
Telerik team
 answered on 06 Aug 2020
0 answers
383 views

I have created a new report and enable the ToolTip.  When the user rolls over the graph in the report.  The ToolTip comes up and shows the title and the text.  I want to add a second line to the text.  However, I can't seem to get it to work.  This is what I am doing.

I go into Visual Studio.  I select the desired graph.  Then Series - barSeries1 - ToolTip - Text.  I select to edit the expression.  I have added the following expressions and can't get the words "Encounter Count" to go on a second line.  I have tried the following expressions.

{Format('Month: {{1:MMMM yyyy}} {{0}} Encounter Count', "<br />", Fields.reportMonth)}
{Format('Month: {{1:MMMM yyyy}} {{0}} Encounter Count', "\n\r", Fields.reportMonth)}

{Format('Month: {{0:MMMM yyyy}}\nEncounter Count', Fields.reportMonth)}

Nothing seems to work. 


 

 

Rich Schone
Top achievements
Rank 1
Veteran
 asked on 06 Aug 2020
1 answer
618 views

I have recently purchased a new PC and would like to download the standalone executable for 2019 R1.

How do I do this?  Later releases introduced breaking changes which will no longer support my deployed reports.

Yana
Telerik team
 answered on 06 Aug 2020
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?