如何引用报表标题中的表行/列? [英] how to reference a table row/column in a report header?

查看:124
本文介绍了如何引用报表标题中的表行/列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个复选框的报告。我希望每个上方的(垂直)标题是可变的。 - 即,从另一个表中获取,其中第一个框的标题将是tablex,第1行,第1列的文本内容。第二个框的标题将是tablex,第1行,列中的文本2等等


我尝试制作那些标题文本框并指向控制源。到包含提示的单行表,但是我收到了一个错误。


谢谢。

I have a report with several check boxes. I want the (vertical) heading over each to be "variable" -- that is, taken from another table, where the heading of the first box would be the textual contents of "tablex", row 1, column 1. The heading of the second would be the text in tablex, row 1, column 2 etc.

I tried making those headers text boxes and pointing the "control source" to the one-row table that contained the prompts, but I got an error.

Thanks.

推荐答案

取决于为什么你需要这个,解决方案可能会有所不同。首先要想到的是,使用vbaCode在报告OnOpen事件中设置标签。示例:
Depending on why you need this, the solution might differ a bit. What springs to mind at first, would be to set the labels in the reports OnOpen event by using vbaCode. Example:
展开 | 选择 | Wrap | 行号


正如已经指出的那样,解决方案本身是可变的。


设置标签的标题很简单,可以在报表打开时在代码中完成。无论是将标签放在报告标题中还是报告页面标题都需要您自行决定。


您所说的原则似乎如下: -


您的报表从表(或查询)引用其数据源,因此具有固定的数据列。然后,当报表打开时,您希望文本标签显示来自完全独立的一个行表。


以下代码(没有错误检查和通常的假设考虑因素取决于您的需求)演示了从一个表格中检索数据到报告的逻辑,但是在标签的标题中设置标题不同的

As has been pointed out the solution itself is variable.

Setting the caption of a label is easy enough and can be done in code when the report opens. Whether you put the labels in the report header or the report ''page'' header is a matter for you to decide.

The principle of what you are saying it seems is this:-

your report references its data source from a table (or query) and therefore has fixed columns of data. You then want the text label display to be sourced from a completely separate one row table when the report opens.

The following code (devoid of error checking and the usual ''what if '' considerations depending on your needs) demonstrates the logic of retrieving your data to a report from one table but setting up the headers in the captions for the labels from a different table

展开 | 选择 | Wrap | 行号


谢谢!听起来你们都有我想要做的事情的要点。我今天早上会编写代码。

我假设我将代码放入onopen中。 REPORT事件(不是标题,详细信息等)。

这也可以回答我在Excel中遇到的问题。似乎文字参考和内联宏的日子结束了。从这里进入它的VBA。

我希望Excel中的报告左边的页脚等于
Thanks! It sounds like you both had the gist of what I was trying to do. I''ll work up the code this morning.
I assume I drop that code into the "onopen" event of the REPORT (not the header, detail, etc.).
This may also answer a question I had in Excel. It seems the days of literal references and inline macros are over. From here on in it''s VBA.
I wanted the left footer in a report in Excel to equal the value of

的值

这篇关于如何引用报表标题中的表行/列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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