国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

.Net(c#)調用采用"提取模式"獲取數據的水晶報表

2024-07-10 13:03:44
字體:
來源:轉載
供稿:網友
  • 網站運營seo文章大全
  • 提供全面的站長運營經驗及seo技術!
  • using system;
    using system.drawing;
    using system.collections;
    using system.componentmodel;
    using system.windows.forms;
    using crystaldecisions.crystalreports.engine;
    using crystaldecisions.shared;
    namespace dllcrystal
    {
    /// <summary>
    /// frmcrystalview 的摘要說明。
    /// </summary>
    internal class frmcrystalview : system.windows.forms.form
    {
    private crystaldecisions.windows.forms.crystalreportviewer crview;
    /// <summary>
    /// 必需的設計器變量。
    /// </summary>
    private system.componentmodel.container components = null;
    private string[] strinfo;

    public frmcrystalview(string[] strinfomation)
    {
    //
    // windows 窗體設計器支持所必需的
    //
    initializecomponent();

    //
    // todo: 在 initializecomponent 調用后添加任何構造函數代碼
    //
    strinfo=strinfomation;
    }

    /// <summary>
    /// 清理所有正在使用的資源。
    /// </summary>
    protected override void dispose( bool disposing )
    {
    if( disposing )
    {
    if(components != null)
    {
    components.dispose();
    }
    }
    base.dispose( disposing );
    }

    #region windows 窗體設計器生成的代碼
    /// <summary>
    /// 設計器支持所需的方法 - 不要使用代碼編輯器修改
    /// 此方法的內容。
    /// </summary>
    private void initializecomponent()
    {
    this.crview = new crystaldecisions.windows.forms.crystalreportviewer();
    this.suspendlayout();
    //
    // crview
    //
    this.crview.activeviewindex = -1;
    this.crview.dock = system.windows.forms.dockstyle.fill;
    this.crview.location = new system.drawing.point(0, 0);
    this.crview.name = "crview";
    this.crview.reportsource = null;
    this.crview.showrefreshbutton = false;
    this.crview.size = new system.drawing.size(640, 509);
    this.crview.tabindex = 0;
    //
    // frmcrystalview
    //
    this.autoscalebasesize = new system.drawing.size(6, 14);
    this.clientsize = new system.drawing.size(640, 509);
    this.controls.add(this.crview);
    this.name = "frmcrystalview";
    this.text = "預覽報表";
    this.load += new system.eventhandler(this.frmcrystalview_load);
    this.resumelayout(false);

    }
    #endregion

    private void frmcrystalview_load(object sender, system.eventargs e)
    {
    reportdocument rdview=new reportdocument();
    rdview.load(@strinfo[0]);
    foreach (table tbview in rdview.database.tables)
    {
    tablelogoninfo tliview=new tablelogoninfo();
    tliview=tbview.logoninfo;
    tliview.connectioninfo.servername=strinfo[1];
    tliview.connectioninfo.databasename=strinfo[2];
    tliview.connectioninfo.userid=strinfo[3];
    tliview.connectioninfo.password=strinfo[4];
    tbview.applylogoninfo(tliview);
    }

    string [] strparameter=strinfo[5].split(new char[] {'+'});
    for (int i=0;i<strparameter.length;i++)
    {
    string [] strsubparam=strparameter[i].split(new char[] {'='});
    parametervalues pvvalue=new parametervalues();
    parameterdiscretevalue pdvvalue=new parameterdiscretevalue();
    pdvvalue.value=strsubparam[1];
    pvvalue.add(pdvvalue);
    rdview.datadefinition.parameterfields[strsubparam[0]].applycurrentvalues(pvvalue);
    }
    crview.reportsource=rdview;
    this.location = new point(0, 0);
    this.size = new system.drawing.size(1024,744);
    }
    }
    }



    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 大埔区| 临清市| 湖北省| 会宁县| 凤台县| 四川省| 安福县| 蕉岭县| 手游| 新安县| 开江县| 晋宁县| 平远县| 三门峡市| 吉安市| 康平县| 塔城市| 廉江市| 托里县| 虹口区| 蓬安县| 黑龙江省| 荃湾区| 象山县| 三亚市| 伊川县| 陇川县| 湟源县| 新竹县| 左贡县| 登封市| 广安市| 塔河县| 卓资县| 江山市| 南雄市| 大姚县| 屏东县| 屏东县| 辛集市| 牙克石市|