0

我在水晶报告中遇到问题。我正在向您发送我的 .aspx 页面和代码隐藏页面。事情是使用相同的代码,我在 vs2005、windowsxp 中发送它的工作良好。但刚才我们进入了 window7,我正在创建另一个一个现在它没有醒来。请给我建议。 .aspx 代码:-

<%@ Page Language="C#" AutoEventWireup="true" Culture="en-AU"  CodeFile="report1.aspx.cs" Inherits="report1" %>
<%@ Register Assembly="CrystalDecisions.Web,Version=10.5.3700.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>Jumbo Bags Report Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    <CR:CrystalReportViewer ID="CrystalReportViewer1"
       runat="server" 
       AutoDataBind="True" 
       Height="1116px" 
       ReportSourceID="CrystalReportSource1" 
       Width="887px" DisplayGroupTree="False" />
       <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
            <Report FileName="CR_rpt1.rpt">
            </Report>
        </CR:CrystalReportSource>
    </div></form>
</body></html>

代码隐藏页面:-

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
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;
using CrystalDecisions.Shared;
using JumboBagsApp.Library;
public partial class report1 : System.Web.UI.Page
{
    private void setDBLOGONforREPORT(ConnectionInfo myconnectioninfo)
    {
        TableLogOnInfos mytableloginfos = new TableLogOnInfos();
        mytableloginfos = CrystalReportViewer1.LogOnInfo;
        foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
        {
            myTableLogOnInfo.ConnectionInfo = myconnectioninfo;
        }
    }
    protected void Page_Load(object sender, EventArgs e)

            ConnectionInfo myConnectionInfo = new ConnectionInfo();
            myConnectionInfo.ServerName = "xxxxxxxx";
            myConnectionInfo.DatabaseName = "xxxxx";
            myConnectionInfo.UserID = "xxx";
            myConnectionInfo.Password = "xxxxxxx";
            myConnectionInfo.Type = ConnectionInfoType.SQL;
            myConnectionInfo.IntegratedSecurity = false;

            setDBLOGONforREPORT(myConnectionInfo);
            ReportDocument reportDocument = new ReportDocument();
            ParameterField paramField = new ParameterField();
            ParameterFields paramFields = new ParameterFields();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
            string scompany = "";
            string sempcode = "";
            string ssr_no = "";
            string sappln_no = "";
            if (Request.QueryString["comcode"] != null &&     Request.QueryString["comcode"].ToString() != "")
            {
                scompany = Request.QueryString["comcode"].ToString();
            }
            if (Request.QueryString["empcode"] != null && Request.QueryString["empcode"].ToString() != "")
            {
                sempcode = Request.QueryString["empcode"].ToString();
            }

            //DateTime dtSysdate4 = DateTime.Parse(txtfrom_date2.Text, CultureInfo.CreateSpecificCulture("en-AU"), DateTimeStyles.AssumeLocal);
            //string txtdate4 = dtSysdate3.ToString("yyyy/MM/dd");
            //string strcur_date4 = txtdate4;
            if (Request.QueryString["cur_date"] != null && Request.QueryString["cur_date"].ToString() != "")
            {
                sappln_no = Request.QueryString["cur_date"].ToString();
            }
            Library lib = new Library();
            //library lib = new library();
            DataTable dtdetailed = new DataTable();
            //dtdetailed = lib.GetDetaileddbySrno(sappln_no.Trim());
            if (sappln_no != "")
            {
                paramField = new ParameterField();
                paramField.Name = "@cur_date";
                paramDiscreteValue = new ParameterDiscreteValue();
                paramDiscreteValue.Value = sappln_no.Trim();
                paramField.CurrentValues.Add(paramDiscreteValue);
                paramFields.Add(paramField);
                CrystalReportViewer1.ParameterFieldInfo = paramFields;
                CrystalReportViewer1.RefreshReport;
            }
        else
        {
            Response.Write("SrNo Not Found");
            return;
        }
     }
}

请给我建议。谢谢。

4

1 回答 1

0

VS 2008 中 CrystalReportViewer 的 DisplayGroupTree 属性已过时。删除它。

您可以使用 ToolPanelView 属性设置为 ToolPanelViewType.GroupTree 或 ToolPanelViewType.ParameterPanel。

于 2012-07-28T11:18:38.303 回答