This is a migrated thread and some comments may be shown as answers.

Cannot display report in WPF

4 Answers 173 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Greg Sipes
Top achievements
Rank 1
Greg Sipes asked on 13 Jul 2010, 03:15 PM

Hello,

     I am having some troubles building my first report with Telerik Reporting. I read the docs in order up to this point. I followed the "creating a simple report page" and it seems like all went well for building the library with one simple report. However, onto the next step, displaying the report in a report viewer in wpf does not work. First off, there is no dock property as shown in step 4. The bigger problem however, is setting the report property of the reportViewer.

Here is a code snippet:

     

Public Class ReportView


    Private Sub WindowLoaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded

Dim routeReport as New ReportingLibrary.RouteReport

        ReportViewer1.Report = routeReport

    End Sub

End Class



And here is the error that I get:

Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.


RouteReport.vb is report that was created with the report wizard, and previews correctly. I checked the target framework  .NET Framework 4.0 (not the client profile). Any suggestions would be greatly appreciated.



Thanks in advance

4 Answers, 1 is accepted

Sort by
0
Greg Sipes
Top achievements
Rank 1
answered on 13 Jul 2010, 05:41 PM
I fixed the problem that I was having. After I rebuilt the report library, I stopped getting the error message, but had a connection string problem. I found a bug in the report's designer class. In my case in RouteReport.Designer.vb, the connection stirng property was set as a literal....  Me.MyApp.ConnectionString = "ReportingLibrary.My.MySettings.MyApp". This caused the connectionString to literally be "ReportingLibrary.My.MySettings.MyApp". I changed the this line of code to read  Me.MyApp.ConnectionString = My.Settings.MyConnectionString and the problem was fixed!
0
Steve
Telerik team
answered on 14 Jul 2010, 11:57 AM
Hello Greg Sipes,

The only article in the QuickStart is about the Windows Forms viewer and not about the WPF viewer, thus the "missing" dock property.
As for the error, we could not reproduce it on our end. You can open our Visual Studio examples, navigate to the WpfDemo and change the example so that the report is loaded upon WindowLoaded to verify that it works correctly.
As for the connectionString - you should always copy the connectionString from the report library app.config to the config file of your actual application. More information is available in the following KB article: Using connectionStrings from configuration file.

Greetings,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Greg Sipes
Top achievements
Rank 1
answered on 14 Jul 2010, 04:10 PM
Where will I find the documentation and samples for WPF viewers? Also, I followed the link, read the article, copied the connectionString into the main application using the interface(wizard), and still no luck. The article make sense and covers the exact problem that I am having, but I used the Report Wizard, without changing anything, and still having this issue. I can just keep switching back and forth for now, but hopefully one day this can fixed.

0
Steve
Telerik team
answered on 16 Jul 2010, 08:39 AM
Hello Greg,

The Telerik Reporting installation comes with a solution containing demo reports and applications for all supported platforms including WPF, so opening the Visual Studio examples is the place to start with for the examples.
The right place to look for documentation is of course the product documentation. You can use the search field in the top right corner if you are not familiar with the documentation structure and cannot find information you're looking for.
As for the connectionString, there must be some confusion as it has nothing to do with the Report Wizard except probably the fact that in one of the steps you're being asked whether you would like to save the connectionString to the settings file or not.
This file would then be used when previewing the reports in the designer. However when you reference the class library in your actual project, the reports look for the connectionString in the Settings object, which would not hold this information. That is why you would have to copy the connectionString as is from the report class library to your WPF project. You can see this is the case in our Visual Studio examples as well.

Kind regards,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Greg Sipes
Top achievements
Rank 1
Answers by
Greg Sipes
Top achievements
Rank 1
Steve
Telerik team
Share this question
or