XtraRport的问题,在线等!!!

大Y 2011-06-08 03:05:51
我用的是XtraReport单独设计的报表,
但是想从窗体里,来显示报表,而不是通过ShowPreview())等等其它的,
现在放了一个PrintControl控件后,不能把报表付给这个控件让这个窗体显示,请各位大侠帮帮忙。

怎么来配置才可以呀/
...全文
86 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yeyucao123 2011-06-09
  • 打赏
  • 举报
回复
接分 .....
大Y 2011-06-08
  • 打赏
  • 举报
回复



试出来了,哈哈,接分撒
zhenyunyuan 2011-06-08
  • 打赏
  • 举报
回复
var fXtraReport = new XtraReportChaoBian();
fXtraReport.SetDataSource(new DataTable());//配置数据源
//fXtraReport.LoadLayout(@"C:\1.repx");另一种形式

PrintControl printControl1 = new PrintControl();//可以动态生成也可以将PrintControl拖放上去
printControl1.PrintingSystem = fXtraReport.PrintingSystem;


PrintBarManager printBarManager = new PrintBarManager();
printBarManager.Form = printControl1;
printBarManager.Initialize(printControl1);
printBarManager.MainMenu.Visible = false;
printBarManager.AllowCustomization = false;

//操作要显示什么按钮
printControl1.PrintingSystem.SetCommandVisibility(new PrintingSystemCommand[]{
PrintingSystemCommand.Open,
PrintingSystemCommand.Save,
PrintingSystemCommand.ClosePreview,
PrintingSystemCommand.Customize,
PrintingSystemCommand.SendCsv,
PrintingSystemCommand.SendFile,
PrintingSystemCommand.SendGraphic,
PrintingSystemCommand.SendMht,
PrintingSystemCommand.SendPdf,
PrintingSystemCommand.SendRtf,
PrintingSystemCommand.SendTxt,
PrintingSystemCommand.SendXls
}, CommandVisibility.None);

fXtraReport.CreateDocument();
panelControl2.Controls.Add(printControl1);
zhenyunyuan 2011-06-08
  • 打赏
  • 举报
回复
private void FormRpt_Load(object sender, EventArgs e)
{
BzxtBLL.employeRptBLL rptBLL = new BzxtBLL.employeRptBLL();
var fXtraReport = new XtraReportChaoBian();
fXtraReport.SetDataSource(rptBLL.GetChaoBian(false));//配置数据源
//fXtraReport.LoadLayout(@"C:\1.repx");另一种形式

PrintControl printControl1 = new PrintControl();//可以动态生成也可以将PrintControl拖放上去
printControl1.PrintingSystem = fXtraReport.PrintingSystem;


PrintBarManager printBarManager = new PrintBarManager();
printBarManager.Form = printControl1;
printBarManager.Initialize(printControl1);
printBarManager.MainMenu.Visible = false;
printBarManager.AllowCustomization = false;

//操作要显示什么按钮
printControl1.PrintingSystem.SetCommandVisibility(new PrintingSystemCommand[]{
PrintingSystemCommand.Open,
PrintingSystemCommand.Save,
PrintingSystemCommand.ClosePreview,
PrintingSystemCommand.Customize,
PrintingSystemCommand.SendCsv,
PrintingSystemCommand.SendFile,
PrintingSystemCommand.SendGraphic,
PrintingSystemCommand.SendMht,
PrintingSystemCommand.SendPdf,
PrintingSystemCommand.SendRtf,
PrintingSystemCommand.SendTxt,
PrintingSystemCommand.SendXls
}, CommandVisibility.None);

fXtraReport.CreateDocument();
panelControl2.Controls.Add(printControl1);
}
大Y 2011-06-08
  • 打赏
  • 举报
回复


我自己顶

4,816

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧