Telerik Forums
Reporting Forum
2 answers
1.5K+ views

Hi,

 

I have Telerik report designed in Telerik Report Designer.

It contains two object data sources.

I programmatically load trdp file and initialize DataSource property of Report object by two Object Data Source Instances.

In generated report I see strange behavior: table is bound to first data source is duplicated.
Questions:
1.Why report object contains DataSource property = null?
2.in the spec. it's written, that DataSource should be initialized by object derived from IEnumerable interface as well, but when report is rendered, it doesn't take all instances of passes Object Data Sources, but just duplicate first one.

Source code:

var reportPath = HttpContext.Current.Server.MapPath("~/Reports") + "/InvoiceAppendix2.trdp";
 
using (var sourceStream = System.IO.File.OpenRead(reportPath))
{
    var report = (Report)reportPackager.UnpackageDocument(sourceStream);
 
    //prepare report parameters
    report.ReportParameters["SalesOrderId"].Value = salesOrderId;
 
    //init data source
    var dataSource1 = new ObjectDataSource();
    dataSource1.DataSource = typeof(SalesOrderBDS);
    dataSource1.DataMember = "GetSalesOrders";
    dataSource1.Name = "SalesOrderInfoBO";
    dataSource1.Parameters.Add(new ObjectDataSourceParameter("salesOrderId", typeof(int), salesOrderId));
 
    var dataSource2 = new ObjectDataSource();
    dataSource2.DataSource = typeof(JobJacketBDS);
    dataSource2.DataMember = "GetJobJackets";
    dataSource1.Name = "JobJacketInfoBO";
    dataSource2.Parameters.Add(new ObjectDataSourceParameter("salesOrderId", typeof(int), salesOrderId));
 
    report.DataSource = new ObjectDataSource[] { dataSource1, dataSource2 };
 
    var reportProcessor = new ReportProcessor();
    var instanceReportSource = new InstanceReportSource();
    instanceReportSource.ReportDocument = report;
 
    var result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
 
    var stream = new MemoryStream(result.DocumentBytes);
    return new Classes.FileResult(stream, "application/pdf", $"InvoiceAppendix_{salesOrderId}.pdf", true);
}
Nikita
Top achievements
Rank 1
 answered on 08 Apr 2020
3 answers
396 views
Hi,
Is that possible to input hour and minute together with the date picker as report parameter when parameter type is datetime?
thanks :) 
Todor
Telerik team
 answered on 07 Apr 2020
6 answers
699 views
I would like to pass a DataSet to Telerik Report before it is rendered by the ReportViewer. I am using the WPF ReportViewer and my DataSet is returned as a part of WCF service call. Do you have a sample of creating a DataSet outside the report and then setting it either as a property of the Report or any other suggested way of achieving the same?
Todor
Telerik team
 answered on 03 Apr 2020
1 answer
463 views

Hey Guys, 

So I've got a .Net Core 2.1 MVC application that we have been using for a while now. We wanted to switch over some of the reports that we had in the application to using Telerik reports. I figured this wouldn't be an issue since I implemented this same basic logic inside of a winform application that we have.

So I added a Telerik Reporting R1 2020 project to the solution and created a report. When I try to add an image to the picturebox that I have on the report for the logo either through the ellipses on the picturebox properties or by setting the picturebox.Value to a resource file that I set I get an error saying 'Cannot read resources that depend on serialization.' 

I get this error as soon as I try to create a new Report object in my class. 

So I figured that I would set the value of the picturebox to an image that I would get from Image.FromFile("file path here"). After I do that, I get an error that says 'cannot load file or assembly System.Drawing.ImageConverter'. 

This error gets popped as soon as I try to render the report using ReportProcessor.RenderReport to render a pdf version of the report. 

Now I've tried adding the System.Drawing.Common and System.Drawing.Primative nuget packages to the .Net Core application with no prevail. 

Has anyone else ran into this problem or know how to get the image to set on the picturebox? My image type is a jpg. 

Todor
Telerik team
 answered on 03 Apr 2020
2 answers
349 views

Hello,

 

I used telerik:ReportViewer control in my application which is  developed by C# and WPF. It works well on my own computer(Windows 10), but it crashed immediately when it runs in win7. 

 

The detail info of my develop environment: Window 10 Pro (Version 1903)、 Visual Studio 2019

The detail info of my project:Telerik_UI_for_WPF_2019_1_116、Telerik_Reporting_R1_2019_13_0_19_116、.NET Framework 4.5

The detail info of my test environment: Window 7 Enterprise (x64, SP1),  .NET Framework 4.5.2 DevPack (I also tried 4.5.2 Full Version, still crashed)

 

The source code of my project is shown below. In order to find the cause of issue, there is only a report viewer control left.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Button Content="show report viewer" Click="Button_Click" />
    <telerikReport:ReportViewer x:Name="ReportViewer" Grid.Row="1" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
 
private void Button_Click(object sender, RoutedEventArgs e)
{
    this.ReportViewer.Visibility = Visibility.Visible;
}

 

Here is the error info when it crashed in win7(after i click the button):

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: TelerikProject2001.exe
  Problem Signature 02: 1.0.0.0
  Problem Signature 03: ecb2db42
  Problem Signature 04: PresentationCore
  Problem Signature 05: 4.0.30319.34209
  Problem Signature 06: 5348b56b
  Problem Signature 07: 11b
  Problem Signature 08: 2d
  Problem Signature 09: System.Windows.Markup.XamlParse
  OS Version:   6.1.7601.2.1.0.256.4
  Locale ID:    1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

 

Then I used DispatcherUnhandledException in my code to catch the exception, and find a  XamlParseException was throwed in reportviewer control. The detail info of this exception is too lang. So i attach the exception image at the end.

 

My application works well in win7 when i use telerik report 2014Q1. Not long ago, i upgraded it to 2019Q1, and then it crashed like that.

Hope for your advise. Thanks.

 

Jacory
Top achievements
Rank 1
 answered on 03 Apr 2020
6 answers
305 views

Our company has a client that uses Telerik Reporting. They are not using the Telerik Reporting service. They are using the reporting DLL and rendering the reports on their web server. This is how the ReportServiceConfiguration is initialized:

ReportServiceConfiguration = new ReportServiceConfiguration
{
    HostAppId = "Html5App",
    Storage = new FileStorage(),
    ReportResolver = new TelerikReportResolver(MDBReportHelper.GetReportTemplatesPath()),
    WorkerCount = 10
};

The application works as expected when running on a local machine (we can see an increase in pages being rendered in parallel, when we increase the workerCount property). However, the client reports that when deployed to their QA server, it generates only 2 pages at a time, no matter the value set to the workerCount property, and they would like to improve that. The configuration of their QA machine is as follows:

OS: Windows Server 2012 R2
CPU: 8 vcpu's - Intel Xeon CPU E5-2673 v4 @ 2.30GHz
RAM: 56GB

Their web app is running on a separate App Pool in IIS.

Do you know if there is any way to increase the number of pages, generated in parallel?

Katia
Telerik team
 answered on 03 Apr 2020
2 answers
116 views

Hello,

I am currently trying out Telerik reporting and using.net standard for report's source, I followed the suggested ntier design of this thread https://www.telerik.com/forums/net-core-class-library-as-an-objectdatasource, passing dummy collection is easy however implementing ADO for .NET Standard returns assembly issues, do you have examples of .net standard project that uses ADO.NET?

Dom
Top achievements
Rank 1
 answered on 02 Apr 2020
0 answers
111 views

If you try to create a task through the scheduling function of the report server, an error such as the attached image occurs.
Agent is running, and looking at the log taken by Agent, it appears as below.
Please tell me which part to check.

------------------------------------------------

Environment.UserInteractive: False
Telerik.ReportServer.ServiceAgent.exe Information: 0 : The WCF service has been started successfully at http://beyondtest:81/ReportServer/ServiceAgent
    DateTime=2020-04-02T09:08:04.3426314Z
Telerik.ReportServer.ServiceAgent.exe Error: 0 : Unable to start internal services yet:
System.InvalidOperationException: Storage is not configured.
   위치: Telerik.ReportServer.ServiceAgent.ServiceAgent.CreateReportServer()
   위치: Telerik.ReportServer.ServiceAgent.ServiceAgent.RestartReportServerDependencies()
    DateTime=2020-04-02T09:08:04.5186414Z
Telerik.ReportServer.ServiceAgent.exe Information: 0 : ReportServer ServiceAgent has started.
    DateTime=2020-04-02T09:08:04.5186414Z

NEXTLAB
Top achievements
Rank 1
 asked on 02 Apr 2020
4 answers
949 views
I want to limit table items display in per page, such as 4, I used RowNumber(), but it had no effect.
Anders
Top achievements
Rank 1
 answered on 02 Apr 2020
1 answer
589 views

Hi,

I have a parameter that controls the visibility of page footer called "Show only page footer on the last page".

I also have a group footer on top of the page footer containing a HtmlTextBox with some custom footer texts, since the page footer can't grow during render it is placed in the group with PrintAtBottom set to true.

The group footer should also be hidden when page footer i hidden. It seems to work when i set the group footer to PrintOnEveryPage = false and when i set the GroupFooter.Visible = PageFooter.Visible inside of PageFooter_DataBound.

But,

This fails when i want to render multiple reports like 2 invoices and when the report engine renders a Empty page. Then i figured that is should control the visibilty of the "footers" by checking PageNumber = PageCount aswell but it looses the PageNumber and PageCount on this empty page. So i cant tell if it is the last page or not.

 

How to encounter this issue?

Katia
Telerik team
 answered on 01 Apr 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?