Telerik Forums
Reporting Forum
1 answer
1.0K+ views

I have a .NET 6 solution with a reports project that is .NET Framework 4.8 using Telerik Reporting version R1_2022_SP1_16_0_22_225.

On this line of code in the report designer, which is for a picturebox in the report

this.pictureBox1.Value = ((object)(resources.GetObject("pictureBox1.Value")))

it's throwing an exception -> 

BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.

This url indicates the problem was fixed in the Telerik Reporting R1 2021, but I am getting the exception.

BinaryFormatter serialization and deserialization are disabled within this application is thrown in .NET5 - Telerik Reporting

I've tried the workaround below but that also does not work and I still get the exception.

<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>

 

 

 

Ivan Ivanov
Telerik team
 answered on 01 Nov 2022
1 answer
737 views

Hi all,

I have a report using the designer.  I attached a JSON data source in the report, just for structure usage purposes:

{
	"Data": [
		{
			"OrganizationId": "",
			"OrganizationUuid": "",
			"ParentOrgId": "",
			"OrganizationName": " ",
			"TotalUserCount": 0,
			"TotalDeviceCount": 0,
			"LicensedUserCount": 0,
			"ExpirationDate": "",
			"hasChildren": true
		}
	]
}

When I try to inject the actual JSON data at runtime, the report is still generated with the sample data.  Here's the lines generating the JsonDataSource:

            var data = new ReportData { Data = result };
            var ds = new JsonDataSource
            {
                Source = JsonConvert.SerializeObject(data),
                DataSelector = "$.Data",
                Name = "jsonDataSource1"
            };

Then I assign the data source to the report:

                using (var sourceStream = System.IO.File.OpenRead(_path + "\\Reports\\" + myRpt.ReportName))
                {
                    var reportPackager = new ReportPackager();
                    report = (Report)reportPackager.UnpackageDocument(sourceStream);

                    var dtsrc = new ObjectDataSource();
                    dtsrc.DataSource = myRpt.GenerateReport(_parameters);  // this is the JsonDataSource from above
                    dtsrc.Name = "jsonDataSource1";
                    report.DataSource = dtsrc;
                }

When I render the report, the data is not injected, it just shows the single sample record from the designer.  If I inject the actual JSON in the designer and do a preview, the report looks correct, so my guess is that I'm not doing this correctly.  Any help would be greatly appreciated.

Regards

Dimitar
Telerik team
 answered on 31 Oct 2022
1 answer
166 views

Hi, 

I have a column in a table (textbox) which contains numbers. They can have 1 or 2 digits and from 0 to 3 decimals. For example,: 100, 10.024, 25.3 . I would like to align all numbers at the decimal seperator for a nice design. 

The only option I found is Style>TextAlign of the textBox, but this does not achieve the desired result.

Thanks in advance.  

Justin
Telerik team
 answered on 27 Oct 2022
1 answer
350 views

Hi, 

I am trying to print a 2 page document. However, only the first page is printed.

When I render the report with reportProcessor.RenderReport and write the rendered report to a PDF. This PDF has two pages, as expected . (However, the printed document is only 1 page long... )

I use the following code to print:

           PrinterSettings printerSettings = new PrinterSettings
            {
                PrinterName = printerName,
                PrintRange = PrintRange.AllPages,
                MinimumPage = 0,
                MaximumPage = 1000,
                FromPage = 0,
                PrintToFile = false
            };
            PrintController standardPrintController = new StandardPrintController();
            ReportProcessor reportProcessor = new ReportProcessor
            {
                PrintController = standardPrintController
            };
            reportProcessor.PrintReport(reportSource, printerSettings, Globals.OutputFormat);

0 answers
150 views

Hello There.

I'm trying to export data from the report viewer to pdf and excel.

The problem is in the place where in the report I have a page break I see the table in the export as a data row.

Please advise how to fix it.

Thanks a lot.

Natalia
Top achievements
Rank 1
 asked on 24 Oct 2022
1 answer
167 views

Hello There

I am using HTML5 Report Viewer and exporting the report on a button click.

 

var rv = $("#reportViewer1").data("telerik_ReportViewer");
rv.commands.export.exec("PDF");

I am getting the PDF url created in exportEnd event of the viewer. All working fine.

 

I am wondering is there a way, i can get the PDF url without exporting, because the built in export is navigating the new tab, which i don't want to go to new tab in mobile browser.

Thank you.

Lance | Senior Manager - Technical Support
Telerik team
 answered on 24 Oct 2022
1 answer
406 views

While rendering report got Error like this Error loading the report viewer's templates. (trvTemplateUrl = 'https://abcdf.com/api/reports/resources/templates/telerikReportViewerTemplate-16.0.22.225.html/').  when i try this same telerik reporting from other domain it's working only this domain it gave this error. and network it shows like CORS error. we don't know where to allow all the domain address.       In Asp.net we have this config to enable CORS          



  services.AddCors(c =>
            {
                c.AddPolicy("AllowOrigin", options => options.AllowAnyOrigin().AllowAnyHeader().WithExposedHeaders("X-total-count")); 
                c.AddPolicy("ReportingRestPolicy", corsOptions => corsOptions.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
            });



            app.UseCors("ReportingRestPolicy");
And We noticed that if i try to run domain1 with chrome and domain2 with Edge. both domains are working.  In same browser which domain i run first that works. If i try to run next domain it gives error.
1 answer
187 views
I'm calling a webservice that returns four json arrays.  Do I really have to call the webservice four times to show four tables (one from each array)?  There's no way to make one call and construct tables from the different json paths?
Todor
Telerik team
 answered on 20 Oct 2022
1 answer
251 views

Hello Team,

I am looking to build report similar to below image 1, but only lines are displayed for min, max, monthend and yearend 

 

how to fill in bar color ? any properties to set ?

image 2 is created using telerik report designer (candelstick chart)

Dimitar
Telerik team
 answered on 19 Oct 2022
1 answer
492 views

Hi,
I'm having problem when showing report when I run Telerik Reporting REST service is Docker (Linux OS). As a report viewer I use HTML5 report viewer. For serviceUrl we can set http port of current host port from the container. The problem is when we preview the demo report, it shows like this error: "Unable to get report parameters..."

You can see the Demo project from my GitHub to reproduce the problem.

Project with html5 report viewer: Tursunkhuja/Telerik-HTML5-Report-Viewer-in-UWP: Show HTML5 report viewer in UWP window (github.com)
Project with reporting service project: Tursunkhuja/Telerik-Reporting-REST-Service: Telerik Reporting REST service. Docker (Linux OS) is enabled. (github.com)

Any idea on how to run Rest Service project in Docker correctly?

FYI: If we use "IIS" to run the Rest Service project, it works fine so it will show the demo report (Barcode examples report) without any error.

 

Todor
Telerik team
 answered on 19 Oct 2022
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?