Telerik Forums
Reporting Forum
2 answers
376 views

After upgrading Telerik Reports from version 14.2.20.1021 to 17.0.23.118 we experience Visual Studio crashes when opening the "Expression..." 

editor after the first time.

 

Steps to reproduce:

* Open the report.

* Open the "Expression....". Loads correctly (as above)

* Close the report

* Reopen the same report

* Open the "Expression....". Visual Studio Crashes while showing the editor and shows the following:

Event Viewer shows the following:

OS and Visual Studio Versions

Microsoft Visual Studio Professional 2019 Version 16.11.27

OS : Windows 11 

 

Please advice on how to proceed.

Thanks in advance.

ChrisM
Top achievements
Rank 1
Iron
Iron
 answered on 07 Jul 2023
1 answer
339 views

I want to pass parameters tho the report using  Blazor native viewer. I found some samples with HTML viewer but the code doesn't work for the native viewer. Do you have a sample of how to implement it?

I try implementing a custom resolver but until now it is not working.

Dimitar
Telerik team
 answered on 05 Jul 2023
1 answer
309 views

Hi:

In blazor I have a list of dtos, I want to assing it to a report similar to the process in wpf. How can i Accomplish it? is posible?

I Try with a custom resolver in the server side, but I have to send the thada from the balzor layer to the custom resolver and im not sure if is a good idea.

Thanks in advance.

Dimitar
Telerik team
 answered on 05 Jul 2023
1 answer
339 views

HI,
I have a problem with Telerik Web Report Designer (17.0.23.515) as explained in the documentation I proceeded to create api service controller and the view to host the application but when I run it I get an error poup with the following message :

Could not retrieve information for folder . Warning, model validation error detected!

The error is related to:

request:
"http://localhost/NTTData/KPI/api/reportdesigner/definitionresources/folder/model?uri="
> payload: uri (is empty)
> status: Bad Request
> remote address: [::1]:80
> Referrer Policy: 'strict-origin-when-cross-origin'

response:
{
     "Message": "Warning, model validation error detected!",
     "Errors": [
         "A value is required but was not present in the request."
     ]
}

Do you have any suggestions/info to solve the problem?

P.S: I've verified that the app can read and write to the report folder.

Thank You

Dimitar
Telerik team
 answered on 05 Jul 2023
1 answer
1.8K+ views

Good afternoon, 

 

I'm trying to generate a barcode with GS and RS characters inside a barcode with no success (those are mandatory for GTL labels in VDA standard).

I've been trying to do Char(29), Chr(29), ChrW(29), (char)29, Convert.ToChar(29), ... but nothing worked me.

 

Best regards

Jorge
Top achievements
Rank 1
Iron
 answered on 05 Jul 2023
0 answers
224 views

Hello,

I am getting the following error when trying to print a report from my website:

But when in my local machine, it displays correctly. The database is the same, no changes between then.

Regards,

Alexandre

Alexandre
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 04 Jul 2023
0 answers
188 views

My report viewer was working without issue for some time until caching with DistributedSqlServerCache was implemented. It is configured as follows.

services.TryAddSingleton<IReportServiceConfiguration>(configuration =>
    new ReportServiceConfiguration {
        HostAppId = "Reports",
        ReportingEngineConfiguration = new ConfigurationBuilder().AddJsonFile(Path.Combine(configuration.GetService<IWebHostEnvironment>().ContentRootPath, "appsettings.json"), true).Build(),
        ReportSourceResolver = new UriReportSourceResolver(Path.Combine(configuration.GetService<IWebHostEnvironment>().ContentRootPath, "App_Data")).AddFallbackResolver(new TypeReportSourceResolver()),
        Storage = new MsSqlServerStorage("connection-string")
    }
);
public class ReportsController : ReportsControllerBase {
    public ReportsController(IReportServiceConfiguration reportServiceConfiguration) : base(reportServiceConfiguration) {
        reportServiceConfiguration.Storage.AcquireLock(string.Format("Lock-{0}", new Random().Next()));
    }
}

Note that the AcquireLock() method mentioned above was added in response to this comment from Telerik:

The interface also exposes a method called AcquireLock which is used from the service to enforce serialized access to all stored resources from each thread of the application and between the instances of the application in case of multi-instance environment (i.e., Web Farm)

Which I suspect may apply here, but unfortunately I can only hazard guess in light of its appalling lack of documentation.

A typical error message reported by the viewer is:

Error creating report document (Report = 'XXXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Format = 'HTML5'). An error has occurred. Object reference not set to an instance of an object.

As a workaround, I have resorted to manually configuring the report viewer, then editing a method in the javascript file, from this:
function registerDocumentAsync(format, deviceInfo, useCache, baseDocumentId, actionId) {
    throwIfNotInitialized();
    throwIfNoReportInstance();

    return client.createReportDocument(clientId, reportInstanceId, format, deviceInfo, useCache, baseDocumentId, actionId).catch(function(xhrErrorData) {
        handleRequestError(xhrErrorData, utils.stringFormat(sr.errorCreatingReportDocument, [ utils.escapeHtml(report), utils.escapeHtml(format) ]));
    });
}

to this:

function registerDocumentAsync(format, deviceInfo, useCache, baseDocumentId, actionId) {
    throwIfNotInitialized();
    throwIfNoReportInstance();

    return client.createReportDocument(clientId, reportInstanceId, format, deviceInfo, useCache, baseDocumentId, actionId).catch(function () {
        console.log("Failed to create report document. A retry has been attempted.");

        return client.createReportDocument(clientId, reportInstanceId, format, deviceInfo, useCache, baseDocumentId, actionId).catch(function (xhrErrorData) {
            handleRequestError(xhrErrorData, utils.stringFormat(sr.errorCreatingReportDocument, [utils.escapeHtml(report), utils.escapeHtml(format)]));
        });
    });
}
Up until now, the second attempt has worked every time. The odd thing is, after the workaround is applied it can continue to work for some time without failing again, even after loading a different page. Given that I cannot reproduce this issue locally, I suspect there may be a race condition happening.
Steve
Top achievements
Rank 1
 updated question on 03 Jul 2023
3 answers
176 views

Hello,

I have a report wich has one parameter. When I try to pass a new value in javascript it does not accept it, and uses the sample parameter that is inside the report.

Parameter in the Report:

Passing Parameter in Javascript:

Where 'noFichaVistoria' is the variable containing the new parameter value.

Has anyone faced this before?

Alexandre

Nikolay
Telerik team
 answered on 30 Jun 2023
2 answers
190 views

Hi i'm davide, in these days i'm working for a project that requires telerik on windows form c# desktop application.        So i'm trying to figure out what i need to do it but i don't find pretty much anything online, i can't find a solution please help me.

My little exercise consist in asking a year of school (1 to 5) to print only the ones students in that year, cvyear is a int from 0 to 5, I'M ITALIAN SO 1) ANNO = YEAR, classes is a type class, stu is a list of student. CODE:

string year = cvyear.ToString();
            var report1 = new Telerik.Reporting.Report();
            report1.DataSource = null;
            reportViewer1.ReportSource = null;
            var objectDataSource1 = new Telerik.Reporting.ObjectDataSource();
            objectDataSource1.DataSource = null;
            objectDataSource1.DataSource = classes.Stu;
            report1.DataSource = objectDataSource1;
            Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter();
            reportParameter1.Name = "yearParam";
            reportParameter1.Text = "Enter Value for year";
            reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer;
            reportParameter1.AllowBlank = false;
            reportParameter1.AllowNull = false;
            reportParameter1.Value = year;
           
            reportParameter1.Visible = true;
            
            reportParameter1.AvailableValues.DataSource = objectDataSource1;
            reportParameter1.AvailableValues.ValueMember = "= Fields.Anno";
  
            Telerik.Reporting.Filter filter1 = new Telerik.Reporting.Filter();
            filter1.Expression = "= Fields.Anno";
            filter1.Operator = Telerik.Reporting.FilterOperator.Equal;
            filter1.Value = "="+ year;
            

            Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
            reportSource.ReportDocument = report1;
            reportViewer1.ReportSource = reportSource;
            reportViewer1.ClearHistory();
            
            reportViewer1.RefreshReport();

 

Davide
Top achievements
Rank 1
Iron
 updated answer on 29 Jun 2023
1 answer
327 views

This is my scenerio.
i have report in xml stored in database, report has subreports as uri            
<UriReportSource Uri="sub_report1.trdx">

i have rest api service that consume xml , render it as pdf and returns it as byte[].
And everything works fine but my custom resolver dosnt fire.

It seems to be that when I DO NOT use telerik_ReportViewer,  resolve event doesnt invoke, am i right? My rest api service does not even inherits from Telerik ReportsControllerBase

 

my desire is when i call renderReport customResolver is invoked, i download xml for subreport (based on uri trdx) and i put them together with main report and return "As complete"

Can i configure it to achieve what i want ?

my server side code

//xDoc represents report in xml

using var tr = new StringReader(xDoc.Root.ToString());
var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
var report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(tr);

ReportProcessor reportProcessor = new ReportProcessor();
Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = report;

RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);

return result.DocumentBytes;

Dimitar
Telerik team
 answered on 28 Jun 2023
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?