1. Trevor Campbell
  2. Report Editor
  3. Friday, March 29 2019, 04:00 AM
  4.  Subscribe via 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
Attachments (1)
Comment
There are no comments made yet.
Trevor Campbell Accepted Answer
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
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 1
Trevor Campbell Accepted Answer
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)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 2
Trevor Campbell Accepted Answer
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)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 3
Sergey Pashkov Accepted Answer
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)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 4
Trevor Campbell Accepted Answer
I have tried putting dFrom instead, but I get the same error.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 5
Sergey Pashkov Accepted Answer
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)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 6
Trevor Campbell Accepted Answer
That worked perfect.

Thanks
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 7
  • Page :
  • 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