1. Trevor Campbell
  2. Report Editor
  3. Пятница, Март 29 2019, 04:00 AM
  4.  Подписаться через email
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