1. Trevor Campbell
  2. Report Editor
  3. 金, 3月 29 2019, 04:00 AM
  4.  メールで購読
I have a report and a subreport that uses the same query. The query has a start and end date parameter.

I'm trying to map the value of the main report parameter value to the subreport parameter value.

When I try to map it, I get an error.

I'm using Version 8
添付ファイル
コメント
There are no comments made yet.
Trevor Campbell 承諾済みの回答
I have a report and a subreport that uses the same query. The query has a start and end date parameter.

I'm trying to map the value of the main report parameter value to the subreport parameter value.

When I try to map it, I get an error.

I'm using Version 8
コメント
There are no comments made yet.
Trevor Campbell 承諾済みの回答
I have a report and a subreport that uses the same query. The query has a start and end date parameter.

I'm trying to map the value of the main report parameter value to the subreport parameter value.

When I try to map it, I get an error.

I'm using Version 8


Here is the Query


SELECT *,$P(pFrom) as dFrom,$P(pTo) as dTo from "user"."VSales_Stats_Rpt" where quote_date BETWEEN $P(pFrom) and $P(pTo)
コメント
There are no comments made yet.
Trevor Campbell 承諾済みの回答
I have a report and a subreport that uses the same query. The query has a start and end date parameter.

The subreport works but without the mapping it uses the default parameter values.

I'm trying to map the value of the main report parameter value to the subreport parameter value.

When I try to map it, I get an error.

I'm using Version 8


Here is the Query


SELECT *,$P(pFrom) as dFrom,$P(pTo) as dTo from "user"."VSales_Stats_Rpt" where quote_date BETWEEN $P(pFrom) and $P(pTo)
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Hello Trevor,

And in the Map Parameters dialog you should write dFrom, not pFrom:
pFrom = dFrom

It is for version 8. In the latest versions parameters set for the main report automatically set for the subreport query (if not defined by the map of parameters)
コメント
There are no comments made yet.
Trevor Campbell 承諾済みの回答
I have tried putting dFrom instead, but I get the same error.
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Yes, this error is on the Map Parameters dialog Test tab, so there is an issue in parameters substitution on this tab.
But when you make a preview of this report - there is another error about inconsistent parameters (VARCHAR in FROM section and DATE in BETWEEN section).

To fix it, it is necessary to CAST parameters so they will be of the same type, for example:

SELECT *, CAST ( $P(pFrom) AS DATE ) as dFrom, CAST ( $P(pTo) AS DATE ) as dTo from "user"."VSales_Stats_Rpt" where quote_date BETWEEN $P(pFrom) and $P(pTo)
コメント
There are no comments made yet.
Trevor Campbell 承諾済みの回答
That worked perfect.

Thanks
コメント
There are no comments made yet.
  • ページ :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories