在运行时通过代码隐藏报告(详细信息)部分 [英] Hide report (detail) section via Code at Run time

查看:45
本文介绍了在运行时通过代码隐藏报告(详细信息)部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 -

是否可以在运行时隐藏报告的详细信息部分?


我有一份报告打印所有详细信息,摘要行。用户

希望报告也只是汇总行。


看起来最简单的事情就是用
显示详细信息部分,第二次隐藏详细信息

部分。我无法弄清楚代码那样做而且看不到

张贴。


谢谢 -

Sara


strDocName =" rptPaymentDueDateandDollars"


strStepErrorMsg ="告诉你细节有问题

承诺美元报告


strFile = strDocName& " .snp"

strPathAndFile = strPath& strFile

DoCmd.OutputTo acOutputReport,strDocName," snapshot format",

_

strPathAndFile''工作正常


strStepErrorMsg ="告诉它有一个问题摘要

承诺的美元报告"


strFile = strDocName& " .snp"

strPathAndFile = strPath& strFile


''再次打印相同的报告,但隐藏详细信息部分


DoCmd.OpenReport strDocName,acViewPreview ,, _

" rptPaymentDueDateandDollars.Detail.Visible = False" ''

给出错误


DoCmd.OutputTo acOutputReport,strDocName," snapshot format",

_

strPathAndFile

DoCmd.Close acReport,strDocName

Hi -
Is it possible to hide the detail section of a report at run time?

I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.

It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can''t figure out the code to do that and don''t see it
posted.

Thanks -
Sara

strDocName = "rptPaymentDueDateandDollars"

strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile '' works fine

strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile

'' Print same report again, but hide the Detail section

DoCmd.OpenReport strDocName, acViewPreview, , _
"rptPaymentDueDateandDollars.Detail.Visible = False" ''
gives error

DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile

DoCmd.Close acReport, strDocName

推荐答案



" sara" < sa ******* @ yahoo.com写了留言

新闻:11 ********************* @ r34g2000hsd .googlegro ups.com ...

"sara" <sa*******@yahoo.comwrote in message
news:11*********************@r34g2000hsd.googlegro ups.com...

您好 -

是否可以在运行时隐藏报告的详细信息部分?


我有一份报告,打印所有细节,包括摘要行。用户

希望报告也只是汇总行。


看起来最简单的事情就是用
显示详细信息部分,第二次隐藏详细信息

部分。我无法弄清楚代码那样做而且看不到

张贴。


谢谢 -

Sara


strDocName =" rptPaymentDueDateandDollars"


strStepErrorMsg ="告诉你细节有问题

承诺美元报告


strFile = strDocName& " .snp"

strPathAndFile = strPath& strFile

DoCmd.OutputTo acOutputReport,strDocName," snapshot format",

_

strPathAndFile''工作正常


strStepErrorMsg ="告诉它有一个问题摘要

承诺的美元报告"


strFile = strDocName& " .snp"

strPathAndFile = strPath& strFile


''再次打印相同的报告,但隐藏详细信息部分


DoCmd.OpenReport strDocName,acViewPreview ,, _

" rptPaymentDueDateandDollars.Detail.Visible = False" ''

给出错误


DoCmd.OutputTo acOutputReport,strDocName," snapshot format",

_

strPathAndFile

DoCmd.Close acReport,strDocName
Hi -
Is it possible to hide the detail section of a report at run time?

I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.

It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can''t figure out the code to do that and don''t see it
posted.

Thanks -
Sara

strDocName = "rptPaymentDueDateandDollars"

strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile '' works fine

strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile

'' Print same report again, but hide the Detail section

DoCmd.OpenReport strDocName, acViewPreview, , _
"rptPaymentDueDateandDollars.Detail.Visible = False" ''
gives error

DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile

DoCmd.Close acReport, strDocName



将以下内容添加到报告的开放事件中。


如果MsgBox(显示详细信息和摘要?,vbYesNo,确认)= vbNo则

Me.Section(0) .Visible = False

结束如果


用户每次打开报告时都需要回复,默认为

显示详细信息部分。

Add the following to the report''s open event.

If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).Visible = False
End If

The user will need to respond each time the report is opened, the default is
to show the detail section.


9月7日下午1:27,paii,Ron < n ... @ no.comwrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwrote:

" sara" < saraqp ... @ yahoo.com写了留言


新闻:11 ********************* @ r34g2000hsd .googlegro ups.com ...

"sara" <saraqp...@yahoo.comwrote in message

news:11*********************@r34g2000hsd.googlegro ups.com...



Hi -

是否可以隐藏详细信息部分运行时的报告?
Hi -
Is it possible to hide the detail section of a report at run time?


我有一份报告,打印所有细节,包括摘要行。用户

希望报告也只是汇总行。
I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.


似乎最简单的方法是运行代码(见下文)一次用

显示详细信息部分,以及第二次隐藏细节

部分。我无法弄清楚这样做的代码而且看不到

张贴。
It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can''t figure out the code to do that and don''t see it
posted.


谢谢 -

Sara
Thanks -
Sara


strDocName =" rptPaymentDueDateandDollars"
strDocName = "rptPaymentDueDateandDollars"


strStepErrorMsg ="告诉IT细节有问题

承诺美元报告"
strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"


strFile = strDocName& " .snp"

strPathAndFile = strPath& strFile

DoCmd.OutputTo acOutputReport,strDocName," snapshot format",

_

strPathAndFile''正常工作
strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile '' works fine


strStepErrorMsg ="告诉它有一个问题摘要

承诺的美元报告"
strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"


strFile = strDocName& " .snp"

strPathAndFile = strPath& strFile
strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile


''再次打印相同的报告,但隐藏详细信息部分
'' Print same report again, but hide the Detail section


DoCmd.OpenReport strDocName,acViewPreview ,, _

" rptPaymentDueDateandDollars.Detail.Visible = False" ''

给出错误
DoCmd.OpenReport strDocName, acViewPreview, , _
"rptPaymentDueDateandDollars.Detail.Visible = False" ''
gives error


DoCmd.OutputTo acOutputReport,strDocName," snapshot format",

_

strPathAndFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile


DoCmd.Close acReport,strDocName
DoCmd.Close acReport, strDocName



将以下内容添加到报告的公开活动中。


如果MsgBox(显示详细信息和摘要?",vbYesNo,"确认)= vbNo然后

Me.Section(0).Visible = False

结束如果


用户每次都需要回复报告打开,默认为

显示详细信息部分.-隐藏引用文字 -


- 显示引用文字 -


Add the following to the report''s open event.

If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).Visible = False
End If

The user will need to respond each time the report is opened, the default is
to show the detail section.- Hide quoted text -

- Show quoted text -



有没有办法让用户不必回应?所以它

自动从一个定义创建两个报告 -

详细信息,摘要?


谢谢 -

Sara


Is there any way to do it so the user doesn''t have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?

thanks -
Sara


sara写道:
sara wrote:

9月7日,1:27下午,paii,Ron < n ... @ no.comwrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwrote:

>>" sara" < saraqp ... @ yahoo.com写了留言

新闻:11 ********************* @ r34g2000hsd.googleg roups。 com ...

>>"sara" <saraqp...@yahoo.comwrote in message

news:11*********************@r34g2000hsd.googleg roups.com...


>>>嗨 -
是否可以在运行时隐藏报告的详细信息部分?
>>>Hi -
Is it possible to hide the detail section of a report at run time?


>>>我有一个报告,打印所有细节,包括摘要行。用户
希望报告也只是摘要行。
>>>I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.


>>>似乎最简单的方法是运行代码(见下文)一次,显示详细信息部分,第二次隐藏细节
部分。我无法弄清楚这样做的代码并且没有看到它发布。
>>>It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can''t figure out the code to do that and don''t see it
posted.


>>>谢谢 -
Sara
>>>Thanks -
Sara


>> strDocName =" rptPaymentDueDateandDollars"
>> strDocName = "rptPaymentDueDateandDollars"


>> strStepErrorMsg ="告诉IT细节存在问题
承诺美元报告"
>> strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"


>> strFile = strDocName& " .snp"
strPathAndFile = strPath& strFile
DoCmd.OutputTo acOutputReport,strDocName," snapshot format",
_
strPathAndFile''正常工作
>> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile '' works fine


>> strStepErrorMsg ="告诉IT有关摘要
承诺美元报告的问题"
>> strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"


>> strFile = strDocName& " .snp"
strPathAndFile = strPath& strFile
>> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile


>>>''再次打印相同的报告,但隐藏详细信息部分
>>>'' Print same report again, but hide the Detail section


>> DoCmd.OpenReport strDocName,acViewPreview ,, _
" rptPaymentDueDateandDollars.Detail.Visible = False" ''
给出错误
>> DoCmd.OpenReport strDocName, acViewPreview, , _
"rptPaymentDueDateandDollars.Detail.Visible = False" ''
gives error


>> DoCmd.OutputTo acOutputReport,strDocName," snapshot format",

strPathAndFile
>> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile


>> DoCmd.Close acReport,strDocName
>> DoCmd.Close acReport, strDocName


将以下内容添加到报告的打开事件中。

如果MsgBox(显示详细信息和摘要?) ,vbYesNo,确认)= vbNo然后
Me.Section(0).Visible = False
结束如果

用户每次报告时都需要回复打开,默认为
显示详细信息部分.-隐藏引用文字 -

- 显示引用文字 -


Add the following to the report''s open event.

If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).Visible = False
End If

The user will need to respond each time the report is opened, the default is
to show the detail section.- Hide quoted text -

- Show quoted text -




有没有办法让用户不必回应?所以它

自动从一个定义创建两个报告 -

详细信息,摘要?


谢谢 -

Sara


Is there any way to do it so the user doesn''t have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?

thanks -
Sara



从调用报告的表单中进行...如果有的话。您可以从表单中选择打印或预览,摘要,详细信息和任何过滤器

。在报告的OnOpen事件中,你可以做任何你喜欢的设置。

Do it from the form that calls the report...if you have one. You can
give the options to print or preview, summary, detail, and any filters
from the form. In the OnOpen event of the report you can do whatever
setting you like.


这篇关于在运行时通过代码隐藏报告(详细信息)部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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