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
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.
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
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.
Hi,
I have found 2 or 3 error messages that get rendered with an escaped HTML tag.
I have just:
The client web-app has:
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.<br />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.<br />Click 'Refresh' to restore client session.</div>
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.
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.
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.
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.564687177Z at Telerik.Reporting.XmlSerialization.ReportXmlSerializer.Deserialize(Stream stream)
Is this error related to the Trial version or is there anything else?
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