水晶报告动态列和.net [英] crystal report dynamic column and .net

查看:241
本文介绍了水晶报告动态列和.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的报表有10列,在运行时如何显示和隐藏列写代码。需要帮助。

suppose my report has 10 column and at run time how could i show and hide column writing the code. need help.

推荐答案

水晶报表中的字段使用水平部分(报表标题, ,组头,详细信息,组尾,页脚和报表尾),而不使用垂直对齐(列)。大多数报表通过对齐其水平位置来显示列字段,但在Crystal Reports中没有内建列分组。

Fields in Crystal Reports are bundled using horizontal sections (Report Headers, Page Headers, Group Headers, Details, Group Footers, Page Footers, and Report Footers) and not using vertical alignments (columns). Most reports display columnar fields by aligning their horizontal positions but there is no intrinsic column-grouping in Crystal Reports.

要在运行时动态隐藏字段列, 抑制标志可以使用布尔条件公式设置:

To dynamically hide a column of fields at run-time, the Suppress flag can be set using a Boolean conditional formula:



  • 右键单击其中一个,

  • 选择格式化对象... 转到常用标签,

  • 从上下文菜单中选择
  • -2 复选框对应的图标,
  • 将打开格式公式编辑器 - 抑制窗口, li>
  • 输入一个导致 True或False 的公式。

  • On the Design view, highlight all fields belonging to the column,
  • right-click on one of them,
  • select Format Objects... from the context-menu
  • go to the Common tab,
  • click on the X-2 icon corresponding to the Suppress checkbox,
  • the Format Formula Editor - Suppress window will open,
  • input a formula that results to True or False.

运行时,字段将显示或不显示,具体取决于公式的结果。但是,白色空间仍将出现在抑制列字段的位置,右侧的字段仍将位于相同的位置。要使列向右滑动,他们的 X位置也需要是动态的:

At run-time, the fields will either display or not depending on the result of the formula. However, white space will still appear in the suppressed column fields' position and fields to the right of will still be positioned in the same spot. To make the columns to the right slide to the left, their X-Position needs to be dynamic as well:


  • 右键单击属于右侧列的某个字段,

  • 选择尺寸和位置...

  • 点击 X:文本框对应的 X-2 图标,

  • 格式公式编辑器 - X位置调整窗口将打开,

  • 输入一个公式,结果为 twips

  • right-click one of the fields belonging to the column to the right,
  • select Size and Position...,
  • click on the X-2 icon corresponding to the X: textbox,
  • the Format Formula Editor - X-Position Adjustment window will open,
  • input a formula that results to the number of twips to be adjusted,
  • repeat for all other fields belonging to the column to the right.

A
< 相当于1/1440英寸。由于字段的位置应向左滑动,公式的结果应为负(正值将使字段向右滑动)。例如,如果字段向左滑动2英寸,则公式结果应为-2880。

A Twip is equivalent to 1/1440 of an inch. Since the field's position should slide to the left, the result of the formula should be negative (a positive value will slide the field to the right). For example, if the field should slide left 2 inches, then the formula result should be -2880.

请注意,您需要在抑制添加到右侧字段的 X位置调整的公式中:

Note that you'll need to incorporate the same condition on the Suppress for the left field into the formula for X-Position Adjustment of the right field:


  • 如果左侧字段未被抑制,则右侧字段的x位置调整应为0.

  • 如果左侧字段 被抑制,则右侧栏位的x位置调整应等于左侧栏位的twips宽度。

  • If the left field is not suppressed, then x-position adjustment of the right field should be 0.
  • If the left field is suppressed, then x-position adjustment of the right field should be equal to the width in twips of the left field.

我没有找到任何好的水晶报告提示& Tricks 书籍,因此我只能推荐阅读 Crystal Reports用户指南 xi4_cr_usergde_en.pdfrel =nofollow> SAP

I haven't found any good Crystal Reports Tips & Tricks book yet so I can only recommend reading the Crystal Reports User Guide available from SAP.

这篇关于水晶报告动态列和.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆