Telerik Forums
Reporting Forum
1 answer
237 views

I have a report that has been around for years and it only was SQL database-fed text information, one of which was an indicator result. 

I have since updated the application to include the ability to take photo of the indicator and save the binary data into the database, as well as any text response.

Now I need to update my report to show an image if there is one, or show the text response if there is no image - all in the same cell/column.

Firstly, do I just grab and send the binary data for the picturebox in the report's table, and how do I show either the image (if not null) or the text in the same cell on each row?

thanks in advance.

1 answer
848 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
703 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
146 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
324 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
131 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
147 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
375 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
150 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
228 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
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?