Telerik Forums
Reporting Forum
4 answers
12 views

I have a report designed for a continuous roll printer using a 4 inch wide paper roll.  The report is 6 inches "wide", but is printed LANDSCAPE, so the axis are flipped, meaning the printed "width" ends up as 4 inches (good) and the printed "height" is 6 inches on the continuous axis.  So far so good, Telerik renders the report and it prints, HOWEVER; I want a page footer section that prints some information at the "bottom" of the label.  When in continuous roll mode Telerik is not honoring the page footer and instead prints this immediately after the detail like a group footer, however; there is no reason why it should not honor this because the report is LANDSCAPE so even on continuous roll paper the footer can be measured against the fixed 4in "width" of the label.  I have attached an image showing what Telerik is doing and what the expected output is.

This appears to me to be a bug in Telerik reporting.

The expected behavior is that the page footer would work normally if the report is landscape because in this case the fixed label width is actually the "height" (4in) of the report and the variable/continuous axis is the "width" (6in).

Any suggestions?

- Albert Boettger

AlbertBoettger
Top achievements
Rank 1
Iron
 answered on 04 Mar 2024
1 answer
100 views

When we try to process a report from a .NET 6 application, there is an exception
 "BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information."
Version used: Telerik R1 2023 SP1

On Telerik forums, there is a workaround to suppress this error, see below:
https://www.telerik.com/forums/aspnetcore-5-support
https://docs.telerik.com/reporting/knowledge-base/binaryformatter-exception-after-upgrade-to-net5
However, based on this post the BinaryFormatter is necessary for serialization and not having it will cause issues with image generation.
Please advise if there is a way to generate reports with images from a .NET 6 app without using EnableUnsafeBinaryFormatterSerialization.

Ivan Ivanov
Telerik team
 answered on 01 Mar 2024
1 answer
31 views

Hi,

https://www.telerik.com/blogs/telerik-reporting-modern-ui-report-viewer-demo

I have followed the steps in this example and created a Reporting rest service and added the report viewer to my Blazor app. The rest service is running and I can display a report in the viewer.

I'm struggling though to retrieve the list of reports for the drop down list.  Should the rest service provide a list of files available from the endpoint "files" ?

ReportList = await HttpClient.GetFromJsonAsync<List<string>>("/api/files");

I'm currenly get a 404 error in the on intialazied  method.

Thanks

Rob

 

Momchil
Telerik team
 answered on 29 Feb 2024
1 answer
60 views

Good morning.

I wanted to address an issue we're running into while trying to post a .Net Core / Angular app with a folder of standalone reports. For some unknown reason these will work fine on my machine, I have a couple dozen built from the Telerik Reporting standalone designer, but it won't work on an Azure VM.

The need to set up an Azure VM occurred to me when I realized that I couldn't update a SQL connection for a report unless the connection returns as valid, which in this case it's a private SQL resource so they set us up with a VM to momentarily upload the reports and edit them from the same internal domain as the SQL server. The problem I'm running into now is that we get the following error, seemingly unconditoinally, from the Azure VM environment:

Connection unsuccessful. Check the connection string and try again. Details: Expecting a non-empty string for 'providerInvariantName' parameter.

That error comes back even if we add providerInvariantName to the string. Something else is clearly going on, I don't exactly know what but it seems like it's an environment issue with the Azure VM if no changes to the sql string either cause a different error or succeed.

What I'd like to ask for is more insight into what kinds of things can cause this error so we understand the problem space a bit better. Please let us know your thoughts on what we need to look at in order to troubleshoot this.

Dimitar
Telerik team
 answered on 27 Feb 2024
1 answer
25 views

Hi,

I have found 2 or 3 error messages that get rendered with an escaped HTML tag.

I have just:

  • updated my ASP.NET Core API application to .Net 7
  • updated Telerik Reporting packages to 18.0.24.130
  • removed a custom ExceptionFilterAttribute that was blocking the ReportsExceptionFilter on the ReportsControllerBase

The client web-app has:

  • jQuery: v3.5.1
  • Kendo UI: v2022.3.1109

Paying attention to the report viewer error handling while testing the changes I noticed that the "<br />" HTML tag is evident in the displayed message. HTML content:

<div class="trv-error-message" tabindex="0">Client with ID '430e860227a' not found. Expired.&lt;br /&gt;Click 'Refresh' to restore client session.</div>

The app logs:

INF | Executing ObjectResult, writing value of type 'Telerik.Reporting.Services.Engine.HttpError'.
INF | Request finished HTTP/2 GET https://localhost/reporting/api/reports/clients/430e860227a/instances/495856f7d27/documents/0ea84cac86d5cc092af7e9/pages/4 - - - 410 143 application/json;+charset=utf-8 24.0922ms

So, now the Telerik.Reporting.Services.Engine.HttpError object is returned to the client with a more appropriate status code (as opposed to previously where my filter would return a 500 reponse with a generic error message).

410 response content for the above:

{
	"message": "",
	"exceptionMessage": "Client with ID '430e860227a' not found. Expired.",
	"exceptionType": "InvalidClientException",
	"stackTrace": null
}

 

So it would appear that the report viewer is appending "<br />Click 'Refresh' to restore client session." to the "exceptionMessage" value, then escaping HTML content.

 

Additionally, the browser console shows the following error when the viewer error occurrs:


Uncaught (in promise) TypeError: de is undefined
    N 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    telerikReportViewer 		https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    promise callback*se 		https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    K 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    promise callback*jt 		https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    beginLoad 				https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    $e 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    refreshReportCore 			https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    previewReport 			https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    R 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:13
    kr 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:13
    jQuery 8
    kr 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:13
    $.fn[t.name]/< 			https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    k 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:9
    t.name 				https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    bind 				https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    k 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:9
    bind 				https://localhost/reporting/api/reports/resources/js/telerikReportViewer:10
    _ 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    Y 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    promise callback*fn/Z/</< 		https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    promise callback*fn	/Z/< 		https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    promise callback*Z 			https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    fn 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    telerikReportViewer 		https://localhost/reporting/api/reports/resources/js/telerikReportViewer:15
    k 					https://localhost/reporting/api/reports/resources/js/telerikReportViewer:9
telerikReportViewer:10:21156

 

 

It is similar for this example:

<div class="trv-error-message" tabindex="0">Error creating report instance (Report = 'App\MyReport.trdp'). Client with ID '801c66e95b6' not found. Expired.&lt;br /&gt;Click 'Refresh' to restore client session.</div>


Dimitar
Telerik team
 answered on 26 Feb 2024
1 answer
29 views

Hi Telerik team,

We are BNF Technology .INC company. We are very interesting in your Reporting tool[Report Designer + Report Viewer] solution for our web application(Angular).

Currently, we doing some POCs to check possibility to integrate your Report solution into our product.

We have our own specific(customize) requirements from our different customer. We want to make our own customization Report Viewer/Editor described as below:

1.With Designer:

- Can we customize UI items like menu, context menu, icon, show/hide allowed data components in component list etc..

- Can we add our own component(mainly its angular components) to drag-drop into Report area? Mainly we are using high-chart for chart  functionality. We had created Line,Pie,Guage chart etc in out project. We need to that component into Report area.

- Can we add our own data source type (not MySQL,... in your list)? We want make BNF source and put in data source list and allow user to select it and config data from that source to use in data components.

2. With Viewer:

- We want to control the data and allow to update report with real-time data (which we prepare in our server)

 

We also need to know about backend part for reporting tool. Is there any way or solution to use reporting tool without backend required? I.e. is any JS frame work is available or not?

If you have some example(with source code) or API document to do it, please share with us.

We may discuss more through email. Hope get your reply soon and we can go together in future.

 

Thank you very much.

Momchil
Telerik team
 answered on 22 Feb 2024
1 answer
20 views

Hi,

 

Situation :

We have a list of cheques where a user can select (more that one) and using reportviewer to print it by pressing a print button (please refer to attach image)

 

Problem :

On first print activitiy, printing is success, but if the user need to re-print or select another cheques from the list and press the print button, an error "Report instance with ID 'null' not found" will occur.

Need some advise to fixed or a workaround.

Thanks in advance.

Momchil
Telerik team
 answered on 20 Feb 2024
2 answers
47 views

Alright, this might be a long post, but I am quite confused with something. So, I have a Blazor WASM app. In here I get a list of reports using the following code:

Reports = await Http.GetFromJsonAsync<List<string>>($"{BaseAddress}/getreports") ?? new List<string>();


When I select one (because that code is in my NavMenu, I build up a list of the reports there), I then do an OnInitializedAsync and set the ReportSourceOption:
Report Viewer Code:

<div style="padding-top:10px;">
    <ReportViewer @ref ="_reportViewer1"
                       ViewerId="rv1"
                       ServiceUrl="http://localhost:59655/api/reports"
                       ReportSource="@(new ReportSourceOptions()
                              {
                                    Report = ReportName
                              })"
                       Parameters="@(new ParametersOptions { Editors = new EditorsOptions { MultiSelect = EditorType.ListView, SingleSelect = EditorType.ComboBox }})"
                       ScaleMode="@(ScaleMode.Specific)"
                       Scale="1.0"
                       EnableAccessibility="false" />
</div>


OnInitializedAsync Code:

protected override async Task OnInitializedAsync()
{
    await _reportViewer1.SetReportSourceAsync(new ReportSourceOptions
        {
            Report = ReportName
        });
}


Now, in my Blazor App I set default headers. This is important, because these headers will determine which connection string to use, as we have a Multi-Tenant system:

"DefaultHeaders": [
  {
    "Name": "TenantName",
    "Value": "TenantId"
  }
]


When I render the Report Viewer page, it hits the Reports REST service (as expected), but here is the first question I have. Why does my CustomReportSourceResolver get hit up to 6 times? Reason I am asking, is because when my CustomReportSourceResolver constructor gets hit the first time, the header with the TenantId is there. But, the second time the constructor gets hit, it is as if Telerik creates a new Http Context, which in turn clears the headers and then I do not have access to the TenantId.

Here is my CustomReportSourceResolver constructor:

private static string _tenantId;
public CustomReportSourceResolver(IConfiguration configuration, IHttpContextAccessor context)
{
    _configuration = configuration;
    _contextAccessor = context;

    if (!string.IsNullOrEmpty(_contextAccessor.HttpContext.Request.Headers["TenantId"]))
    {
        _tenantId = _contextAccessor.HttpContext.Request.Headers["TenantId"];
    }
}

I had to add the if (!string.IsNullOrEmpty) and set the static string, because the headers kept clearing, but this could cause problems if there are too many users using the report service at the same time. Well, if I am thinking quickly, because I feel like the Custom Resolver will get confused with the _tenantId. If I am wrong, please do let me know.

And then my Resolve method:

public ReportSource Resolve(string report, OperationOrigin operationOrigin, IDictionary<string, object> currentParameterValues)
{
    var tenantId = _contextAccessor.HttpContext.Request.Headers["TenantId"].ToString();

    var json = System.IO.File.ReadAllText($"{configurationsDirectory}\\database.json");

    Settings databaseSettings = JsonSerializer.Deserialize<Settings>(json);

    foreach (var tenant in databaseSettings.DatabaseSettings.TenantSettings)
    {
        if (tenant.TenantId == _tenantId)
        {
            _connectionString = tenant.ConnectionString;
        }
    }

    using (var conn = new NpgsqlConnection(_connectionString))
    {
        conn.Open();

        var sourceReportSource = new UriReportSource { Uri = $"{report}.trdp" };
        var reportSource = UpdateReportSource(sourceReportSource);

        return reportSource;
    }
}

So, as you can see, I have a var tenantId at the top, but that will ALWAYS be null, due to the headers being cleared.

Here is my Program.cs where I inject the CustomReportSourceResolver, as well as my HttpContextAccessor:

builder.Services.AddHttpContextAccessor();
builder.Services.AddScoped<IReportSourceResolver, CustomReportSourceResolver>();
builder.Services.TryAddScoped<IReportServiceConfiguration>(sp =>
    new ReportServiceConfiguration
    {
        ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
        HostAppId = "MyHostAppId",
        Storage = new FileStorage(),
        ReportSourceResolver = sp.GetService<IReportSourceResolver>()
    });

If I cannot work around the header being cleared, because I am not sure what Telerik does in the background, so I cannot confirm if they create a new Http Context each time the constructor gets hit, is there a different way I can pass through the TenantId to my CustomReportSourceResolver? I have tried using the report parameters, but that is obviously (at least I think so) used for parameters that is present in the .trdp file, so I am unable to use that. Any help would be appreciated.

I would also like to add that I am using PostgreSQL, not sure if that info is needed. And then this project is being built in .NET 7,  but I am planning on upgrading to .NET 8.

I would also like to apologise if the question I posted is stupid, as I am new to Blazor and to Telerik.

Christiaan
Top achievements
Rank 1
Iron
 answered on 20 Feb 2024
2 answers
100 views

While developing an endpoint (.NET 6 API) to export a PDF from a TRDX file ( no problems here ) I decided to publish to the test environment.

I keep getting this error :

 

2024-02-19T06:04:14.518155356Z System.MissingMethodException: Type: Telerik.Reporting.ReportSerialization.Current.ReportSerializable`1[Telerik.Reporting.Report]
2024-02-19T06:04:14.518227356Z ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
2024-02-19T06:04:14.525815894Z ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
2024-02-19T06:04:14.525839694Z ---> System.TypeInitializationException: The type initializer for 'Telerik.Reporting.Drawing.Unit' threw an exception.
2024-02-19T06:04:14.525845694Z ---> Telerik.Drawing.Contract.DrawingFactoryUnavailableException: Cannot load assembly Telerik.Drawing.Skia. Make sure it is accessible in the current application domain.
2024-02-19T06:04:14.525850094Z at Telerik.Drawing.Contract.DrawingFactory.GetFactoryBase(String factoryTypeName, String factoryAssemblyName, Boolean assemblyLoaded)
2024-02-19T06:04:14.525854594Z at Telerik.Drawing.Contract.DrawingFactory.GetSkiaInstance()
2024-02-19T06:04:14.525858494Z at Telerik.Drawing.Contract.DrawingFactory.TryResolveFromRuntime()
2024-02-19T06:04:14.525862394Z at Telerik.Drawing.Contract.DrawingFactory.ResolveDrawingFactory()
2024-02-19T06:04:14.525866094Z at Telerik.Drawing.Contract.DrawingFactory.CreateDrawingFactory()
2024-02-19T06:04:14.525869694Z at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
2024-02-19T06:04:14.525873394Z at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
2024-02-19T06:04:14.525877094Z at System.Lazy`1.CreateValue()
2024-02-19T06:04:14.525880593Z at System.Lazy`1.get_Value()
2024-02-19T06:04:14.525884293Z at Telerik.Drawing.Contract.DrawingFactory.get_Instance()
2024-02-19T06:04:14.525887893Z at Telerik.Reporting.Drawing.Unit.GetDotsPerInch()
2024-02-19T06:04:14.525891493Z at Telerik.Reporting.Drawing.Unit.ResetDpiSettings()
2024-02-19T06:04:14.525895093Z at Telerik.Reporting.Drawing.Unit..cctor()
2024-02-19T06:04:14.525898593Z --- End of inner exception stack trace ---
2024-02-19T06:04:14.525902093Z at Telerik.Reporting.Drawing.Unit.Cm(Int32 value)
2024-02-19T06:04:14.525924393Z at Telerik.Reporting.Report..ctor()
2024-02-19T06:04:14.525929493Z at System.RuntimeType.CreateInstanceOfT()
2024-02-19T06:04:14.525933093Z --- End of inner exception stack trace ---
2024-02-19T06:04:14.525936593Z at System.RuntimeType.CreateInstanceOfT()
2024-02-19T06:04:14.525940093Z at System.Activator.CreateInstance[T]()
2024-02-19T06:04:14.525943593Z at Telerik.Reporting.ReportSerialization.Current.ReportSerializable`1..ctor(IConvertersContainer converters)
2024-02-19T06:04:14.525947293Z --- End of inner exception stack trace ---
2024-02-19T06:04:14.525950893Z at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
2024-02-19T06:04:14.525954893Z at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2024-02-19T06:04:14.525959993Z at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
2024-02-19T06:04:14.525963993Z at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
2024-02-19T06:04:14.564619278Z at System.Activator.CreateInstance(Type type, Object[] args)
2024-02-19T06:04:14.564649677Z at Telerik.Reporting.Serialization.ObjectReader.CreateInstance(Type type, String name)
2024-02-19T06:04:14.564655577Z --- End of inner exception stack trace ---
2024-02-19T06:04:14.564659977Z at Telerik.Reporting.Serialization.ObjectReader.CreateInstance(Type type, String name)
2024-02-19T06:04:14.564663977Z at Telerik.Reporting.Serialization.ObjectReader.CreateInstance(Type type)
2024-02-19T06:04:14.564668077Z at Telerik.Reporting.Serialization.ObjectReader.ReadObject(Type type)
2024-02-19T06:04:14.564672077Z at Telerik.Reporting.Serialization.ObjectReader.ReadXmlElement(String name)
2024-02-19T06:04:14.564675877Z at Telerik.Reporting.Serialization.ObjectReader.Deserialize(IResourceHandler handler)
2024-02-19T06:04:14.564679577Z at Telerik.Reporting.XmlSerialization.XmlSerializerBase.Deserialize(XmlReader reader, IResourceHandler resourceHandler)
2024-02-19T06:04:14.564683477Z at Telerik.Reporting.XmlSerialization.XmlSerializerBase.Deserialize(Stream stream, IResourceHandler resourceHandler)

2024-02-19T06:04:14.564687177Z at Telerik.Reporting.XmlSerialization.ReportXmlSerializer.Deserialize(Stream stream)

 

Is this error related to the Trial version or is there anything else?

Dimitar
Telerik team
 answered on 20 Feb 2024
1 answer
18 views

Hi,
We are looking for a way to display the following data in a crosstab. The data comes from a webservice datasource.
Each row represents an object of the following JobDto class with some pre-defined properties and an array of metadata.

public class JobDto

{
    public string Id { get; set; }
    public string Name { get; set; }
    public int Number { get; set; }
    public string Type { get; set; }
    public string Status { get; set; }            
    public MetadataDto[] Metadata { get; set; } = Array.Empty<MetadataDto>();
}

public class MetadataDto
{
    public string Name { get; set; }
    public string Value { get; set; }
}

How can we display first the fixed properties as pre-defined columns, followed by each metadata item from the array as auto-generated columns? We are primarily using the Web report designer.

Kind regards,

Lennert

Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?