Click here to Skip to main content
16,020,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I had developed an application in WPF and used SQL Server 2012 as its backend database which uses RDLC Reportviewer to display the Reports.

All works fine in my PC and some of my clients PC's.

But when application is install on my one of the client PC, it throws an exception while showing the reports:

The invocation of the constructor on type

'Microsoft.Reporting.WinForms.ReportViewer' that matches the specified binding constraints threw an exception, Line number '9' and line position '14.

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

here is the xaml file, I checked at line no. 9 position 14.

C#
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="IMS.PrintDialog"
        Title="Print Sales Bill" Height="502" Width="819" Loaded="Window_Loaded" KeyUp="Window_KeyUp" Closing="Window_Closing">
    <Grid>
        <WindowsFormsHost Margin="0,73,0,0" removed="White">
            <rv:ReportViewer x:Name="reportViewer" DocumentMapCollapsed="False" ZoomMode="Percent" Enabled="True" AutoSizeMode="GrowOnly" Print="reportViewer_Print" PrintingBegin="reportViewer_PrintingBegin"/>
        </WindowsFormsHost>

</Grid>

</Window>

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

I put try catch block and found that exception is occurring when the the constructor of the class called i.e InitializeComponent();

I couldn't find the solution that why it is happening. I installed the following files on the client PC

1. .Net Framework 4.6.2

2. Sql Server Express 2012

3. Report Viewer Runtime 2012

My Project based on:

1. .Net Framework 4.5.2

2. Sql Server 2012


Please help.

Thanks

Amit

What I have tried:

I installed the following files on the client PC

1. .Net Framework 4.6.2

2. Sql Server Express 2012

3. Report Viewer Runtime 2012

but problem still exists
Posted
Updated 12-Sep-16 18:21pm

1 solution

My guess would be that Report Viewer Runtime 2012 didn't install correctly.
Have you tried to reinstall it?

Have you included the "Microsoft.ReportViewer.Common.dll" and "Microsoft.ReportViewer.WinForms.dll" in the same directory as your application?

Is the Operating system any different than your other clients? 32 vs 64 bit, 7,8,8.1,10, etc?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900