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

📄 reportwzdpreview.cpp

📁 一个很好的VC++ 用ODBC编的
💻 CPP
字号:
// ReportWzdPreview.cpp : implementation file
//

#include "stdafx.h"
#include "ODBCDemo2.h"
#include "ReportWzdPreview.h"
#include "ReportWizard.h"
#include "ODBCDemo2View.h"
#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CReportWzdPreview property page

IMPLEMENT_DYNCREATE(CReportWzdPreview, CPropertyPage)

CReportWzdPreview::CReportWzdPreview() : CPropertyPage(CReportWzdPreview::IDD)
{
	//{{AFX_DATA_INIT(CReportWzdPreview)
	m_strReportInfo = _T("");
	//}}AFX_DATA_INIT
}

CReportWzdPreview::~CReportWzdPreview()
{
}

void CReportWzdPreview::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CReportWzdPreview)
	DDX_Text(pDX, IDC_REPORTINFO, m_strReportInfo);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CReportWzdPreview, CPropertyPage)
	//{{AFX_MSG_MAP(CReportWzdPreview)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CReportWzdPreview message handlers

BOOL CReportWzdPreview::OnSetActive() 
{
	// TODO: Add your specialized code here and/or call the base class
   	CReportWizard *psheet = (CReportWizard *) GetParent();   
	psheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);

	CString strReportFields;
	strReportFields.Empty();
	for(int i=0;i<psheet->m_saSelectedFields.GetSize();i++){
		strReportFields += psheet->m_saSelectedFields.GetAt(i);
		if(i+1 < psheet->m_saSelectedFields.GetSize())
			strReportFields += _T("、");
	}
	CString strPageInfo;
	if(psheet->m_fHavePage){
		strPageInfo = _T("使用页码,");
		switch(psheet->m_uPageType){
		case 0: strPageInfo += _T("底部左对齐"); break;
		case 1: strPageInfo += _T("底部左居中"); break;
		case 2: strPageInfo += _T("底部右对齐"); break;
		}
	}
	else strPageInfo = _T("不使用页码");

	m_strReportInfo.Format("您设置的报表格式如下:\n报表标题: %s, 字体名称: %s, 字体大小: %d\n报表字段: %s, 字体名称: %s, 字体大小: %d\n报表注脚: %s, 字体名称: %s, 字体大小: %d\n\n%s",
					psheet->m_strReportTitle, psheet->m_strFontTitle, psheet->m_uSizeTitle,
					strReportFields,psheet->m_strFontContent, psheet->m_uSizeContent,
					psheet->m_strReportFooter,psheet->m_strFontFooter, psheet->m_uSizeFooter,
					strPageInfo);
	UpdateData(FALSE);

	
	return CPropertyPage::OnSetActive();
}

BOOL CReportWzdPreview::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here
	

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CReportWzdPreview::OnWizardFinish() 
{
   	CReportWizard *psheet = (CReportWizard *) GetParent();   
	if(!psheet) return FALSE;
	
	// get view pointer
	CMainFrame *pMainFrm = (CMainFrame *)AfxGetMainWnd();
	CODBCDemo2View *pView = (CODBCDemo2View *)pMainFrm->GetActiveView();

	//
	int nCount = psheet->m_saSelectedFields.GetSize();
	for(int i=0;i<nCount;i++){
		pView->m_saSelectedFields.Add(psheet->m_saSelectedFields.GetAt(i));
		pView->m_saSelectedFieldsTitle.Add(psheet->m_saSelectedFieldsTitle.GetAt(i));
	}
	pView->m_fHavePage = psheet->m_fHavePage;
	pView->m_uPageType = psheet->m_uPageType;

	pView->m_strReportTitle = psheet->m_strReportTitle;
	pView->m_strFontTitle = psheet->m_strFontTitle;
	pView->m_uSizeTitle = psheet->m_uSizeTitle;
	pView->m_strFontContentHead = psheet->m_strFontContentHead;
	pView->m_uSizeContentHead = psheet->m_uSizeContentHead;
	pView->m_strFontContent = psheet->m_strFontContent;
	pView->m_uSizeContent = psheet->m_uSizeContent;
	pView->m_strReportFooter = psheet->m_strReportFooter;
	pView->m_strFontFooter = psheet->m_strFontFooter;
	pView->m_uSizeFooter = psheet->m_uSizeFooter;


	return TRUE;
}

⌨️ 快捷键说明

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