找回密码
 立即注册

QQ登录

只需一步,快速开始

laonawuli

银牌会员

39

主题

146

帖子

3383

积分

银牌会员

积分
3383

活字格认证

laonawuli
银牌会员   /  发表于:2011-11-18 10:36  /   查看:7200  /  回复:7
打印设备:虚拟打印机 FinePrint

对比软件:DataWindow

数据:DataWindow 数据量是FP上显示的数据至少10倍,FP上只有零星数据。

Farpoint打印设置:默认

但是从打印机的任务容量来看,FP竟然有20多兆,而DataWindow的数据只有8兆。

我想一定是FP的设置有问题,才导致FP虽然数据少,但产生这么大的容量。



FP 初始化设置:  (初始化后,只在逻辑代码中为Column添加了Border) myBorder = new FarPoint.Win.LineBorder(System.Drawing.Color.Black, 1, false, false, true, true);

      //
            // fpMain
            //
            this.fpMain.About = "2.5.2007.2005";
            this.fpMain.AccessibleDescription = "fpMain, Sheet1";
            this.fpMain.BackColor = System.Drawing.Color.White;
            this.fpMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.fpMain.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.fpMain.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded;
            this.fpMain.Location = new System.Drawing.Point(3, 17);
            this.fpMain.Name = "fpMain";
            this.fpMain.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {
            this.fpMain_Sheet1});
            this.fpMain.Size = new System.Drawing.Size(715, 235);
            this.fpMain.TabIndex = 0;
            tipAppearance1.BackColor = System.Drawing.SystemColors.Info;
            tipAppearance1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            tipAppearance1.ForeColor = System.Drawing.SystemColors.InfoText;
            this.fpMain.TextTipAppearance = tipAppearance1;
            this.fpMain.VerticalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded;
            this.fpMain.VisualStyles = FarPoint.Win.VisualStyles.Off;
            this.fpMain.AutoSortingColumn += new FarPoint.Win.Spread.AutoSortingColumnEventHandler(this.fpMain_AutoSortingColumn);
            this.fpMain.CellDoubleClick += new FarPoint.Win.Spread.CellClickEventHandler(this.fpMain_CellDoubleClick);
            this.fpMain.CellClick += new FarPoint.Win.Spread.CellClickEventHandler(this.fpMain_CellClick);
            this.fpMain.ColumnWidthChanged += new FarPoint.Win.Spread.ColumnWidthChangedEventHandler(this.fpMain_ColumnWidthChanged);
            //
            // fpMain_Sheet1
            //
            this.fpMain_Sheet1.Reset();
            this.fpMain_Sheet1.SheetName = "Sheet1";
            // Formulas and custom names must be loaded with R1C1 reference style
            this.fpMain_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;
            this.fpMain_Sheet1.ColumnCount = 0;
            this.fpMain_Sheet1.ColumnHeader.RowCount = 0;
            this.fpMain_Sheet1.RowCount = 0;
            this.fpMain_Sheet1.RowHeader.ColumnCount = 0;
            this.fpMain_Sheet1.ColumnHeader.AutoText = FarPoint.Win.Spread.HeaderAutoText.Blank;
            this.fpMain_Sheet1.ColumnHeader.DefaultStyle.BackColor = System.Drawing.Color.White;
            this.fpMain_Sheet1.ColumnHeader.DefaultStyle.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.fpMain_Sheet1.ColumnHeader.DefaultStyle.Locked = false;
            this.fpMain_Sheet1.ColumnHeader.DefaultStyle.Parent = "HeaderDefault";
            this.fpMain_Sheet1.ColumnHeader.HorizontalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
            this.fpMain_Sheet1.ColumnHeader.VerticalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
            this.fpMain_Sheet1.DataAutoCellTypes = false;
            this.fpMain_Sheet1.GrayAreaBackColor = System.Drawing.Color.White;
            this.fpMain_Sheet1.HorizontalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
            this.fpMain_Sheet1.OperationMode = FarPoint.Win.Spread.OperationMode.ReadOnly;
            this.fpMain_Sheet1.PrintInfo.ShowBorder = false;
            this.fpMain_Sheet1.Protect = false;
            this.fpMain_Sheet1.RowHeader.Columns.Default.Resizable = false;
            this.fpMain_Sheet1.RowHeader.DefaultStyle.BackColor = System.Drawing.Color.White;
            this.fpMain_Sheet1.RowHeader.DefaultStyle.Locked = false;
            this.fpMain_Sheet1.RowHeader.DefaultStyle.Parent = "HeaderDefault";
            this.fpMain_Sheet1.RowHeader.HorizontalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
            this.fpMain_Sheet1.RowHeader.VerticalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
            this.fpMain_Sheet1.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Single;
            this.fpMain_Sheet1.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row;
            this.fpMain_Sheet1.VerticalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
            this.fpMain_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;
            this.fpMain.SetActiveViewport(1, 1);

jpg

jpg

jpg

jpg

7 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2011-11-18 14:11:00
沙发

回复 1# laonawuli 的帖子

你好,你的设想是正确的,由于 Spread 设置大量的样式需要打印,所以导致打印文件速度慢,占用存储空间大。:strong:
回复 使用道具 举报
laonawuli
银牌会员   /  发表于:2011-11-18 14:16:00
板凳
原帖由 iceman 于 2011-11-18 14:11:00 发表
你好,你的设想是正确的,由于 Spread 设置大量的样式需要打印,所以导致打印文件速度慢,占用存储空间大。:strong:


请问如何做,才能加快速度呢?如果不用Border,直接用GridLine,是会快一些吗?
我之所以选择Border,是因为我不会用GridLine制作左右开放的效果
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2011-11-18 14:29:00
地板

回复 1# laonawuli 的帖子

你好,你的设想是正确的,因为给 Spread 设置了很多的样式属性,在打印时需要打印 Spread 样式,所以导致打印速度慢,文件大。
回复 使用道具 举报
laonawuli
银牌会员   /  发表于:2011-11-18 14:38:00
5#
原帖由 iceman 于 2011-11-18 14:29:00 发表
你好,你的设想是正确的,因为给 Spread 设置了很多的样式属性,在打印时需要打印 Spread 样式,所以导致打印速度慢,文件大。


请问如何做,才能加快速度呢?如果不用Border,直接用GridLine,是会快一些吗?
我之所以选择Border,是因为我不会用GridLine制作左右开放的效果
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2011-11-18 17:29:00
6#
你好,你的想法再次得到验证是正确。
1.GridLine 速度较 Border 快。
2.使用 GridLine 制作左右开放效果,可以使用设置最后一列的 LeftBorder 颜色为 White,测试代码 :

  1.             this.fpSpread1.ActiveSheet.ColumnCount = 5;
  2.             FarPoint.Win.ComplexBorderSide left = new FarPoint.Win.ComplexBorderSide(Color.White);
  3.             FarPoint.Win.ComplexBorderSide right = new FarPoint.Win.ComplexBorderSide(Color.White);
  4.             FarPoint.Win.ComplexBorderSide top = new FarPoint.Win.ComplexBorderSide(Color.Red);
  5.             FarPoint.Win.ComplexBorderSide bottom = new FarPoint.Win.ComplexBorderSide(Color.Red);
  6.             FarPoint.Win.ComplexBorder border = new FarPoint.Win.ComplexBorder(left, top, right, bottom);

  7.             FarPoint.Win.Spread.GridLine grid = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Flat,Color.Red);
  8.             this.fpSpread1.ActiveSheet.ColumnHeader.Columns[4].Border = border;
  9.             this.fpSpread1.ActiveSheet.ColumnHeader.Columns[3].Border = border;
  10.             this.fpSpread1.ActiveSheet.ColumnHeader.HorizontalGridLine = grid;
  11.             this.fpSpread1.ActiveSheet.ColumnHeader.VerticalGridLine = grid;  
复制代码
回复 使用道具 举报
laonawuli
银牌会员   /  发表于:2011-11-18 23:54:00
7#
原帖由 iceman 于 2011-11-18 17:29:00 发表
你好,你的想法再次得到验证是正确。
1.GridLine 速度较 Border 快。
2.使用 GridLine 制作左右开放效果,可以使用设置最后一列的 LeftBorder 颜色为 White,测试代码 :[code]
            this.fpSpread1.ActiveSheet.ColumnCount = 5;
            FarPoint.Win.Com


非常感谢iceman

请问在已经设置border的基础上,有没有什么属性设置,不去让FP加载一堆无关的设置而提高打印速度呢?
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2011-11-21 12:10:00
8#

回复 7# laonawuli 的帖子

你好,不好意思,有几个问题点需要和你确认下:
1.请问 “打印速度” 具体是指什么时机下的打印速度?
a.是打印机的打印速度.
b.还是点击单元格弹出打印设置对话框的速度.
c.或者是从程序运行到弹出 Form 的过程。

2.请问用于打印的 Sheet 上数据有多少行、多少列,是否设置了行列数呢?
谢谢~
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部