C 建立報表過程詳解

2022-09-26 07:21:14 字數 1097 閱讀 7562

1、新建windows窗體,專案-->新增新項-->visual c#項-->windows form-->windows窗體。

2、窗體中加入button按鈕和報表控制項。

3、新建報表,專案-->新增新項-->reporting-->報表,生成.rdlc檔案。

4、在.rdlc上插入**-->新建資料來源-->資料庫-->資料集-->新建連線,步驟如下:

5、這裡輸入資料庫連線的伺服器名,登入資料庫的使用者名稱和密碼,選擇資料庫名稱。

6、選擇需要用的表。

7、名稱可以自己寫,本人沒改,資料來源為自己選擇的資料庫名稱,可用資料集為表名。

8、.rdlc介面在**的第一行輸入欄位名,第二行點選每列右程式設計客棧上角的小圖示選擇該列要顯示的欄位名。

9、回到form窗體點選報表右上角的小三角,選擇剛剛建立的報表report1.rdlc,資料來源預設的就可以,本人在這裡沒有修改資料來源名稱還是dataset1.

10、後台**

public form1()

private void button1_click(object sender, eventargs e)//button點選事件

private void form1_load(object sender, eventargs e)

private void reportviewer1_load(object sender, eventargs e)

datatable table = helps.getdatatable("select id,us程式設計客棧erid,oid from user_org where 1=1");

this.reportviewer1.localreport.datasources.add(new microsoft.reporting.winforms.reportdatasource("dataset1", table));

this.reportviewer1.refreshreport();

執行程式載入:

點選button

這裡寫的是點選button後才載入數oglrw據。

本文標題: c# 建立報表過程詳解

本文位址: /ruanjian/csharp/127137.html

C 建立鍊錶的過程詳解

整體的 include using namespace std struct node 建立 node creatlist int n return head 顯示 void display node head cout n int main 解釋 根據上圖,利用資料結構struct建立乙個節點 s...

spring Bean建立過程詳解

強烈建議大家從git上拉取spring原始碼來學習spring原始碼。因為裡面相較於idea生成的會有注釋,裡面有的方法會有注釋看起來會省力一點。以下都是用5.0.2版本來做闡述。寫在前面 建議大家一定要自己用例項跑一遍,做好記錄。如果只是看看會非常抽象。此流程圖作為梗概,便於加強記憶和理解,新手或...

水晶報表 建立報表

水晶報表是乙個優秀的報表開發工具,本人在開發通用管理系統的時候,所有報表都使用水晶報表,其簡單 易用和強大的功能令筆者倍加喜愛,現將水晶報表使用手記呈現給大家。一 在使用自帶的水晶報表時,請註冊,否則只能使用30次 二 使用crystalreportviewer進行預覽 crystalreportv...