StatisticalAnalysis/CompanyYearExport.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;


public partial class StatisticalAnalysis_CompanyYearExport : System.Web.UI.Page
{
    private ReportDocument CommonReport;
    ParameterFields ParamFields;

    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        { ViewState["ds"] = (DataSet)Session["ds"]; }
       
        string CompanyShortName = Request.QueryString["CompanyShortName"].ToString();
        string CompanyFullName = GenericClass.GetCompanyFullName(CompanyShortName);

        DataSet ds = (DataSet)ViewState["ds"];
  
        CommonReport = new ReportDocument();
        string reportPath = Server.MapPath(@"..\Report\CompanyYearReport.rpt");
        CommonReport.Load(reportPath);
        CommonReport.SetDataSource(ds.Tables["Master"]);

        ParamFields = new ParameterFields();
        SetParmField(1, CompanyFullName);

        CrystalReportViewer1.ReportSource = CommonReport;
        


    }

    protected void Page_Unload(object sender, EventArgs e)
    {

        if (CommonReport != null)
        {
            CommonReport.Close();
            CommonReport.Dispose();
        }

        if (Session["ds"] != null)
        {
            Session["ds"] = null;
            Session.Abandon();
        }

后面还有 21 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。