DataGrid的列印(三)

2021-04-07 08:43:01 字數 1133 閱讀 2681

if(dlg.domodal() == idcancel)

return;

// create a cdc and attach it to the default printer

cdc dcprinter;

dcprinter.attach(dlg.createprinterdc());

// initialize docinfo

docinfo docinfo;

memset(&docinfo, 0, sizeof(docinfo));

docinfo.cbsize = sizeof(docinfo);

cstring title;

getwindowtext(title);

docinfo.lpszdocname = title;

// if it fails, complain and exit gracefully

if (dcprinter.startdoc(&docinfo) < 0)

bool bprintheader = _chkprint.getcheck() == bst_checked;

bool bprintfooter = _chkprint.getcheck() == bst_checked;

cprinthelper helper(&dcprinter, bprintheader, bprintfooter);

// 變數初始化:

int gridrowcount = m_grid.getrows();

int rowpos = 1;

int page = 1;

while(rowpos < gridrowcount)

helper.printheader(strtitletext.c_str(), _startyear, _startimage , _endyear, _endimage);

helper.printgridheader();

rowpos = helper.printpage(m_grid, rowpos);

helper.printfooter(page);

dcprinter.endpage();

++page;

}dcprinter.enddoc();

}

DataGrid的列印(二)

include stdafx.h include printhelper.h include math.h include static const unsigned int grid width static const unsigned int a3 width 420 cprinthelper...

DataGrid的列印預覽和列印

using system using system.drawing using system.collections using system.componentmodel using system.windows.forms using system.data using system.data....

C 列印DataGrid中的資料

對於資訊系統,列印功能是必須的。而列印,是一件相當麻煩的事情。列印datagrid中的資料,尤其如此。要想到的很多,包括頁首 頁尾設定,列印字型,分頁,標題,預覽等等一系列問題。如果從頭寫,工作量實在太大。網路上有很多c 寫的列印datagrid類 我幾乎挨個嘗試了個遍,要麼就是不能正常使用,要麼就...

Flex實踐 Datagrid的列印預覽與列印

height 450 width 550 public function doprint void sam sam.com fontweight bold component myprintview.mxml 這是一個元件 backgroundcolor ffffff height 250 widt...

在C 裡實現DATAGRID的列印預覽和列印

作者blog 很多人都在論壇裡問,如何實現datagrid的列印預覽和列印,現在我就把這方面的源 告訴大家。這段 也花費了我1個晚上的時間,呵呵!資料庫是基於sql server2000自帶的northwind。源 如下 using system using system.drawing using...