cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Viewer Binding errors

gwsoftware
Explorer
0 Kudos

I just migrated to a new PC with windows 8.1 pro. I installed visual studio community edition update 4 and crystal reports for visual studio version 13.0.13.1597. All installed with no problems. I have a vb .net project using the crystal report WPF viewer control.

All reports display correctly but I am getting binding errors in the visual studio IDE.

The errors are:

System.Windows.Data.Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=TooTip: DataItem='Button' (Name='btnOpen'); target element is 'Button' (Name=btnOpen'); target property is 'Name' (type 'String')

There are 14 of theses errors for different buttons.

I have seen the problem mentioned throughout the crystal reports forums but have not found an answer to eliminate the binding errors.The errors occur as soon as the control is initialized.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

I suspect CR does not support visual studio community edition... Let me ping Program Management and see what they say.

Re:


I have seen the problem mentioned throughout the crystal reports forums but have not found an answer to eliminate the binding errors

Can you add one or two links to these queries please?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

0 Kudos

Hi George,

We support VS Pro and above so if this version fits in that area it should work. If it's the same flavor as VS Express then we do not support it.

Did you install just the MSI or did you run the Actual CR for VS exe?

If you click on the Tool Bar and add CrystalReportViewer to the Reporting tree and then create a new project and drop the CR viewer onto form does the template add the Engine and Shared to the project references?

Don

gwsoftware
Explorer
0 Kudos

Don,

I ran the exe to install crystal reports.

The version of visual studio is equal to VS Pro 2013.

When I create a new  project using the template (Crystal Reports WPF application) below are the references automatically added.

Then when I run the project the following errors appear in the visual studio immediate window.

(The report still loads and displays properly)

Thanks for any help,

George

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnOpen'); target element is 'Button' (Name='btnOpen'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnPrint'); target element is 'Button' (Name='btnPrint'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnRefresh'); target element is 'Button' (Name='btnRefresh'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnExport'); target element is 'Button' (Name='btnExport'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnCopy'); target element is 'Button' (Name='btnCopy'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='ToggleButton' (Name='btnToggleSidePanel'); target element is 'ToggleButton' (Name='btnToggleSidePanel'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnPrevPage'); target element is 'Button' (Name='btnPrevPage'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnNextPage'); target element is 'Button' (Name='btnNextPage'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=.; DataItem=null; target element is 'ImageBrush' (HashCode=39642524); target property is 'ImageSource' (type 'ImageSource')

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=.; DataItem=null; target element is 'ImageBrush' (HashCode=10073418); target property is 'ImageSource' (type 'ImageSource')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.Button', AncestorLevel='1''. BindingExpression:Path=IsEnabled; DataItem=null; target element is 'Image' (Name=''); target property is 'NoTarget' (type 'Object')

gwsoftware
Explorer
0 Kudos

Is there any other information you need?

I am trying to get this resolved.

0 Kudos

Hi George,

R&D did a quick test last night also and it works for him so it's likely something environmental on your PC. If a new project does the same thing. He is going to drill into the errors more though to see if he can find a cause....

Look for anything in the event logs and Anti-virus logs, it could be your AV software is blocking access to resources or dependencies.

CR is dependent on Printers also, try setting your default printer to something common like an HP printer, do not use the XPS printer by MS, it has all sort of issues...

I just created a new WPF test app for another issue and it works fine.

I did a google search on that error and found a few posts...

See if this help:

c# - How to hunt down WPF binding errors? - Stack Overflow

Possibly you may want to do a repair install of VS 2013 and make sure you install under the local PC Admin account so it has full permissions.

Don

former_member183750
Active Contributor
0 Kudos

Hi George

Here is a sample app created using visual studio community edition. Please see if that works for you.

(Download the file, rename to .zip and extract)

- Ludek

gwsoftware
Explorer
0 Kudos

Ludek,

Thanks so much for the Help.

I downloaded and unzipped the file.

I opened the solution in visual studio and pressed  the start button.

Same problem as before, It ran OK and I could see the sample report but below are the errors it generated.

I looked though the log files on my PC and could not find any errors.

Like I said this is a new PC with a clean install of visual studio followed by the install of crystal reports.

I hate to delete and re-install everything and that might not fix it.

Please  advise,

George

Errors:

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnOpen'); target element is 'Button' (Name='btnOpen'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnPrint'); target element is 'Button' (Name='btnPrint'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnRefresh'); target element is 'Button' (Name='btnRefresh'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnExport'); target element is 'Button' (Name='btnExport'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnCopy'); target element is 'Button' (Name='btnCopy'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='ToggleButton' (Name='btnToggleSidePanel'); target element is 'ToggleButton' (Name='btnToggleSidePanel'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnPrevPage'); target element is 'Button' (Name='btnPrevPage'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnNextPage'); target element is 'Button' (Name='btnNextPage'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=.; DataItem=null; target element is 'ImageBrush' (HashCode=39642524); target property is 'ImageSource' (type 'ImageSource')

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=.; DataItem=null; target element is 'ImageBrush' (HashCode=10073418); target property is 'ImageSource' (type 'ImageSource')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.Button', AncestorLevel='1''. BindingExpression:Path=IsEnabled; DataItem=null; target element is 'Image' (Name=''); target property is 'NoTarget' (type 'Object')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=.; DataItem=null; target element is 'ImageBrush' (HashCode=52851441); target property is 'ImageSource' (type 'ImageSource')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Header; DataItem='TreeViewItem' (Name=''); target element is 'TreeViewItem' (Name=''); target property is 'Name' (type 'String')

former_member183750
Active Contributor
0 Kudos

Before reinstalling everything, it may be worth googlin the general error. E.g.; BindingExpression is not valid

Maybe something will pop up that points the way. E.g.;

wpf - Value produced by BindingExpression is not valid for target - Stack Overflow

- Ludek

gwsoftware
Explorer
0 Kudos

Ludek

I do not have any bindings. All I have is a viewer control in a window.

<cr:CrystalReportsViewer  x:Name="ReportViewer" />

When the window loads and calls:

  InitializeComponent()

  The cyrstal report viewer throws all of those errors. I have no buttons or any of those errors anywhere at all.

George

gwsoftware
Explorer
0 Kudos

The SAPBusinessObjects.WPF.Viewer and the SAPBusinessObjects.WPF.ViewerShared in my project references are both version  13.0.3500.0

Are these the latest and correct version for visual studio 2013?

0 Kudos

Hi George,

3500 is the assembly version, it never changes. You need to look in the GAC or in Programs and Feature, it will tell you what version you are using:

I'm testing SP 14, SP 13 is the last released version:

You can get the download from here, first link is the VS installer, do NOT just install the MSI Redist package, it will not integrate into VS:

http://scn.sap.com/docs/DOC-7824

And yes if you look at the properties it is 3500:

If you go to Form view you will see some of the properties if you click on the CR viewer:

gwsoftware
Explorer
0 Kudos

Don,

     I am running 13.0.13.1597 which I believe is the latest edition.

If I use the viewer for windows forms (which I am trying to migrate away from) no errors occur but the WPF viewer Throws the errors on every load of the window.

0 Kudos

Hi George,

Gotcha... The screen shot I posted is the WPF viewer, not the Winform viewer. But that comment suggests something else is going on in possibly the way you created the app.

Can you create a new test app and then zip it up. Rename the zip file to *.txt and then attach it using the Advanced editor?

I'll have a look at the project and see if it's something else you are doing or the way you are creating your project.

Don

gwsoftware
Explorer
0 Kudos

Don,

Here is the zipped project

It is a blank report but still throws all the errors on my PC.

Thanks so much for the continued help.

George

0 Kudos

Thanks George,

And of course it works fine on my Windows 7 PC...

I did notice though you do not have an app.config file so try creating one and also add this to it:

startup>

supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>

startup>

Add it by clicking on the Project and New Item and under General you will find the application config option.

Then add the above and see what happens.

When I did it to your project it added a bunch of debugging lines....

I'll get a Windows 8.1 image running and see what happens with your test app.

Don

0 Kudos

And it works for me on a windows 8.1 VM-ware image...

So unfortunately I don't have anything else for you. All I can suggests is try re-installing or doing a repair install on everything.

Try Googling that error, lots of hits on this subject...

May be AV software blocking it, disconnect from your network and disabling your AV software and try repairing or running VS by right clicking and selecting run as administrator....

It's definitely environmental issue...

Good luck

Don

gwsoftware
Explorer
0 Kudos

Don,

     Thanks again for the help. I added the app.config file and the lines you suggested to no avail. I disabled all my AV software and also repaired the visual studio install and unfortunately that did not help.

     Just to clarify - the program runs correctly and the report displays correctly the only problem I have are the erroneous binding messages in the immediate window that have no effect on the program and you do not see them in the tests you ran?

   George

0 Kudos

Hi George,

Ah, I thought this was stopping you from running....

All I get in the immediate window after building is this:

------ Rebuild All started: Project: TestCRViewer, Configuration: Debug x86 ------


  TestCRViewer -> C:\George Sefcik\TestCRViewer\TestCRViewer\bin\Debug\TestCRViewer.exe


========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Same for Release mode:

------ Rebuild All started: Project: TestCRViewer, Configuration: Release x86 ------


  TestCRViewer -> C:\George Sefcik\TestCRViewer\TestCRViewer\bin\Release\TestCRViewer.exe


========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Same for X64 build and AnyCPU...

So I don't know what would be causing it. Possibly some compiling flag you may have enabled by default. I'm using all of the defaults....

Don

gwsoftware
Explorer
0 Kudos

Don,

     Sorry if I wasn't clear about the binding errors. I tried to state that in my original question.

I just installed visual studio 2013 and have not changed any settings. Obviously if it works for you then something is wrong with my setup. I appreciate all your help. I will go through all the settings in VS and see if I can find something.

     I've been a licensed user of the profession edition of crystal reports since it's inclusion in visual studio and never had an installation problem before.  When I do get this resolved, I will post my findings.

Thank-you

George

anthony_osicka
Explorer
0 Kudos

Hi George,

I can assure you that this has nothing to do with your setup.

These binding errors on the WPF crystal reports viewer have been around since its first release.

They appear in the Visual Studio Output Window every time your app shows the viewer.

They are very annoying when you are trying to locate real issues in the output window but should not cause any problem with your running application.

You could configure Visual Studio to stop showing these errors but you would then also miss out on any generated by your code which is probably a bad idea.

The only way to get rid of these would be for the developers to clean up the bindings in the viewer.

Thanks

Anthony

gwsoftware
Explorer
0 Kudos

Anthony,

     Thank you so much for your response. I will stop looking to resolve this.  Why wouldn't someone at SAP just tell me this instead of having me try to resolve it?

Thanks

George

0 Kudos

Hi Guys,

Ah, now that Anthony has pointed out where you can see those errors I do see them now also.

I'll create a case and send it off to R&D to see if they can resolve the reported errors.

Incident 338955 / 2015 / Binding errors in WPF .net app

KBA - 2158245 - When viewing in Debug mode the Output windows shows Key Binding errors in a WPF .net app

Thanks guys.

Don

0 Kudos

Hi Guys,

R&D had a look at this question and here's how to fix it...

The above error messages are disconcerting because they look like there’s something horribly wrong with your project.
These messages do not mean you have a problem. They are a result of how Microsoft handles WPF behind the scenes.
You can safely ignore them.

If you want to remove them, you can edit your App.config file (located in your project folder) and add the following lines below to the configuration section:

<configuration>

  <system.diagnostics>

    <sources>

      <source name="System.Windows.Data" switchName="SourceSwitch">

        <listeners>

          <remove name="Default" />

        </listeners>

      </source>

    </sources>

  </system.diagnostics>

</configuration>

As a result of the above findings no patch will be provided.

Thanks again

Don

anthony_osicka
Explorer
0 Kudos

Hi Don,

This is a disappointing response as these errors are quite frustrating when trying to debug an application.

You were able to see these errors on your own project, therefore I am not sure how there is "something horribly wrong" with our projects.

I personally have had 5 years working non stop with WPF on a very large LOB application and these binding errors are usually attributed to programming mistakes, not the way Microsoft handles WPF behind the scenes. In this instance the bindings for the tool tips on the viewer's buttons are causing the issue.

I believe the advice to modify the App.config would also result on missing out on all of the other legitimate errors we should be debugging.

Thanks

Anthony

gwsoftware
Explorer
0 Kudos

Don,

     I appreciate you responding, but I fail to see how turning off the error messages is a reasonable solution to the errors? Now any "other" errors that occur during the normal coding/debugging process of a program will not appear.

     If R&D acknowledges the errors, then how is not fixing them a solution.

     Does this mean the product is no longer supported and viable and I should look a new report writer solution in the future?

Thanks,

George

0 Kudos

Update:

R&D is still looking into it, so far they have not found a way to fix those messages when running in debug mode... and all others likely.

Don

anthony_osicka
Explorer
0 Kudos

Hi Don,

If you are able to provide me with the XAML file where these bindings are taking place, I would be happy to see if I can help find the issue.

Thanks

Anthony

0 Kudos

FYI - Developer are still working this....

gwsoftware
Explorer
0 Kudos

Any Progress on this issue?

0 Kudos

Hi George,

Thanks for the reminder. I looked at the case and DEV said there is nothing we can do to fix the binding errors. He suggested you contact Microsoft and report the issue.

He did find one other way to possibly suppress the errors though:

I found another method to suppress the error message.

        public MainWindow()

        {

            System.Diagnostics.PresentationTraceSources.DataBindingSource.Switch.Level = System.Diagnostics.SourceLevels.Critical;

            InitializeComponent();

        }

I searched the many resources about this issue through internet, unfortunately I couldn't find any solution to solve this issue.

So all I can suggest is to ignore them....

Don

Answers (0)