找回密码
 立即注册

QQ登录

只需一步,快速开始

wuzhiwei

注册会员

10

主题

28

帖子

196

积分

注册会员

积分
196

活字格认证

wuzhiwei
注册会员   /  发表于:2014-2-27 11:03  /   查看:5852  /  回复:3
1. C1.Win.C1FlexGrid.4(版本4.6.20133.795),在导表格数据至EXCEL时,图片无法正常显示?
     图片栏位显示为:“10 boxes x 20 bags”,“24 - 12 oz bottles”等

  
2. 早期版本的C1.Win.C1PrintPreview,在新版中是否被其他类替代或如何引用?
     以下提示C1.WIN无此类或引用无效?
private C1.Win.C1PrintPreview.PreviewToolBarButton c1pBtnFileOpen1;
                private C1.Win.C1PrintPreview.PreviewToolBarButton c1pBtnFileSave1;
                private C1.Win.C1PrintPreview.PreviewToolBarButton c1pBtnFilePrint1;
                private C1.Win.C1PrintPreview.PreviewToolBarButton c1pBtnPageSetup

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2014-2-27 15:52:00
沙发
回复 1楼wuzhiwei的帖子

你好,
目前还无法直接通过 FlexGrid 导出 Image 到 Excel,可以借助 C1Excel 导出图片。

  1. c1FlexGrid1[2, 1] = "abc";
  2.           c1FlexGrid1.SetCellImage(2, 2, Image.FromFile(@"C:UsersPublicPicturesSample PicturesChrysanthemum.jpg"));
  3.           XLSheet sheet = c1XLBook1.Sheets[0];
  4.           sheet[2, 1-1].Value = c1FlexGrid1[2, 1];
  5.           int width = (int)(((double)sheet.DefaultColumnWidth) * (1.0 / 1440.0) * this.c1FlexGrid1.CreateGraphics().DpiY);
  6.           int height = (int)(((double)sheet.DefaultRowHeight) * (1.0 / 1440.0) * this.c1FlexGrid1.CreateGraphics().DpiY);
  7.           Bitmap img = new Bitmap(c1FlexGrid1.GetCellImage(2, 2), width, height);
  8.           sheet[2, 2-1].Value = img;
  9.           c1XLBook1.Save(@"C:MyExcel.xlsx");
  10.           System.Diagnostics.Process.Start(@"C:MyExcel.xlsx");
复制代码


2.是需要定制报表预览控件的工具条吗?可以通过以下代码控制按钮集合:

  1.             this.c1PrintPreviewControl1.ToolBars.File.ToolStrip.Items.RemoveAt(0);
复制代码
回复 使用道具 举报
wuzhiwei
注册会员   /  发表于:2014-2-28 11:11:00
板凳
回复 2楼iceman的帖子

以上问题已经解决,谢谢!
另外还有个问题, 早期版本升级到新版中,原窗体自动产生的以下代码,在新版中会提下以下错误信息,该如何解决?
this.c1TextBoxEnglishDisplayName.CopyWithLiterals = ((bool)(resources.GetObject("c1TextBoxEnglishDisplayName.CopyWithLiterals")));

错误        36        “C1.Win.C1Input.C1TextBox”不包含“CopyWithLiterals”的定义,并且找不到可接受类型为“C1.Win.C1Input.C1TextBox”的第一个参数的扩展方法“CopyWithLiterals”(是否缺少 using 指令或程序集引用?)        D:\DotNET2010\Ports.SystemDefinition\Viewer\MailGroupViewer.cs        569        26        Ports.SystemDefinition
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-2-28 15:31:00
地板
回复 3楼wuzhiwei的帖子

替代属性为:
this.c1TextBox1.MaskInfo.CopyWithLiterals
链接为对应帮助文档地址:http://our.componentone.com/wiki/index.php?title=Main_Page

如果有其他对应不上的接口可以通过帮助文档查看:
http://our.componentone.com/wiki ... Studio_for_WinForms
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部