找回密码
 立即注册

QQ登录

只需一步,快速开始

hubery1107

初级会员

15

主题

36

帖子

347

积分

初级会员

积分
347

活字格认证微信认证勋章

[已处理] 请教打报表问题

hubery1107
初级会员   /  发表于:2016-2-24 16:09  /   查看:4058  /  回复:1
请问,用Spread生成PDF报表时,怎么加页脚

1 个回复

倒序浏览
gw0506
超级版主   /  发表于:2016-2-24 16:25:00
沙发
用PrintInfo增加页面信息,示例代码如下:
  1. FarPoint.Web.Spread.PrintInfo prinf = new FarPoint.Web.Spread.PrintInfo();
  2. prinf.BestFitCols = true;
  3. prinf.BestFitRows = true;
  4. prinf.Centering = FarPoint.Web.Spread.Centering.Both;
  5. prinf.ColEnd = 10;
  6. prinf.Colors = new System.Drawing.Color[] {
  7.         System.Drawing.Color.Green,
  8.         System.Drawing.Color.Yellow,
  9.         System.Drawing.Color.Gold,
  10.         System.Drawing.Color.Indigo,
  11.         System.Drawing.Color.Brown};
  12. prinf.ColStart = 0;
  13. prinf.FirstPageNumber = 1;
  14. prinf.Footer = "/g\"1\"/cl\"4\"This is Page /p of /pc Pages";
  15. prinf.FooterHeight = 40;
  16. prinf.Header = "/cl\"0\"Print Job For FarPoint Inc./n /n ";
  17. prinf.HeaderHeight = 40;
  18. prinf.Images = new System.Drawing.Image[] {
  19.         System.Drawing.Image.FromFile("D:\\images\\point.jpg"),
  20.         System.Drawing.Image.FromFile("D:\\images\\logo.gif"),
  21.         System.Drawing.Image.FromFile("D:\\images\\icon.jpg")};
  22. prinf.Margin = new FarPoint.Web.Spread.PrintMargin(10, 10, 10, 10, 20, 20);
  23. prinf.Opacity = 50;
  24. prinf.Orientation = FarPoint.Web.Spread.PrintOrientation.Landscape;
  25. prinf.PageEnd = 5;
  26. prinf.PageOrder = FarPoint.Web.Spread.PrintPageOrder.OverThenDown;
  27. prinf.PageStart = 1;
  28. prinf.PrintNotes = FarPoint.Web.Spread.PrintNotes.None;
  29. prinf.PrintType = FarPoint.Web.Spread.PrintType.All;
  30. prinf.RepeatColEnd = 10;
  31. prinf.RepeatColStart = 1;
  32. prinf.RepeatRowEnd = 10;
  33. prinf.RepeatRowStart = 1;
  34. prinf.RowEnd = 10;
  35. prinf.RowStart = 1;
  36. prinf.ShowBorder = false;
  37. prinf.ShowColumnFooter = FarPoint.Web.Spread.PrintHeader.Show;
  38. prinf.ShowColumnFooterEachPage = true;
  39. prinf.ShowColumnHeader = FarPoint.Web.Spread.PrintHeader.Show;
  40. prinf.ShowGrid = true;
  41. prinf.ShowRowHeader = FarPoint.Web.Spread.PrintHeader.Show;
  42. prinf.ShowSubtitle = true;
  43. prinf.ShowTitle = true;
  44. prinf.SmartPrintPagesTall = 1;
  45. prinf.SmartPrintPagesWide = 1;
  46. FarPoint.Web.Spread.SmartPrintRulesCollection prules = new FarPoint.Web.Spread.SmartPrintRulesCollection();
  47. prules.Add(new FarPoint.Web.Spread.BestFitColumnRule(FarPoint.Web.Spread.ResetOption.None));
  48. prinf.SmartPrintRules = prules;
  49. prinf.UseMax = true;
  50. prinf.UseSmartPrint = false;
  51. prinf.ZoomFactor = 2;
  52. FpSpread1.ActiveSheetView.PrintInfo = prinf;
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部