Sunday, September 18, 2016

Crystal Report Run Time Error

If you Crystal Report does not run properly or if error appeared add this code to your App.config under Solution Explorer

Before You make change it is Like this

<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="CrystalReportTutorial.My.MySettings.TestConnectionString"
            connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Test.mdb"
            providerName="System.Data.OleDb" />
    </connectionStrings>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
</configuration>


After you make change to "<startup>  part

whole part is like this

<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="CrystalReportTutorial.My.MySettings.TestConnectionString"
            connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Test.mdb"
            providerName="System.Data.OleDb" />
    </connectionStrings>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
</configuration>

it means you have to change startup as follows;  <startup useLegacyV2RuntimeActivationPolicy="true">

if other parts of your report is correct this will be helpful.

No comments:

Post a Comment