水晶报表……
IApplicationPtr m_Application;
IReportPtr m_Report;
CCrystalReportViewer9 m_CRViewer1;
m_Application
m_Application.CreateInstance (__uuidof(Application));
m_Report = m_Application->OpenReport("C:\\Documents and Settings\\Administrator\\桌面\\crstalReport\\database\\xxfb.rpt");
m_Report->put_ReportTitle (_bstr_t("Title"));
m_Report->Database ->Tables ->Item [1]->SetLogOnInfo("(wgq)","xxfb","sa","sa");
m_Report->put_SQLQueryString ((_bstr_t)"select * from GBInfor");
m_Report->PutEnableSelectDistinctRecords (TRUE);
m_Report->PutRecordSelectionFormula ((_bstr_t)"{GBInfor.GBBH}='gb01'");
m_Report->PutReportAuthor ("xiaojin");
//将m_Report与报表控件连接
★★★ m_CRViewer1.SetReportSource(m_Report);
m_CRViewer1.SetDisplayToolbar (TRUE);
m_CRViewer1.SetDisplayGroupTree (FALSE);
m_CRViewer1.SetDisplayBorder (FALSE);
m_CRViewer1.Refresh ();
m_CRViewer1.ViewReport();
这是按网上的一个例子来做的,结果运行到五角星处(m_CRViewer1.SetReportSource(m_Report);)处异常报错,请问是怎么回事阿 ,谢谢
问题点数:20、回复次数:6Top
1 楼neuly98(黑山老妖)回复于 2004-12-03 14:55:55 得分 0
helpTop
2 楼neuly98(黑山老妖)回复于 2004-12-03 16:29:28 得分 0
怎么没人帮忙阿 郁闷Top
3 楼neuly98(黑山老妖)回复于 2004-12-06 10:47:28 得分 0
有人用过这个例子吗??Top
4 楼TrueIAm(阿 成)回复于 2004-12-06 15:29:49 得分 20
调一下,看看是什么异常....Top
5 楼neuly98(黑山老妖)回复于 2004-12-07 08:55:57 得分 0
搞定了 揭帖Top
6 楼duxianghe( dux++ )回复于 2005-05-16 19:31:32 得分 0
呵呵,我运行到星号前都报错了,才郁闷呢Top




