|
2008-07-11, 11:11 下午
|
小林子


 职务: 版主
 等级: 排长
注册: 2005年11月10日
积分: 99
精华: 0
发贴: 84
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
//方法:InnerPrint
//功能:打印报表
//参数:无
//返回:无
//备注:无
//////////////////////////////////////////////////////////////////////////////
void __fastcall TPrintXImpl::InnerPrint()
{
FILE *prn = NULL;
//初始化打印设备
if (this->printerName == NULL || this->printerName.IsEmpty())
{
prn = fopen("prn", "w");
}
else
{
prn = fopen(this->printerName.c_str(), "w");
}
//检测打印设备
Check(prn);
TStringList *dataLines = P***DataSource(this->dataSourceString);
if (dataLines == NULL)
{
throw Exception("数据源为空!");
}
//打印
for (int i=0; i<dataLines->Count; i++)
{
/*
if (i == 0)
{
PrintOptions printOptions;
printOptions.Center = true;
printOptions.FontSize = -1;
InnerPrintLine(prn, dataLines->Strings , printOptions);
}
else
{
InnerPrintLine(prn, dataLines->Strings );
}
*/
InnerPrintLine(prn, dataLines->Strings );
}
//切纸操作
if (bCutPaper)
{
this->InnerCutPaper(prn);
}
else
{
this->InnerEndPrint(prn);
}
if (dataLines != NULL)
{
delete dataLines;
dataLines = NULL;
}
if (prn != NULL)
{
//关闭打印设备
fclose(prn);
prn = NULL;
}
}
|
|
|
IP 地址: 已登录
来自: 已登录
|
|
|
|
|
|
|
|