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

📄 excelhandler.h

📁 基础数据管理工具 主要针对政务系统的基础数据管理、分析、应用等功能! 项目代码
💻 H
字号:
// ExcelHandler.h: interface for the CExcelHandler class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EXCELHANDLER_H__26446E50_E013_4DD8_9A65_8A1492C9F2F0__INCLUDED_)
#define AFX_EXCELHANDLER_H__26446E50_E013_4DD8_9A65_8A1492C9F2F0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifdef _EXPORT_BASEFUNC_
#define EXPORT_BASE_DLL		__declspec(dllexport)
#else
#define EXPORT_BASE_DLL		__declspec(dllimport)
#endif

class EXPORT_BASE_DLL CExcelHandler  
{
public:
	CExcelHandler();
	virtual ~CExcelHandler();

	bool Instantiation();
	//bool Instantiation(LPCTSTR lsFilePath,LPCTSTR sSheetName = "",bool isvisual=true);
	bool Instantiation(LPCTSTR lsFilePath,bool isvisual=false);
	void Clean();

	_variant_t GetCellItem(long IRow,long ICol);

	void ShowApp();
	void SetCulSheet(_WorksheetPtr pSheet);
	void SetCulSheet(LPCTSTR lsSheetName);
	void SetCellFont(LPCTSTR lsName,LPCTSTR lsStyle,long lsSize,Excel::RangePtr pRange=NULL);
	void SetAllSheetVisible(bool bVisible);

	bool GetCurSheet(_Worksheet **ppxlSheet);
	void SaveBook(LPCTSTR lsFilePath,_WorkbookPtr pBook = NULL);
	void MergeCells(Excel::RangePtr pRange,LPCTSTR lsShowText);
	void SetCellBorder(Excel::RangePtr pRange=NULL,XlBorderWeight xlWeight=xlThin,Constants xlColorIndex=xlAutomatic,XlLineStyle xlLineStyle=xlContinuous);
	void SetCellBackColor(Excel::RangePtr pRange,long lRed=255,long lYellow=255,long lBlue=255);
	void SetCellItem(long lRow,long lCol,LPCTSTR lsValue,_WorksheetPtr pSheet = NULL);
	_WorksheetPtr GetSheet();
	void GetSheet(LPCTSTR lsSheetName, SheetsPtr pxlSheets,_Worksheet **ppxlSheet);
	void GetRange(long lStartCol,long lStartRow,long lEndCol,long lEndRow,Excel::Range** ppRange,_WorksheetPtr pSheet=NULL);
	CString GetColumnCode(int iCol);
	
	int GetSheetCount();
	CString GetSheetName(int iSheetIndex);

	Excel::_ApplicationPtr		m_pApp;
	WorkbooksPtr		m_pBooks;
	_WorkbookPtr		m_pBook;
	SheetsPtr			m_pSheets;
private:
	_WorksheetPtr		m_pSheet;
};

#endif // !defined(AFX_EXCELHANDLER_H__26446E50_E013_4DD8_9A65_8A1492C9F2F0__INCLUDED_)

⌨️ 快捷键说明

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