I have installed CR13SP33 x86 & x64 runtime and also installed CRforVS6413 and I am able to get crystalReportViewer on ToolBar, create ASP.NET with .net framework 4.8, and dragged the control to the aspx page. but on design view, I am getting the following error, and on execution its blank page, note that my crystal report file already has data in it
this is my aspx code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" width="1200px" Height="800px"/>
</body>
</html>
web.xml config file
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.8">
<assemblies>
<add assembly="CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669E0DDF0BB1AA2A"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.8"/>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE="Web" /optionInfer+"/>
</compilers>
</system.codedom>
</configuration>
and my C# code to load CRystal report file
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument myReportDocument;
myReportDocument = new ReportDocument();
myReportDocument.Load(@"C:UsersSeraksourcereposWebApplication1WebApplication1ConsolidatedBalanceSheet.rpt");
CrystalReportViewer1.ReportSource = myReportDocument;
CrystalReportViewer1.DisplayToolbar = true;
}
}
}
2
Answers
Your web.config file looks fine.
You must set "Copy Local" to "False", so it doesn’t load the wrong DLLs; your bin folder must have no CR DLLs in it.
Check out this blog I wrote to upgrade your project to VS 2022 (this has a sample web.config that does work).
The problem is that IIS can’t find the CR viewer in here, or similar:
C:inetpubwwwrootaspnet_clientsystem_web4_6_81crystalreportviewers13.Copy this folder into your Project: crystalreportviewers13
Please register the content on your aspx page: