⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cnreport.h

📁 自定义的报表
💻 H
📖 第 1 页 / 共 2 页
字号:
	int FBottomLineWidth;

        // 斜线
	unsigned FDiagonal;

        // color
	unsigned FTextColor;
	unsigned FBackGroundColor;

        // align
	int FHorzAlign;
	int FVertAlign;

        // string
	AnsiString FCellText;

        // font
	tagLOGFONTA FLogFont;

	int __fastcall GetCellHeight(void);
	int __fastcall GetCellTop(void);
	int __fastcall GetOwnerLineHeight(void);

protected:
	void __fastcall SetLeftMargin(int LeftMargin);
	void __fastcall SetOwnerLine(TCNReportLine* OwnerLine);
	void __fastcall SetOwnerCell(TCNReportCell* Cell);
	int __fastcall GetOwnedCellCount(void);
	void __fastcall SetCellLeft(int CellLeft);
	void __fastcall SetCellWidth(int CellWidth);
	void __fastcall SetLeftLine(bool LeftLine);
	void __fastcall SetLeftLineWidth(int LeftLineWidth);
	void __fastcall SetTopLine(bool TopLine);
	void __fastcall SetTopLineWidth(int TopLineWidth);
	void __fastcall SetRightLine(bool RightLine);
	void __fastcall SetRightLineWidth(int RightLineWidth);
	void __fastcall SetBottomLine(bool BottomLine);
	void __fastcall SetBottomLineWidth(int BottomLineWidth);
	void __fastcall SetCellText(AnsiString CellText);
	void __fastcall SetLogFont(const tagLOGFONTA &NewFont);
	void __fastcall SetBackGroundColor(unsigned BkColor);
	void __fastcall SetTextColor(unsigned TextColor);

public:
	void __fastcall AddOwnedCell(TCNReportCell* Cell);
	void __fastcall RemoveAllOwnedCell(void);
	void __fastcall RemoveOwnedCell(TCNReportCell* Cell);
	bool __fastcall IsCellOwned(TCNReportCell* Cell);
	void __fastcall CalcCellRect(void);
	void __fastcall CalcMinCellHeight(void);
	void __fastcall PaintCell(HDC hPaintDC, bool bPrint);
	void __fastcall CopyCell(TCNReportCell* Cell, bool bInsert);

	__fastcall TCNReportCell(void);
	__fastcall virtual ~TCNReportCell(void);

public:
	__property int LeftMargin = {read=FLeftMargin, write=SetLeftMargin, nodefault};
	__property TCNReportLine* OwnerLine = {read=FOwnerLine, write=SetOwnerLine};
	__property TCNReportCell* OwnerCell = {read=FOwnerCell, write=SetOwnerCell};
	__property int OwnedCellCount = {read=GetOwnedCellCount, nodefault};
	__property int CellIndex = {read=FCellIndex, write=FCellIndex, nodefault};
	__property int CellLeft = {read=FCellLeft, write=SetCellLeft, nodefault};
	__property int CellWidth = {read=FCellWidth, write=SetCellWidth, nodefault};
	__property int CellTop = {read=GetCellTop, nodefault};
	__property int CellHeight = {read=GetCellHeight, nodefault};
	__property TRect CellRect = {read=FCellRect};
	__property TRect TextRect = {read=FTextRect};
	__property int DragCellHeight = {read=FDragCellHeight, nodefault};
	__property int MinCellHeight = {read=FMinCellHeight, write=FMinCellHeight, nodefault};
	__property int RequiredCellHeight = {read=FRequiredCellHeight, nodefault};
	__property int OwnerLineHeight = {read=GetOwnerLineHeight, nodefault};
	__property bool LeftLine = {read=FLeftLine, write=SetLeftLine, default=1};
	__property int LeftLineWidth = {read=FLeftLineWidth, write=SetLeftLineWidth, default=1};
	__property bool TopLine = {read=FTopLine, write=SetTopLine, default=1};
	__property int TopLineWidth = {read=FTopLineWidth, write=SetTopLineWidth, default=1};
	__property bool RightLine = {read=FRightLine, write=SetRightLine, default=1};
	__property int RightLineWidth = {read=FRightLineWidth, write=SetRightLineWidth, default=1};
	__property bool BottomLine = {read=FBottomLine, write=SetBottomLine, default=1};
	__property int BottomLineWidth = {read=FBottomLineWidth, write=SetBottomLineWidth, default=1};
	__property unsigned Diagonal = {read=FDiagonal, write=FDiagonal, nodefault};
	__property unsigned TextColor = {read=FTextColor, write=SetTextColor, default=0};
	__property unsigned BkColor = {read=FBackGroundColor, write=SetBackGroundColor, default=16777215};
	__property int HorzAlign = {read=FHorzAlign, write=FHorzAlign, default=1};
	__property int VertAlign = {read=FVertAlign, write=FVertAlign, default=1};
	__property AnsiString CellText = {read=FCellText, write=SetCellText};
	__property tagLOGFONTA LogFont = {read=FLogFont, write=SetLogFont};

};
class TCNDataSetItem : public TObject
{
public:
	TDataSet* pDataset;
	AnsiString strName;
public:
        inline __fastcall TCNDataSetItem(void) : TObject() { }
        inline __fastcall virtual ~TCNDataSetItem(void) { }

};
class TCNVarTableItem : public TObject
{
public:
	AnsiString strVarName;
	AnsiString strVarValue;
        double VarValue;        //2002-02-04
public:
        inline __fastcall TCNVarTableItem(void) : TObject() { }
        inline __fastcall virtual ~TCNVarTableItem(void) { }
};
class TCNFieldAliasTableItem : public TObject
{
public:
	AnsiString strTrueName;    //字段原名
	AnsiString strAlias;   //中文别名
public:
        inline __fastcall TCNFieldAliasTableItem(void) : TObject() { }
        inline __fastcall virtual ~TCNFieldAliasTableItem(void) { }
};

class TCNMyRect : public TObject
{
public:
	int Left;
	int Top;
	int Right;
	int Bottom;
public:
        inline __fastcall TCNMyRect(void) : TObject() { }
        inline __fastcall virtual ~TCNMyRect(void) { }

};
class TCNCellTable : public TObject
{
public:
	TCNReportCell* PrevCell;
	TCNReportCell* ThisCell;
public:
        inline __fastcall TCNCellTable(void) : TObject() { }
        inline __fastcall virtual ~TCNCellTable(void) { }
};

class PACKAGE TCNReportRunTime : public TComponent
{
private:
	AnsiString FFileName;
	bool FAutoGroup;
	bool FEnableEdit;
        TList* FDList;          // 保存数据集的指针和名称的对照
        TList* FFieldAliasList; // 字段别名列表
        TList* FVarList;        // 保存变量的名字和值的对照表
        TList* FLineList;       // 保存报表的设计信息(从文件中读入)
        TList* FPrintLineList;  // 保存要打印的某一页的行信息
        TList* FOwnerCellList;  // 保存每一页中合并后单元格前后的指针
	int Width;
	int Height;

        // 定义换页加表头
	bool FNewTable;

        // 定义打印多少行后从新加表头
	int FDataLine;
	int FTablePerPage;
	int FReportScale;
	int FPageWidth;
	int FPageHeight;
	int FHeaderHeight;

	bool Fallprint; //是否打印全部记录,默认为全部
        
	int FLeftMargin;
	int FRightMargin;
	int FTopMargin;
	int FBottomMargin;

	int FLeftMargin1;
	int FRightMargin1;
	int FTopMargin1;
	int FBottomMargin1;

	int FPageCount; // page count in print preview         

	void __fastcall UpdateLines(void);
	void __fastcall UpdatePrintLines(void);
	void __fastcall PrintOnePage(void);
	void __fastcall LoadRptFile(void);

	AnsiString __fastcall GetDatasetName(AnsiString strCellText);
	TDataSet* __fastcall GetDataset(AnsiString strCellText);
	TDataSet* __fastcall DatasetByName(AnsiString strDatasetName);
	AnsiString __fastcall GetVarValue(AnsiString strVarName);
	AnsiString __fastcall GetExpValue(AnsiString strExp);   //取得表达式的值
	AnsiString __fastcall GetFieldName(AnsiString strCellText);

	void __fastcall SetRptFileName(const AnsiString Value);
	void __fastcall SaveTempFile(int PageNumber);
	void __fastcall LoadTempFile(AnsiString strFileName);
	void __fastcall DeleteAllTempFiles(void);
	void __fastcall SetAutoGroup(bool Value);
	void __fastcall SetEnableEdit(bool Value);

public:
	void __fastcall SetDataSet(AnsiString strDatasetName, TDataSet* pDataSet);
	void __fastcall SetFieldAlias(AnsiString TrueName, AnsiString Alias);
	void __fastcall SetVarValue(AnsiString strVarName, AnsiString strVarValue);
	void __fastcall SetExpVarValue(AnsiString strVarName, double Value);
	void __fastcall ResetContent(void);
	void __fastcall PrintPreview(bool bPreviewMode);
	void __fastcall PreparePrint(void);
	void __fastcall loadfile(AnsiString value);
	void __fastcall Print(void);
	void __fastcall Resetself(void);
	bool __fastcall Cancelprint(void);

	__property bool allprint = {read=Fallprint, write=Fallprint, default=1};
__published:
	__property AnsiString ReportFile = {read=FFileName, write=SetRptFileName};
	__property bool AutoGroup = {read=FAutoGroup, write=SetAutoGroup, default=1};
	__property bool EnableEdit = {read=FEnableEdit, write=SetEnableEdit, nodefault};

public:
	__fastcall virtual TCNReportRunTime(TComponent* AOwner);
	__fastcall virtual ~TCNReportRunTime(void);

};
bool __fastcall DeleteFiles(AnsiString FilePath, AnsiString FileMask);

//******************************************************************************
extern int pgw;
extern int pgh;
extern int scale;
extern int IsPrint;
extern TCNReportCell* cellline_d;
extern TCNReportCell* celldisp;

#endif
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -