Telerik Forums
Reporting Forum
3 answers
166 views

I have a report being displayed properly in a 3.1 app and after switching it to net5.0 with RC-2 installed I get the attached error. Can someone perhaps point me in the right direction?

 

Thank you,

Scott

Silviya
Telerik team
 answered on 20 Oct 2020
1 answer
437 views

We are busy with a POC and we have 4 sub reports on our main reports. In each subreport there is an aggregated total in the footer that we want to return and display as a summary value in the main report header section.

 

Is it possible to write an expression to access the value on a text box in the sub report from the main report?

 

Or is there a different way to do this?

Nasko
Telerik team
 answered on 19 Oct 2020
9 answers
2.3K+ views

Hi folks 

I'm having problem with Telerik Reporting using Angular 8. it throwing this error ERROR Error: Uncaught (in promise): Invalid clientID. 

the below is how i setup viewer.

<tr-viewer #viewer1
    [containerStyle]="viewerContainerStyle"
    [serviceUrl]= "'http://example/api/reports'"
    [templateUrl]="'/assets/template.html'"
    [reportSource]="{
        report: 'BillingDetails.trdx',
        parameters: {}
    }"
    [viewMode]="'INTERACTIVE'"
    [scaleMode]="'SPECIFIC'"
    [scale]="1.0">
</tr-viewer>

 

WEB API 

 [EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")]
 [RoutePrefix("api/reports")]

        protected override Telerik.Reporting.Cache.Interfaces.ICache CreateCache()
        {
            return CacheFactory.CreateFileCache();
        }

        protected override Telerik.Reporting.Services.Engine.IReportResolver CreateReportResolver()
        {
            string reportsPath = HttpContext.Current.Server.MapPath("~/ReportFiles");

            var r = new ReportFileResolver(reportsPath).AddFallbackResolver(new ReportTypeResolver());

            return r;
        }
    

Client side is separated from webAPI, i'm making Http calls to request resources from web API. JQuery and/or Angular 8 solutions will be appreciated. 

Thanks

 

Todor
Telerik team
 answered on 15 Oct 2020
2 answers
438 views

I'm working in a ASP.net core 3.1 web application. I want to display a Report without using the report viewer as well as not embedding the datasource into the report. The data for the report will be determined at runtime. So this is what I have done so far.

Defined a report with the report designer that has just one field                    = Fields.Title

The report does render with the correct number of lines that I expected. However there is no data.  The data object that gets assigned to the report datasource does have values.  Five values from the database.  It's just that the those values don't  bind to the ["Fields.Title] property of the report. All I see is 

Title
Title
Title
Title
Title

Here's the code

Controller Method that gets called from the GUI
 
 public FileContentResult GetTasksReports()
        {
            return File(_reportService.GetTaskReport(), "application/pdf");
        }
 
 
Service methods
 
 
public byte[] GetTaskReport()
{
          //get data from db. This returns data
           var tasks = _taskRepository.GetAllList();
 
            //Populate a List of Classes that will serve as the Reports datasource
            List<MyTasks> taskList = new List<MyTasks>();
            foreach (Task t in tasks)
            {
                MyTasks ts = new MyTasks()
                {
                    Title = t.Title
                };
                taskList.Add(ts);
            };          
 
            return getReport(taskList, "TasksNoEmbeddedDS.trdp");
        }
         
 private byte[] getReport(dynamic ds, string telerikReportName)
        {
            string reportName = "Reports\\Tasks\\" + telerikReportName;
 
            ReportPackager reportPackager = new ReportPackager();
            Telerik.Reporting.Report report = null;
            using (var sourceStream = System.IO.File.OpenRead(reportName))
            {
                 
                report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream);
 
                //assign the data to the Report Datasource
                report.DataSource = ds;
            }
 
            return RenderMyReport(report);
 }
 
        private byte[] RenderMyReport(Telerik.Reporting.Report report)
        {  
            System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
 
            InstanceReportSource instanceReportSource = new InstanceReportSource()
            {
                ReportDocument = report
            };
 
            var configuration = ConfigurationHelper.ResolveConfiguration(webHostEnvironment);
            ReportProcessor reportProcessor = new ReportProcessor(configuration);
            RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo);
 
            return result.DocumentBytes;
        }
 
 
 public class MyTasks
  {  
  public string Title;
 }      

 

 

 

Jeff
Top achievements
Rank 1
Veteran
 answered on 12 Oct 2020
1 answer
631 views

Hello!
I use HTML5Viewer with Telerik.Reporting.Trial and  I can't see XLS export options in viewer.

As far as I now XLS format not need third-party libraries (like OpenXML), but I installed this libraries too and add assembly redirect. It is not working.
Then I try add option programmatically in GetDocumentFormats() override method in my controller and I can see XLS option, but report return error "XLS rendering format is not available".
I readed article "Missing DOCX, XLSX, PPTX, XPS export options in viewers or "X rendering format is not available" error message", but this recommendations not help me.
Can you help me?
My JSON configuration for extention:

"extensions": [
  {
    "name": "XLS",
    "description": "XLS",
    "visible": "true"
  }
]
Neli
Telerik team
 answered on 12 Oct 2020
3 answers
487 views

Hi,

I have a report, where the user wants to be able to filter the data based on 2 parameters. Is it possible to make those parameters optional? The point is to be able to filter the results, but to be able to see them all as well.

Example: Let's say I have parameters Location and SalesmanId. I want to be able to filter by Location to show all the Salesmen and also to be able to set Location and SalesmanId to see only sales of the particular salesman in the location.
If I use in the SqlDataSource query condition WHERE, both parameters will be required, otherwise the query won't be valid. How to make the parameters optional? - that the query will show all salesmen in all locations, if none of the parameters is set.

Thank you in advance for your help.

Radovan

Todor
Telerik team
 answered on 09 Oct 2020
3 answers
921 views

Hello telerik team,

Can you help me with this, I need a reporting table to display (and group by name) some images, these images comes from my D.B and they are base64 strings, so I convert them to Image like this: Base64ToImage(myDBstring), this part works fine, but when i run it on my chsarp .net web project, the telerik reporting show me this error: 

An error as occurred while proccesing PictureBox 'picture1' Could not find part of the path C:\Myproyect\MyWebSite\System.Drawing.Bitmap.

 

See attached image (left is a single image box and right is the table with the error)

Note 1: I already did this with a single picture box succesfully, but now i need it in a table with two columns, Name and Image.

Note 2: I Dont use paths, i use D.B base64 images and merge them with a Dataset.

 

Silviya
Telerik team
 answered on 09 Oct 2020
2 answers
404 views

How can WPF ReportViewer display Multiple UriReportSources as one Report?

I want to diplay multiple UriReportSources (same trdp UriReportSource and same ParameterName, but varios ParameterValues) in WPF ReportViewer as one Report, wich contains this multiple UriReportSources successively.

Here is my C# Code:

ReportBook RB = new ReportBook();

UriReportSource uriRS = new UriReportSource();
uriRS.Uri = "MyYearTest.trdp";
uriRS.Parameters.Add(new Telerik.Reporting.Parameter("Year", 2018));

RB.ReportSources.Add(uriRS)

UriReportSource uriRS = new UriReportSource();
uriRS.Uri = "MyYearTest.trdp";
uriRS.Parameters.Add(new Telerik.Reporting.Parameter("Year", 2019));

RB.ReportSources.Add(uriRS)

UriReportSource uriRS = new UriReportSource();
uriRS.Uri = "MyYearTest.trdp";
uriRS.Parameters.Add(new Telerik.Reporting.Parameter("Year", 2020));
RB.ReportSources.Add(uriRS)

InstanceReportSource IRS = new InstanceReportSource();
IRS.ReportDocument = RB;
this.TRPViewer.ReportSource = IRS;

Both Objects (RB and IRS) contains 3 ReportSources.
But the WPF ReportViewer (this.TRPViewer) shows 3 times the same page, in fact 3 times the first Report of the Year 2018!

How can i display all 3 Years Reports (2018,2019,2020) as one Report in WPF ReportViewer?

Thom
Top achievements
Rank 1
 answered on 08 Oct 2020
1 answer
240 views

I am new to telerik report. I want to group data by name and address should show down to grouped property. Please find attached file that i generated from report. Please help how to get desired result that i attached.

Neli
Telerik team
 answered on 08 Oct 2020
1 answer
805 views

Is there any way of getting and editing web service datasource from report file(*.trdx, *.trdp) programmatically without using standalone Report Designer tool?

I know Report has DataSources property, but it's private. My scenario is: I generate OData query at runtime and I have to set that OData query string to the report WebServiceDataSource.ServiceUrl property value, or I have to change existed OData query and save that to data source. 

In this post suggested getting data sources through the data items(Table, List, Report parameters,...). But, for example I created data source and it's not assigned to any items yet. In this case how can I access to that data source? I still want to modify that data source which is not assigned.

Thanks,

 

Todor
Telerik team
 answered on 07 Oct 2020
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?