Crystal报表无法呈现。为什么? [英] Crystal report not rendering. Why?

查看:96
本文介绍了Crystal报表无法呈现。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我有一个使用Crystal Reports的网页。当用户登录并单击打印空白报告按钮时,将显示报告页面,但报告查看器中没有报告。当我在同一页面上测试其他内容时,会显示这些对象,但不会显示空白报告。我试图重新创建报告和再次显示报告的网页,但同样的事情发生了。我做错了什么或忘记了什么?



这是网页代码:



Hello. I have a web page that uses Crystal Reports. When the user logs on and clicks on the Print Blank Report button the report page comes up but no report is in the Report Viewer. When I test out other things on the same page, those objects show up but not the Blank report that was made. I have tried to recreate the report and the web page that displays the report over again but the same thing happens. What did I do wrong or forgot?

Here is the Web Page code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FINBlankA.aspx.cs" Inherits="FINAPP.FINBlankA" %>

<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <CR:CrystalReportViewer ID="CrystalReportViewer1"  runat="server" 

            AutoDataBind="True" EnableDatabaseLogonPrompt="False" 

            GroupTreeImagesFolderUrl="" HasCrystalLogo="False" HasDrilldownTabs="False" 

            HasDrillUpButton="False" HasExportButton="False" HasGotoPageButton="False" 

            HasPageNavigationButtons="False" HasSearchButton="False" 

            HasToggleGroupTreeButton="False" HasToggleParameterPanelButton="False" 

            HasZoomFactorList="False" Height="1202px" ReportSourceID="CrystalReportSourceA" 

            ToolbarImagesFolderUrl="" ToolPanelView="None" ToolPanelWidth="200px" 

            Width="903px" />
        <CR:CrystalReportSource ID="CrystalReportSourceA"  runat="server">
            <Report FileName="BlankWorkSheetA.rpt">
            </Report>
        </CR:CrystalReportSource>
        <asp:TextBox ID="TextBoxUser_ID" runat="server" Visible="False"></asp:TextBox>
    
    </div>
    </form>
</body>
</html>





守则背后:





The Code Behind:

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Web;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.WebControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.Windows.Forms;
using CrystalDecisions.ReportSource;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Xml.Linq;
using System.Web.SessionState;
using CrystalDecisions.ReportAppServer;
using System.Drawing;
using System.Drawing.Printing;

namespace APP
{
    public partial class BlankA : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HOTConnectionString"].ConnectionString);
            con.Open();
            TextBoxUser_ID.Text = Session["user_id"].ToString();
            CrystalReportViewer1.Visible = true;

            ReportDocument CrystalReport = new ReportDocument();
            ParameterField paramField = new ParameterField();
            ParameterFields paramFields = new ParameterFields();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

            paramField.Name = "user_id";
            paramField.CurrentValues.Clear();
            paramDiscreteValue = new ParameterDiscreteValue();
            paramDiscreteValue.Value = TextBoxUser_ID.Text;
            paramFields.Add(paramField);
            CrystalReportViewer1.ParameterFieldInfo = paramFields;

            CrystalReport.Load(Server.MapPath("BlankWorkSheetA.rpt"));
            string sessiontype = TextBoxUser_ID.Text;
            CrystalReport.SetParameterValue("user_id", TextBoxUser_ID.Text);

            string sessionid = TextBoxUser_ID.Text;
            CrystalReport.SetParameterValue("user_id", TextBoxUser_ID.Text);
            CrystalReportViewer1.ReportSource = CrystalReport;
            con.Close();
        }
    }
}





我尝试了什么:



我试图重新制作网页和报告。



What I have tried:

I have tried to remake the web page and the report.

推荐答案

我已经解决了这个问题。我更新了VS Crystal Report引擎。
I have solved the issue. I updated VS Crystal Report engine.


这篇关于Crystal报表无法呈现。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆