asp.net中水晶报表的空白结果问题

2

本文介绍了asp.net中水晶报表的空白结果问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在使用 Visual Studio,ASP.NET.在我的项目中,我应该使用水晶报告.很遗憾当我在 asp.net 中使用水晶报表时,结果显示为空白页.

I am using visual studio, ASP.NET. In my project i should use crystal report. unfortunately when i use crystal report in asp.net, the result is showing blank page.

<head runat="server">
<title>Crystal Report From More Than One Table</title>
</head>
<body>
<form id="form1" runat="server">
<table cellpadding="10" cellspacing="10" width="70%" height="300px" align="center"
style="border: solid 2px gray;">
<tr>
<td align="center" style="background-color: SkyBlue;">
<span style="font-family: Times New Roman; font-size: 18pt; color: Green;">Customer
Product Order Detail Report</span>
</td>
</tr>
<tr>
<td align="center">
<asp:Panel ID="pnlReport" runat="server" Height="400px">
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
</asp:Panel>
</td>
</tr>
</table>
</form>
</body>

我的 CS 代码(后面的代码):

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CrystalDecisions.CrystalReports.Engine;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(Server.MapPath("EmployeeCrystalReport.rpt"));
CrystalReportViewer1.ReportSource = cryRpt;
}
}

推荐答案

该代码是正确的,但您应该多做两步:

That code is Correct but you should do two steps more:

右击你的项目名称,然后选择Open Folder On File Explorer

将名称为crystalreportviewers13的文件夹粘贴到此地址(项目根目录)

Paste the folder with name crystalreportviewers13on this address (Project Root)

粘贴之后,回到你在visual studio中的解决方案,如果文件夹被隐藏,你可以这样做:

After paste that, come back to your solution in visual studio, if the folder is hidden, you can do this:

点击显示所有文件按钮

Click Show All File button

然后右键单击名称为 crystalreportviewers13 且没有颜色图标的文件夹,然后选择 Include In Project

then Right click on the folder with name crystalreportviewers13 which no color icon and choose Include In Project

<script type="text/javascript" src="/crystalreportviewers13/js/crviewer/crv.js"></script> 

这篇关于asp.net中水晶报表的空白结果问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

参数计数与调用不匹配?
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)...
2023-11-11 C#/.NET开发问题
26

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

没有 EndInvoke 的 C# 异步调用?
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)...
2023-11-11 C#/.NET开发问题
2

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14