从子表单过滤(排序)子报表 [英] Filtering (sorting) subreport from subform

查看:54
本文介绍了从子表单过滤(排序)子报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我有一个MainForm和一个SubForm。它们是链接的,可以过滤,排序等......

我设计的MainReport和SubReport应该匹配MainForm和SubForm的过滤和排序标准。

我有打开报告的MainForm上的PrintButton!


此时我的MainReport被过滤并按照MainForm的方式排序,我试图让Sub Subport被过滤掉按照SubForm的方式排序。


我正在阅读过去三天试图找到灵感的论坛,最后我决定寻求帮助。


所以请帮帮忙!

谢谢,


Hrvoje

解决方案

< blockquote>与主/子表单一样,报表/子报表可以链接。

只需单击子报表并查看数据选项卡下的属性窗口,即可查看链接主页。和孩子需要指定链接字段的属性。


Nic; o)



与主/子表单一样,报表/子报表可以链接。

只需单击子报表,然后在数据选项卡下的属性窗口中查看链接主 ;和孩子需要指定链接字段的属性。


Nic; o)




嗨Nic; o!


感谢您的回复!

我的MainReport和SubReport的链接方式与Form和Subform相同。

但是当从工具栏中使用Filtr By Form过滤MainForm时,我也能够同样过滤我的Subform。

我想要的是从那个过滤器传递过滤器subform到我的子报告。


这是我过滤MainForm的方式:

------------------ -------------------------------------------------- -----------


私人子报告_打开(取消为整数)


错误GoTo Err_Report_Open

Me.Filter =表格!fObracunPlace.Filter

Me.FilterOn =表格!fObracunPlace.FilterOn


Me.OrderBy =表格!fObracunPlace.OrderBy

Me.OrderByOn =表格!fObracunPlace.OrderByOn


Exit_Report_Open:< br $>
退出Sub


Err_Report_Open:

恢复Exit_Report_Open


End Sub

--------------------------------------------- ----------------------------


我在过滤子报表时尝试使用相同的原理但我得到一个错误...


有没有人想出如何过滤子报告????


先谢谢支持!


Hrvoje


嗯,根据Access版本,您可以使用报告的OpenArg来传递过滤器并将其应用于子报告。

另一个100%的解决方案是动态更改子报表的查询。

这需要一个模板。原始过滤器的副本。在[Print]按钮中,您可以管理querydef的SQL属性,并替换尾随的" ;;"使用subformfilter。


获得想法?


Nic; o)


Hi!

I have a MainForm and a SubForm on it. They''re linked and can be filtered, sorted etc...
I designed MainReport and SubReport that should match filter and sort criteria from MainForm and SubForm.
I have a PrintButton on MainForm that opens the report!

At this moment my MainReport is being filtered and sorted excatly the way the MainForm is, and I was trying to get ma SubReport to be filtered and sorted the way the SubForm is.

I''m reading forums for the last three days trying to find some inspiration and I finaly decided to ask for help.

So please help out guys!
Thanks,

Hrvoje

解决方案

Like the main/sub form, the report/subreport can be linked.
Just single-click the subreport and look in the Properties window under the Data tab to see the Linkage "master" and "child" properties where the field(s) need to be specified of the link.

Nic;o)


Like the main/sub form, the report/subreport can be linked.
Just single-click the subreport and look in the Properties window under the Data tab to see the Linkage "master" and "child" properties where the field(s) need to be specified of the link.

Nic;o)



Hi Nic;o!

Thanks for the reply!
My MainReport and SubReport are linked the same way the Form and Subform are.
But when filtering the MainForm using Filtr By Form from the toolbar, I''m also able to filter my Subform in the same blow.
What I want is to pass that filter from the subform to my subreport.

This is how im filtering MainForm:
-------------------------------------------------------------------------------

Private Sub Report_Open(Cancel As Integer)

On Error GoTo Err_Report_Open

Me.Filter = Forms!fObracunPlace.Filter
Me.FilterOn = Forms!fObracunPlace.FilterOn

Me.OrderBy = Forms!fObracunPlace.OrderBy
Me.OrderByOn = Forms!fObracunPlace.OrderByOn

Exit_Report_Open:
Exit Sub

Err_Report_Open:
Resume Exit_Report_Open

End Sub
-------------------------------------------------------------------------

I tried to use the same principle when filtering subreport but I get an Error ...

Did anyone figured out how to filter subreports too????

Thanks in advance for the support!

Hrvoje


Hmm, depending on the Access version you could use the report''s OpenArg to pass the filter and apply it to the subreport.
Another 100% solution would be to dynamically change the subreport''s query.
This requires a "template" copy of the original filter. In the [Print] button you can manage the querydef''s SQL property with a replace of the trailing ";" with the subformfilter.

Getting the idea ?

Nic;o)


这篇关于从子表单过滤(排序)子报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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