?? 控件使用說明.txt
字號:
報表打印控件myprint使用說明:
調用方法:
Login(username as string,regcode as string) '系統登錄,用戶名、注冊碼
SetRowCount(rows as Integer) '設置表格的行數
SetColumnCount(cols as Integer) '設置表格的列數
SetRowHeight(nRow as Integer,height as Integer) '設置行高
SetColumnWidth(nCol as Integer,width as Integer) '設置列寬
SetFixedRows(nrow as Integer)'設置不滾動區域,通常將報表頭設為不滾動區域
JoinCell(startrow as integer,startcol as integer,endrow as integer,endcol as integer) '合并多個單元格
HideCellLines(nrow as integer,ncol as integer,nline as integer) '隱藏某個單元個的表格線
PrintPreview() '打印預覽
Print() '打印
SetCellText(row as Integer,col as Integer,txt as String,horzStyle as Integer,vertStyle as Integer,multilines as intger,fontname As string,fontsize as integer)
'設置單元格的顯示文本、風格、字體、大小
SetTitle(title as String ,fontname As string ,fontsize as Integer) '設置報表標題
SetHeader(lefttitle as string,righttitle as string ,fontname As string ,fontsize as Integer) '設置表眉
SetFooter(lefttitle as string,righttitle as string ,fontname As string ,fontsize as Integer) '設置表腳
DrawHeaderText(posx As Integer,posy As Integer,nText As string) '在表頭顯示文本
AutoSize() '單元格是否自動根據字符串大小自動縮放
FitToPaperSize(bFit as Integer)'是否根據紙張大小縮放報表
AlignCenter(bCenter as integer)'是否居中
SetLineWidth(nwidth as Integer)'設置整個報表的線寬
SetUserPaperSize(width,length) '設置自定義紙張大小,以毫米為單位
以下為VB語法的簡單例子
Dim Grid As Variant
Dim count As Integer
Set Grid = CreateObject("MyPrint.GridCtrl")
count = 60
Call Grid.Login("用戶名", "2444-22AB-856F-14A6")
Call Grid.SetRowCount(count + 1)
Call Grid.SetColumnCount(7)
Call Grid.SetCellText(0, 0, "姓名", 1,1,0, "宋體", 13)
Call Grid.SetCellText(0, 1, "性別", 0,1,0, "宋體", 13)
Call Grid.SetCellText(0, 2, "出生年月", 0,1,0, "宋體", 13)
Call Grid.SetCellText(0, 3, "地址", 0,1,0, "宋體", 13)
Call Grid.SetCellText(0, 4, "畢業學校", 0,1,0, "宋體", 13)
Call Grid.SetCellText(0, 5, "所學專業", 0,1,0, "宋體", 13)
Call Grid.SetCellText(0, 6, "工作單位", 0,1,0, "宋體", 13)
Dim J As Integer
J = 1
For J = 1 To count
Call Grid.SetCellText(J, 0, "testddddddd" & CStr(J), 1, 0,0,"宋體", 13)
Call Grid.SetCellText(J, 3, "中國報表aaaaaaaaaaa" & CStr(J), 1, 1, 0, "楷體GB2312", 16)
Next
Call Grid.AutoSize
Call Grid.SetFixedRow(1)
Call Grid.SetTitle("報表打印控件演示", "宋體", 16)
Dim date1 As String
date1 = CStr(Year(Now)) + "年" + CStr(Month(Now)) + "月"
Call Grid.SetHeader("", date1, "宋體", 13)
Call Grid.PrintPreview
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -