自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

開發(fā) 后端
C#水晶報(bào)表數(shù)據(jù)獲取方法是什么呢?我們?cè)趯?shí)際的開發(fā)中是如何獲取C#水晶報(bào)表數(shù)據(jù)呢?這里我們主要向你講述了通過提取模式的方法來實(shí)現(xiàn)。

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

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

【編輯推薦】

  1. C#創(chuàng)建一個(gè)文件的具體實(shí)現(xiàn)淺析
  2. C#打開一個(gè)文件的操作詳解
  3. C#實(shí)現(xiàn)string和byte數(shù)組的轉(zhuǎn)換
  4. C# Byte數(shù)組轉(zhuǎn)換String詳解
  5. 詳解C#調(diào)用水晶報(bào)表的實(shí)現(xiàn)
責(zé)任編輯:仲衡 來源: opent.cn
相關(guān)推薦

2009-08-31 15:11:23

C#調(diào)用水晶報(bào)表

2009-08-31 15:54:35

2009-07-30 13:57:39

ASP.NET水晶報(bào)表ASP.NET

2009-09-07 19:03:08

2009-11-05 14:03:28

Visual Stud

2009-07-29 09:29:06

ASP.NET水晶報(bào)表

2009-12-15 17:20:07

VS 水晶報(bào)表

2009-08-02 11:48:58

ASP.NET水晶報(bào)表ASP.NET

2010-01-14 10:52:13

VB.NET水晶報(bào)表

2009-10-16 13:30:51

VB.NET水晶報(bào)表控

2009-08-25 17:00:32

ASP.NET水晶報(bào)表

2009-08-27 13:30:11

C# interfac

2009-08-31 16:09:42

.net水晶報(bào)表使用學(xué)

2009-08-17 17:49:20

C# 枚舉

2009-09-09 13:57:28

C# XML解析

2009-12-01 13:50:19

VS2003水晶報(bào)表

2009-11-26 13:27:10

VS2003水晶報(bào)表

2009-08-18 13:49:21

C# 操作Excel

2009-08-27 17:59:56

C#接口定義

2009-08-19 16:30:55

C#操作Access數(shù)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)