日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
C#水晶報(bào)表數(shù)據(jù)獲取方法實(shí)例淺析

C#水晶報(bào)表數(shù)據(jù)獲取方法有很多,那么這里主要向你介紹一個(gè)通過提取模式的方法來實(shí)現(xiàn)C#水晶報(bào)表數(shù)據(jù)獲取方法,那么具體的實(shí)現(xiàn)步驟是什么呢?讓我們看看具體的實(shí)現(xiàn)代碼:

C#水晶報(bào)表數(shù)據(jù)獲取方法實(shí)例演示:

 
 
 
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using CrystalDecisions.CrystalReports.Engine;
  7. using CrystalDecisions.Shared;
  8. namespace DLLCrystal
  9. {
  10. /// ﹤summary﹥
  11. /// frmCrystalView 的摘要說明。
  12. /// ﹤/summary﹥
  13. internal class frmCrystalView : System.Windows.Forms.Form
  14. {
  15. private CrystalDecisions.Windows.Forms.CrystalReportViewer crView;
  16. /// ﹤summary﹥
  17. /// 必需的設(shè)計(jì)器變量。
  18. /// ﹤/summary﹥
  19. private System.ComponentModel.Container components = null;
  20. private string[] strInfo;
  21. public frmCrystalView(string[] strInfomation)
  22. {
  23. //
  24. // C#水晶報(bào)表數(shù)據(jù)的獲取方法之Windows 窗體設(shè)計(jì)器支持所必需的
  25. //
  26. InitializeComponent();
  27. //
  28. // TODO: 在 InitializeComponent 調(diào)用后添加任何構(gòu)造函數(shù)代碼
  29. //
  30. strInfo=strInfomation;
  31. }
  32. /// ﹤summary﹥
  33. /// C#水晶報(bào)表數(shù)據(jù)獲取方法之清理所有正在使用的資源。
  34. /// ﹤/summary﹥
  35. protected override void Dispose( bool disposing )
  36. {
  37. if( disposing )
  38. {
  39. if(components != null)
  40. {
  41. components.Dispose();
  42. }
  43. }
  44. base.Dispose( disposing );
  45. }
  46. #region Windows 窗體設(shè)計(jì)器生成的代碼
  47. /// ﹤summary﹥
  48. /// C#水晶報(bào)表數(shù)據(jù)獲取方法之設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
  49. /// 此方法的內(nèi)容。
  50. /// ﹤/summary﹥
  51. private void InitializeComponent()
  52. {
  53. this.crView = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
  54. this.SuspendLayout();
  55. // 
  56. // crView
  57. // 
  58. this.crView.ActiveViewIndex = -1;
  59. this.crView.Dock = System.Windows.Forms.DockStyle.Fill;
  60. this.crView.Location = new System.Drawing.Point(0, 0);
  61. this.crView.Name = "crView";
  62. this.crView.ReportSource = null;
  63. this.crView.ShowRefreshButton = false;
  64. this.crView.Size = new System.Drawing.Size(640, 509);
  65. this.crView.TabIndex = 0;
  66. // 
  67. // frmCrystalView
  68. // 
  69. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  70. this.ClientSize = new System.Drawing.Size(640, 509);
  71. this.Controls.Add(this.crView);
  72. this.Name = "frmCrystalView";
  73. this.Text = "預(yù)覽報(bào)表";
  74. this.Load += new System.EventHandler(this.frmCrystalView_Load);
  75. this.ResumeLayout(false);
  76. }
  77. #endregion
  78. private void frmCrystalView_Load(object sender, System.EventArgs e)
  79. {
  80. ReportDocument rdView=new ReportDocument();
  81. rdView.Load(@strInfo[0]);
  82. foreach (Table tbView in rdView.Database.Tables)
  83. TableLogOnInfo tliView=new TableLogOnInfo();
  84. tliView=tbView.LogOnInfo;
  85. tliView.ConnectionInfo.ServerName=strInfo[1];
  86. tliView.ConnectionInfo.DatabaseName=strInfo[2];
  87. tliView.ConnectionInfo.UserID=strInfo[3];
  88. tliView.ConnectionInfo.Password=strInfo[4];
  89. tbView.ApplyLogOnInfo(tliView);
  90. }
  91. string [] strParameter=strInfo[5].Split(new char[] {+});
  92. for (int i=0;i﹤strParameter.Length;i++)
  93. {
  94. string [] strSubParam=strParameter[i].Split(new char[] {=});
  95. ParameterValues pvValue=new ParameterValues();
  96. ParameterDiscreteValue pdvValue=new ParameterDiscreteValue();
  97. pdvValue.Value=strSubParam[1];
  98. pvValue.Add(pdvValue);
  99. rdView.DataDefinition.
  100. ParameterFields[strSubParam[0]].ApplyCurrentValues(pvValue);
  101. }
  102. crView.ReportSource=rdView;
  103. this.Location = new Point(0, 0);
  104. this.Size = new System.Drawing.Size(1024,744);
  105. }
  106. }//C#水晶報(bào)表數(shù)據(jù)獲取方法
  107. }

C#水晶報(bào)表數(shù)據(jù)獲取方法的具體事宜就向你介紹到這里,希望那個(gè)對你了解和學(xué)習(xí)C#水晶報(bào)表數(shù)據(jù)獲取方法有所幫助。


本文標(biāo)題:C#水晶報(bào)表數(shù)據(jù)獲取方法實(shí)例淺析
文章網(wǎng)址:http://www.dlmjj.cn/article/dpedjcc.html