首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

vc显示水晶报表11答案。

2012-02-23 
vc显示水晶报表11在线等答案。。急、、用的是水晶报表11protected:IApplicationPtr m_pAppIReportPtr m_pRepo

vc显示水晶报表11在线等答案。。急、、
用的是水晶报表11
  protected:
IApplicationPtr m_pApp;
IReportPtr m_pReport;
CString m_rptFile;
  
  CCrystalReportViewer11m_Viewer;
CStringm_reportName;

  m_pApp.CreateInstance("CrystalDesignRuntime.Application");
_bstr_t filename=_bstr_t(m_rptFile);

//打开报表
m_pReport=m_pApp->OpenReport(filename);
//设置报表显示器控件的数据源为上面打开的报表
m_Viewer.SetReportSource(m_pReport);
//不显示“组树”
m_Viewer.SetDisplayGroupTree (FALSE);
//不显示控件边框
m_Viewer.SetDisplayBorder (FALSE);
//不显示控件工具栏
m_Viewer.SetDisplayToolbar (FALSE);
//显示选项卡的标题
m_Viewer.SetDisplayTabs(FALSE);
//更新报表显示器控件
m_Viewer.Refresh();
//显示报表
m_Viewer.ViewReport();
运行时出现出现非法操作


[解决办法]
去mfc版问吧。没用过这个控件~

热点排行