Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:

ASP.NET
<%@ 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:

C#
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.
Posted
Updated 14-Apr-16 5:35am

1 solution

I have solved the issue. I updated VS Crystal Report engine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900