新文章

2010年7月29日 星期四

[ C# ] Crystal Reports 簡介




約略介紹 Crystal Reports 常用性質整理..




CrystalReportsViewer常用屬性
BackgroundImage 取得或設定背景圖像
DisplayGroupTree 取得或設定[樹狀可視檢視]是可見還是隱藏的
DisplayStatusBar 取得或設定[狀態列]是可見還是隱藏的
DisplayToolBar  取得或設定[工具列]是可見還是隱藏的
EnableDrillDown  取得或設定使用者是否可以擷取報表的細目
enableToolTips  取得或設定是否顯示工具提示
enterpriseLogin  取得或設定企業報表的登入資訊
LogOnInfo  用來取得或設定TableLogOnInfos集合
ReportSource  設定與crystalreportview連結的報表
SelectionFormula 取得或設定報表的選擇公式
showexportbutton 取得或設定是否有匯出的按鈕
showgrouptreebutton 取得或設定工具列是否有可顯示或隱藏的[群組樹狀結構]的按鈕
viewcont   取得檢視數目
viewTimeselectionFormula 取得或設定資料選擇公式,以千篩選報表中的資料
crystalReportViewer的常用方法
closeview()
drilldwonongroup() 群組的細目
exportreport()  匯出顯示的報表
GetCurrentPageNumber 取得報表的目前頁碼
printReport()  列印報表
refreshReport()
searchfortext()  返回true/false
showfirstpage()  報表第一頁
showgrouptree()
showlastpage()
shownextpage()
showNthpage(N)  顯示第n頁n<1 無動作 N>總頁數,則顯示最後一頁
showpreviouspage()
zoom(percent)  percent=1 頁寬 percent=2 整頁 percent=80 縮小為80%
crystalreportviewer的常用事件
AfterRender 報表建構程序結束時觸發
beforeRender 報表建構程序開始時觸發
drill
navigate 濟覽報表時觸發
reportrefresh
search
crystalreport分五個區段
報表首:可放圖表或交叉表,在此的內容只會在報表的開頭列印一次
首頁:   不可放圖表或交叉表,在此的內容會在每個新頁開頭列印
細目: 不可放圖表或交叉表.
報表尾:可放圖表或交叉表,在此的內容會在報表的結尾列印一次。ex:此區常放總計
頁尾: 不可放圖表或交叉表,放在此區的會在每頁的頁尾列印
ReportDocumet 元件
ReportDocuemnt常用屬性
Database :取得data物件
DataSourceConnections: 包含報表中所有表格的連接資訊
ExportOptions:
Filename: 指定報表檔案名稱。如有指定通訊協定或磁碟代號,則使用ras://為預設值
FilePath: 指定報表檔案的路徑,其中不含通訊協定前置字元
IsSubReport: 用來取得報表是否為子報表
RecordSelectionformula 用來取得或設定資料選擇公式
subReport 用來取得subreport物件
ReportDocument常用方法
close()
export() 將報表匯出至exportoptions物個中指定的格式與目的地
exporttodisk() 以指定格式將報表蕉出至檔案 ex:export.ExportToDisk(exportFormatType.Richtext,"report.rtf")
exportToHttpResponse() 以指定的格式將報表匯出至回應換件。
load()
opensubreport()
refresh()
setDatabaseLogon() 賬號密碼登入資訊 report.setdatabaseLogon("admin","pass");
verifydatabase() 檢查報表是否與資料庫保持連線

沒有留言:

張貼留言