无法隐藏空子报表 [英] Cannot hide empty subreport

查看:68
本文介绍了无法隐藏空子报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已查看(5.6 KB,3236 views)

解决方案

I 恐怕没有人成为你的朋友。


因为报告不是互动的(至少从2007年开始)。

所以,当你设计一份报告,你需要在之前运行它(在设计时)保留所有空间。


我会很高兴对你来说,即使其他人会成为你生命中的朋友:),但我怀疑会发生这种情况。


祝你好运!


不幸的是,图片太小,看不到任何有用的东西,但我有点了解你所追求的东西。你顺便使用哪个版本的Access?


如果子报告没有,那么页脚部分还有其他内容吗?

获取子报告不要显示应该很容易。我猜你的问题是在没有数据的情况下让页脚部分不显示。这比你提到的要多得多。 Subreport控件不会因缺少数据而缩小。它有一个设计的大小,不受任何数据或缺乏的影响。


我希望,只要在页脚部分没有其他内容打印,当没有子报表数据时,方法是将其可见性设置为False。当然有不要忘记将它设置为True(IE。无论数据如何,每次都设置它,但是取决于数据的值)。


我是使用Access 2007.页脚中没有其他内容。有两个页脚:一个是星期几,另一个是员工。 (报告按员工列出数据,然后为每个员工数据显示一周中的每一天。)员工页脚始终有数据,但星期几可能没有,并且星期几页脚中包含的子报表是那个我想隐藏的人。我试图将其可见性设置为FALSE,无论是否有数据,它仍然出现。这是我放入页脚On Format的代码。事件:

展开 | 选择 | Wrap | 行号


I''ve reviewed the posts on www.bytes.com.
My problem is the same as that reported by others:
a report with an empty subreport cannot suppress the display of the empty subreport. I''ve set the "can shrink" and "can grow" properties to "yes" on both the footer and the subreport''s control object. I''ve also minimized the physical size of the subreport in the footer. These all seem to make no difference. So, I added code to the "format footer" event of the report, attempting to hide the subreport if the .HasData property is false. I''ve also tried to add code (suggested in other related threads on this web site), which seems to compile without problem, but is unable to make the subreport non-visible. Please see attached JPG for example of empty "Additions (Subtractions)" subreports. I''m desperate! If you help me I will be your friend for life. Seriously.

Attached Images
hide subreport example.jpg (5.6 KB, 3236 views)

解决方案

I''m afraid that no one become your friend.

That because a report is not interactive (since 2007 at least).
So, when you design a report you reserve spaces for all you need to show in before you run it (at design time).

I''ll be happy for you even if other one will become your friend for a life :) , but I have serious doubt that will happen.

Good luck !


Unfortunately the picture is too small to see anything helpful, but I sort of get the gist of what you''re after. Which version of Access are you using by the way?

Is there anything else in the Footer Section that should display if the Subreport doesn''t?
Gett ing the Subreport not to show should be easy. I''m guessing your problem is with getting the Footer Section not to show when there''s no data in it. This is more involved than you''ve mentioned. The Subreport control won''t shrink related to the lack of data. It has a designed size and that won''t be effected by any data or lack thereof.

I would expect, as long as there is nothing else to print in the Footer Section, that the approach would be to set its visibility to False when there is no Subreport data. Not forgetting to set it to True when there is of course (IE. Set it each time regardless of the data, but to a value that depends on the data).


I''m using Access 2007. There is nothing else in the footer. There are 2 footers: one for the day of the week and another for the employee. (Report lists data by employee, then for each employee data appears for each day of the week.) The employee footer always has data, but the day of the week footer may not, and the subreport contained in the day of the week footer is the one I''m trying to hide. I''ve tried to set its visibility to FALSE regardless of whether there is data, and it still appears. Here is the code I placed into the footer''s "On Format" event:

Expand|Select|Wrap|Line Numbers


这篇关于无法隐藏空子报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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