#include "stdafx.h"
#include "FrameWindowWnd.h"
CFrameWindowWnd::CFrameWindowWnd()
:m_pFastReportView(nullptr),
m_pActiveX(nullptr),
m_pLoadReportBtn(nullptr),
m_pReport(nullptr)
{
{
IfrxReportPtr pReport(__uuidof(TfrxReport));
m_pReport = pReport;
}
}
CFrameWindowWnd::~CFrameWindowWnd()
{
m_pReport->Release();
}
DuiLib::CDuiString CFrameWindowWnd::GetSkinFolder()
{
return _T("");
}
DuiLib::CDuiString CFrameWindowWnd::GetSkinFile()
{
return _T("FrameWindowWnd.xml");
}
LPCTSTR CFrameWindowWnd::GetWindowClassName(void) const
{
return _T("FrameWindowWnd");
}
//"87caf5e4-3add-4abd-baf5-76f3ee604c3d"
static const GUID IID_IZ =
{ 0x87caf5e4, 0x3add, 0x4abd, { 0xba, 0xf5, 0x76, 0xf3, 0xee, 0x60, 0x4c, 0x3d } };
void CFrameWindowWnd::Notify(TNotifyUI& msg)
{
if (msg.sType == _T("showactivex"))
{
if (msg.pSender->GetName() != _T("FastReport")) return;
m_pActiveX = static_cast<CActiveXUI*>(msg.pSender);
if (m_pActiveX != nullptr)
{
m_pActiveX->GetControl(IID_IZ, (void**)&m_pFastReportView);
if ( m_pFastReportView != nullptr )
{
// DUITRACE("%d", m_pFastReportView->Report);
DUITRACE("test");
// m_pFastReportView->Init();
frxPreviewButtons btns = m_pReport->GetPreviewOptions()->GetButtons();
btns = frxPreviewButtons(btns^frxPreviewButtons::pb_NoClose);
m_pReport->GetPreviewOptions()->PutButtons(btns);
m_pFastReportView->PutReport(m_pReport);
m_pFastReportView->Init();
}
}
}
else if (msg.sType == DUI_MSGTYPE_WINDOWINIT)
{
m_pLoadReportBtn = static_cast<CButtonUI*>(m_PaintManager.FindControl(_T("LoadReport")));
DUITRACE(m_PaintManager.FindControl(_T("LoadReport"))->GetName());
DUITRACE(m_PaintManager.FindControl(_T("LoadReport"))->GetClass());
assert(m_pLoadReportBtn != nullptr);
}
__super::Notify(msg);
}
void CFrameWindowWnd::OnFinalMessage(HWND hWnd)
{
WindowImplBase::OnFinalMessage(hWnd);
PostQuitMessage(0);
delete this;
}
void CFrameWindowWnd::OnClick(TNotifyUI& msg)
{
if (msg.pSender == m_pLoadReportBtn)
{
//m_pFastReportView->Lock();
#if 0
CDuiString szReportFileName = CPaintManagerUI::GetInstancePath() + _T("01.Simple list.fr3");
m_pReport->LoadReportFromFile(szReportFileName.GetData());
m_pReport->PrepareReport(true);
m_pReport->ShowReport();
#else
m_pFastReportView->Lock(); //Workspace.Lock();
try
{
CDuiString szReportFileName = CPaintManagerUI::GetInstancePath() + _T("01.Simple list.fr3");
m_pReport->LoadReportFromFile(szReportFileName.GetData());
m_pReport->PrepareReport(true);
}
catch (...)
{
}
m_pFastReportView->Unlock(); // Workspace.Unlock();
//m_pFastReportView->Update();
#endif
//m_pFastReportView->Unlock(); // Workspace.Unlock();
}
__super::OnClick(msg);
}
没有合适的资源?快使用搜索试试~ 我知道了~
DUIlib使用Fastreport
共29个文件
png:6个
h:5个
cpp:3个
3星 · 超过75%的资源 需积分: 9 38 下载量 68 浏览量
2016-08-23
16:32:28
上传
评论
收藏 617KB ZIP 举报
温馨提示
fastreport是一个简单优秀的报表,fastreport更多是和delphi联合使用预览和打印数据的。我在开始使用duilib做项目时,打印和数据预览都是自己绘制的,这样不仅绘制麻烦费事费事,而且客户需求是多变的,自己绘制不是那么的灵活。后面我觉得,可以使用报表等工具结合duilib进行显示或者打印,这里我使用了ocx调用fastreport 的方式
资源推荐
资源详情
资源评论
收起资源包目录
Duilib_Fastreport.zip (29个子文件)
Duilib_ocx
Duilib_ocx.cpp 863B
FrameWindowWnd.cpp 3KB
resource.h 1KB
stdafx.h 871B
Duilib_ocx.vcxproj.user 165B
Duilib_ocx.vcxproj.filters 2KB
targetver.h 236B
fastreport3.tlh 342KB
stdafx.cpp 216B
Duilib_ocx.vcxproj 5KB
Duilib_ocx.aps 3KB
Duilib_ocx.h 39B
Duilib_ocx.rc 3KB
FrameWindowWnd.h 567B
Release
DuiLib_u.dll 414KB
01.Simple list.fr3 6KB
skin
FrameWindowWnd.xml 2KB
timeEditWnd.xml 1KB
0.gif 101KB
shadow.png 3KB
button
button_nor.bmp 5KB
button_over.bmp 5KB
sys_btn_max.png 4KB
sys_btn_min.png 3KB
sys_btn_restore.png 4KB
sys_btn_menu.png 4KB
button_down.bmp 5KB
sys_btn_close.png 5KB
UiLib_u.dll 705KB
共 29 条
- 1
资源评论
- lk12133422342019-07-26根本跑不起来,骗分漂泊的浮萍2020-03-01你是怎么跑的?fastreport倒是注册了没?
- begophe2017-04-20Duilib的使用教程是不比较有用的,感谢分享的人。
漂泊的浮萍
- 粉丝: 7
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功