Telerik Forums
Reporting Forum
1 answer
624 views

Hi,

    I was trying to create a new data source with MySQL connection string in Telerik Report Designer Standalone tool. While trying to preview the datasource results on clicking 'Execute Query' button I am getting an error message "An error has occurred.
Unable to establish a connection to the database. Please, verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application.
"  When tried to connect with SQL server connection string, I am able to view the results.

   Then I set the same MySQL connection string as shared connection and was able to create and run a report using the Telerik Report Designer. But when tried to execute the same report from Angular report viewer using Telerik Rest service, I'm getting the same error mentioned above. It would be helpful if anybody can provide a solution for this issue. Please find attached files to get more details about the error.

Thanks.

 

 

Todor
Telerik team
 answered on 08 Apr 2020
4 answers
192 views

I am trying to create a sample project to test reporting in
our Universal windows App(UWP). However i am unable to get the basic test going.

Do you have any reporting template for universal platform..

Please help me for creating report in universal platform(UWP)

Thanks in advance

Dhaneesh

Glenn
Top achievements
Rank 1
 answered on 08 Apr 2020
5 answers
882 views

I had exported the excel file from my report. while opening , the excel file prompt a warning message "We found a problem with some content in <filename>.xlsx . Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes" but after click Yes, the report show successfully without any problem.

what can I do to avoid the excel to prompt such warning message ?

Edward
Top achievements
Rank 1
Veteran
Iron
Iron
 answered on 08 Apr 2020
3 answers
298 views

Hi

I'm new to telerik and I'm trying to figure out how best to approach this problem.

 

I have a datasource that contains rows for individual ice cream sales for people by date. So a person could have multiple rows under different date (e.g. John could buy chocolate ice cream on 02/02/2020 and vanilla on 02/03/2020).

 

I have a column that stores the total number of ice creams a person has bought in history, my report shows the total number of ice creams a persons bought between two dates and the total in history like so:

 

Name | Total Ice Creams Bought | Ice Creams For Date |

John   |                  5                     |              2                    |

Max    |                 10                    |              5                    |

 

So in the data returned there's 2 rows for "John" and 5 rows for "Max". Now in the report the "Total Ice Creams Bought" is the First of that column while "Ice Creams For Date" is a Sum.

 

I want to add another column that will have the sum of these rows in the report,however because the "Total Ice Creams Bought" is aggregated in the datasource (it's 5 for "John" in every row) when I sum it it will sum it for every row.

 

So in the above example the aggregate row after I created it returns 60 instead of 15 (10 for "John's" two 5's and 50 for "Max's" five 10s), is there a way to aggregate just the values as they're shown in the report instead of the aggregate values of the datasource?

 

Cheers!

Richard
Top achievements
Rank 1
 answered on 08 Apr 2020
3 answers
841 views

I am trying to write an inventory report, which is using two databases.

The primary site uses the database InvA, and where the product is in the secondary facility this database has a secondary code which is basically the key for the inventory line in the InvB database.

I have written a SQL statement that connects to the two databases and collects the data they want, combining where needed and the data matches what they want.  A single table combining the product quantity by product code and lot code, regardless of facility.

 

1) The problem I'm having is how do I create a report that uses my SQL statement which connects to two databases?  Is there a way of assigning two connection strings to a single SqlDataSource?  Is there an example for this?

2) Do I have to programmatically "merge" my datasources into a single data table, and then use an ObjectDataSource?  Is there an example of this?

3) Does Telerik use DataSource and Database interchangeably, meaning I can only use one database per report?  Should I be asking the client if I can modify the database to include a table valued function?

UMC-Vietnam
Top achievements
Rank 1
 answered on 08 Apr 2020
2 answers
1.4K+ 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
327 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
613 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
389 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
282 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
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?