Telerik Forums
Reporting Forum
1 answer
315 views

Hi, I have a requirement where I need to view SSRS reports using Telerik Report Viewer. Is there any way I can achieve this? 

Here is the details of what I have so far-

1. I created a RDL report on my project and deployed it to the Server. I'm able to view that report on SSRS Report Server portal. 

2. Now I'm trying to view that report in my Blazor Webassembly application using Telerik Report Viewer. I've created a REST service for that but it is not reading reports from SSRS Reporting  Server.

 

Is there any way, I can achieve this ?

Dimitar
Telerik team
 answered on 05 Jun 2023
0 answers
70 views
I have created Blazor(.Net7) MAUI Windows application and used Telerik Reporting for Reports.


@if (SourceOptions != null)
            {
                <ReportViewer ViewerId="ReportView"
                          ServiceUrl="@ReportSetting.ReportRestServicePath"
                          ReportSource="@SourceOptions"
                          Parameters="@(new ParametersOptions { Editors = new EditorsOptions { MultiSelect = EditorType.ComboBox, SingleSelect = EditorType.ComboBox } })"
                          ScaleMode="@(ScaleMode.Specific)"
                          @ref="__refReportViewer"
                          ParametersAreaVisible=false
                          Scale="1.0" />
            }
    @code{
        [Parameter] public TerlrikReportOptions ReportSetting { get; set; }

        [Parameter] public EventCallback CloseReportDelegate { get; set; }

        private ReportSourceOptions SourceOptions;

        private ReportViewer __refReportViewer;

        public BLReportViewer()
        {
        }

        protected override Task OnParametersSetAsync()
        {
            SourceOptions = new ReportSourceOptions();
            SourceOptions.Report = ReportSetting.ReportName;
            SourceOptions.Parameters = ReportSetting.ReportParameters;
            return base.OnParametersSetAsync();
        }
}

I am using this as a separate razor component by passing some parameters from the parent razor file. but quite often the reports that we are showing on this Telerik report viewer have some issues. time to time report data are not showing, a blank page only can be seen. sometimes header and footer of the page are only showing but the content has been missed. Even if the report doesn't have any issues, some report-building errors are shown by the red color text box.

once I get this issue, always I have to close the application and open it again and reload the report. after that, any issues are not there and all are working fine. most of the time we are getting this issue when we publish a new version of the app and install it for the very first time. From my point of view, I think it should be a cache issue.

I tried to find some solution for this. but I couldn't find it, please help me to resolve it.
Buddhi
Top achievements
Rank 1
 asked on 05 Jun 2023
1 answer
82 views

We have a custom report screen that uses multiple reporting frameworks to render reports as files (typically Excel). The available reports are loaded dynamically at runtime, the user picks a report which retrieves and displays the report parameters for the users to enter values, and then the report can be rendered to the file type that they choose.

We will be creating single reports (.trdp files) and report books (.trbp files) and uploading those onto the server for use with this screen. We are currently using the R1 2023 Reporting framework. Our application is written in c# and uses .NET Framework 4.8.

I have almost everything working with the Telerik framework but cannot find anywhere to create a ReportBook object from a .trbp file. The closest I found was this forum post (https://www.telerik.com/forums/reportbook-by-path-name)and this article on Deserializing from XML (https://docs.telerik.com/reporting/embedding-reports/program-the-report-definition/serialize-report-definition-in-xml). This does not work and I assume things have totally changed given the post was over 10 years old.

Using the code below gives the exception "Data at the root level is invalid. Line 1, position 1." The .trbp file that we are attempting to load was designed using the Telerik Standalone Report Designer.

var reportBook = new Telerik.Reporting.ReportBook();

using (System.IO.FileStream stream = new System.IO.FileStream(reportPath, System.IO.FileMode.Open))
{
    Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();                    
    reportBook = (Telerik.Reporting.ReportBook)xmlSerializer.Deserialize(stream);
}

Is it possible to load a .trbp file into a ReportBook object? If so, how?

Thanks,

Jason

3 answers
184 views

Hello,

I have an WebAssembly blazor project and I am trying to display a report in a Telerik ReportViewer. I am not even sure if what i'm trying to accomplish can be done. I would like some help / idea on how I can accomplish that.

Here how my project is setup. The client side, make a call to a controller, which does some logic (go to the database, get some data) then send that data into the report. The controller return a byte[] which contains the report (in PDF format for now)

Here an example of the code in the Server Side

	[Route("api/[controller]")]
	[ApiController]
	public class ReportsController : Controller
	{
		[HttpPost("CreateReport")]
		public ActionResult CreateReport(ReportCriteria criteria)
		{
                        var datas = repo.GetData(criteria);
                         
                        var myReport = new MyOwnReport(); // instance of type Telerik.Reporting.Report
                        myReport.objDataSource.DataSource = datas;
                        myReport.txtTitleValue = "My Report Title";
                        ... // other manual operation on the report

			ReportProcessor reportProcessor = new ReportProcessor();
			InstanceReportSource instanceReportSource = new InstanceReportSource
			{
				ReportDocument = myReport 
			};

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

			return Ok(result.DocumentBytes);
		}
	}


Is there any way that, on the client side, when I receive those bytes, I put those bytes directly on a Telerik Report Viewer ? Something like this, but using ur Telerik report? (where _report is the byte[])

<embed src="@_report" style="width: 100%; height: 100%;" />

 

Any idea how I can accomplish something like that? I feel like the Telerik reporting only work when all the logic is inside the "Telerik.Reporting.Report class" but its doesnt really work with the way our report are build.

Any help or tips or direction will be apreciated

 

Thank you 

David

 
Todor
Telerik team
 answered on 11 Apr 2023
1 answer
180 views

I have tried to implement a web report designer server and i have successfully implemented using  nuget package.  Then i tried to use signed dll files to replace nuget package. I imported "Telerik.WebReportDesigner.Services.dll" and "Telerik.Reporting.Data.Schema.Provider.dll" two dll files and it gives the report designer, but reports are not loading. It keeps showing "An error has occurred. Could not load file or assembly 'Telerik.Reporting.JsonSerialization, Version=17.0.23.118, Culture=neutral, PublicKeyToken=a9d7983dfcc261be'. The system cannot find the file specified." error. What can be the reason for this. Do you have any solution?

 

Dimitar
Telerik team
 answered on 01 Mar 2023
1 answer
120 views

I have a report that I have populated programmatically with data.  The data in the detail section populates correctly.  I recently introduced a group into the report, but when I add a field (one of the detail fields) to the new group, the field is always blank.  I feel like there's some missing piece to setting the group values, but I can't find any examples online that mirror my scenario.

Here's how the report looks in the designer:

Here's the group configuration:

Here's where I'm setting the data into the table:


                        var table = report.Items.Find(pair.Key, true)[0] as Table;
                        if (table != null)
                        {
                            table.DataSource = data; // data is an List<Model>
                        }

The report doesn't actually group and the field in the group header is empty:

 

Momchil
Telerik team
 answered on 02 Feb 2023
1 answer
110 views

Hi,

Arabic reports work well on Windows, but when the app is published to Docker, the report viewer shows the correct report, but when printing or exporting PDF, the report is drawn from left to right with incorrect format and layout.

Here is an example of a Docker PDF

, but this is the correct report on the Report Viewer

Todor
Telerik team
 answered on 22 Dec 2022
1 answer
120 views
Hi. I have list of items and need to create different tables depends on item types. How i can implement this?
I added list component for items and want to create tables inside this component
Momchil
Telerik team
 answered on 08 Dec 2022
1 answer
391 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
239 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.
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?