日期:2014-05-18  浏览次数:21336 次

C# 第三方控件spread 字体设置和打印问题
C# 第三方控件spread 字体设置和打印问题

1 spread 字体设置 

我想把列头的字体,竖着显示,也就是纵向显示,怎么设置阿?


2 打印问题

现在已经实现了打印功能,但是打印范围太小,也就是说spread内的内容不能去不打印出来。也不能分页。

有哪位高手指点一下,谢谢



------解决方案--------------------
http://topic.csdn.net/t/20030420/23/1686231.html
http://www.xker.com/page/e2007/0116/12775.html
------解决方案--------------------
C# 第三方控件spread 字体设置和打印问题 

1 spread 字体设置

我想把列头的字体,竖着显示,也就是纵向显示,怎么设置阿? 

这个估计 不行,只能自己画吧


2 打印问题 

现在已经实现了打印功能,但是打印范围太小,也就是说spread内的内容不能去不打印出来。也不能分页。 
C# code
        
                /// <summary>
        /// 通用的打印表格方法
        /// </summary>
        /// <param name="fpview"></param>
        /// <param name="fp"></param>
        /// <param name="index"></param>
        public static void CommonPrint(FarPoint.Win.Spread.SheetView fpview,FpSpread fp,int index)
        {
            try
            {
                if(fpview.RowCount==0)
                    return;
                FarPoint.Win.Spread.PrintInfo pi = new FarPoint.Win.Spread.PrintInfo(); 
                DialogResult result=MessageBox.Show("是否要横向打印?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
                FarPoint.Win.Spread.StyleInfo style = new FarPoint.Win.Spread.StyleInfo(); 
                style.Border=new FarPoint.Win.LineBorder(Color.Black,1);
                style.BackColor=Color.White;
                fpview.ColumnHeader.DefaultStyle=style;
                fpview.RowHeader.DefaultStyle=style;
                if(result==DialogResult.Yes)
                {
                    pi.Orientation =FarPoint.Win.Spread.PrintOrientation.Landscape;
                }
                else
                    pi.Orientation =FarPoint.Win.Spread.PrintOrientation.Portrait;
                FarPoint.Win.Spread.PrintMargin pm = new 
                FarPoint.Win.Spread.PrintMargin(); 
                pm.Left = 100; 
                pm.Right = 60; 
                pm.Top = 100; 
                pm.Bottom = 20; 
                pi.FirstPageNumber = 1; 
                pi.Footer = "当前第 /p 页/n共 /pc 页"; 
                pi.Margin = pm; 
                pi.PageStart = 1; 
                pi.Preview = true; 
                pi.ShowBorder = true; 
                pi.ShowColor = false; 
                pi.ShowColumnHeaders = true; 
                pi.ShowGrid = true; 
                pi.ShowPrintDialog = true; 
                pi.ShowRowHeaders = true; 
                pi.ShowShadows = true; 
                pi.ZoomFactor = 1; 
                pi.ShowPrintDialog=true;
                FarPoint.Win.Spread.PrintInfo clone = new FarPoint.Win.Spread.PrintInfo(pi);
                fpview.PrintInfo = clone;
                fp.PrintSheet(index);
            }
            catch
            {
                MessageBox.Show("打印发生错误,请确认是否有连接好打印机");
            }

        }