Amit Gupta

Amit Gupta

  • NA
  • 22.9k
  • 229k

Error in RDLC invocation

Sep 11 2016 1:30 PM

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.

<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" Background="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


Answers (2)