使用参数调用基于UDF的报告 [英] Call report based on UDF with parameters

查看:69
本文介绍了使用参数调用基于UDF的报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Access报表中创建基于SQL Server中的用户定义函数(UDF)返回表格。


创建函数MyFunc_VP(@VP varchar(12))

退货表

AS

退货(选择......


在Access,我打电话使用DoCmd.OpenReport方法的报告。


DOCMD.OpenReport stDocName,acPreview


如何调用报表从表单传递参数(Forms! FormName!TextBox)

(使用where子句的解决方案与我的问题不匹配)。

I create in Access report based on user defined function(UDF) in SQL Server which returns table.

CREATE FUNCTION MyFunc_VP (@VP varchar(12))
RETURNS TABLE
AS
RETURN (SELECT......

In Access, I am calling a report with DoCmd.OpenReport method.

DOCMD.OpenReport stDocName, acPreview

How to call report passing a parameter from form (Forms!FormName!TextBox)
(solution with where clause doesn''t match my problem).

推荐答案

您是否尝试过使用该报告'的过滤选项?
have you tried using the report''s filter option?
展开 | 选择 | Wrap | 行号



您是否尝试过使用报告的过滤器选项?


DoCmd.OpenReport reportname [,view] [,filtername ] [,wherecondition]


wherecondition =一个字符串表达式,它是一个有效的SQL WHERE子句,没有单词WHERE。



DOCMD.OpenReport stDocName,acPreview ,," [somefield] =" &安培; Forms!FormName!TextBox
have you tried using the report''s filter option?

DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]

wherecondition = A string expression that''s a valid SQL WHERE clause without the word WHERE.



DOCMD.OpenReport stDocName, acPreview,,"[somefield] = " & Forms!FormName!TextBox



谢谢,但是......

在Access Report中我使用用户定义函数(UDF)而不是查询。 UDF中的参数与SQL语句的哪个部分无关,因此您的解决方案对我不起作用。是否有其他方式传递参数调用报告?


Thank you, but..
in Access Report i use user defined function(UDF) instead of query. Parameters in UDF has no relation with where part of SQL statement, so your solution doens''t work for me. Is the any other way to pass parameters calling report?


你能展示你正在使用的是什么。

我不明白为什么过滤器不起作用,即使对于T-SQL UDF。


你试过它不是吗?
Can you show what you are using.
I can''t understand why the Filter would not work, even for a T-SQL UDF.

You have tried it haven''t you?


这篇关于使用参数调用基于UDF的报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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