1. jaume
  2. Valentina Reports ADK
  3. Saturday, February 01 2020, 11:58 AM
  4.  Subscribe via email
Hello,
I have a report with a subreport

I print the report and i also use parameters

One parameter is used to hidde or not to hide some columns in the subreport

I hide a field like " report.controls.PREUVENDA1.print = false;"

running the report field PREVENDA1 is not showed , that is correct.

The problem is that PREVEUFENDA1 is not show any more, even you edit the subreport change false by true. The only way to get PREUVENDA1 showed again is restoring a report backup. It is really frustating.

Jaume
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hello Jaume,

Thank you for the project. After a few changes to expressions type in the main report (SQL->Text With Macros) it works correctly (details in the trouble ticket).
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Thank you, so there is something that prevents parameter to be passed to subreport script.
Can you send a project (or maybe a part - main report and its query, subreport and its query)?
Comment
There are no comments made yet.
jaume Accepted Answer
This report works as expected
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Then there's something else which prevents passing a value.

I created the simplest report with subreport passing parameter from main report to the subreport script.
Could you please try it?
The main report is "report_phonebook", the field in subreport is hidden as expected, "N" letter is printed.
Attachments (2)
Comment
There are no comments made yet.
jaume Accepted Answer
I'm in the newest release
Attachments (1)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Looks like it is not the latest version, could you please try current 9.8.2?
Comment
There are no comments made yet.
jaume Accepted Answer
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Actually printing parameters using macro $P and getting it in script go different code paths.

There's a way to check what is returned from report.parameterValue function.

Just add an empty expression somewhere in this report and assign variable with parameter value to this expression in pre_build script:
var v1 = report.parameterValue( 'param3' );
report.controls.expression1.label = v1;
Attachments (2)
Comment
There are no comments made yet.
jaume Accepted Answer
whitout conditions works properly.

the value of param3 is displayed in the report "N" - first screenshot- it's correct.

there is no capital letters
Attachments (2)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Looks correct,

Is the parameter name "param3" is exactly the same as it was defined, no upper case in it?

At first, I would try to hide the field without any parameters conditions, to see if the print property fails
report.controls.DPTE1.print = 0;
Comment
There are no comments made yet.
jaume Accepted Answer
Hello, I can see param3 in the subreport rightnow and the value is correct

but can't hide columms

What am I doing wrong ?
Attachments (1)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Subreport not printed - how does it look like? All controls not printed, no empty spaces, no errors, just the controls of the main report?
Maybe you can add screenshots - main report layout, subreport layout, preview?
Comment
There are no comments made yet.
jaume Accepted Answer
Parameter in main report is printed, but is not printed the subreport nor parameter. If I remove parameter in sub report, subreport is printed.

Parametres are working okey in the subreport query but not in the body subreport or subreport scripts.

I did it before contact with suport. Unfortunelly the result was the same.
Comment
There are no comments made yet.
jaume Accepted Answer
Parameter in main report is printed, but is not printed the subreport nor parameter. If I remove parameter in sub report, subreport is printed.

I did it before contact with suport. Unfortunelly the result was the same.
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Can't reproduce it in version 9.8.2, expressions were added to the main report and subreport and in both cases, the parameter value was set correctly.

When you run the main report - parameter in main report is printed, parameter in subreport is not printed, correct?
Do you see it in any report? Maybe try to do it in a new simpler report-subreport.
Attachments (3)
Comment
There are no comments made yet.
jaume Accepted Answer
yes, it is added

Main report is printed and expresion param3 is printed
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Is it in the Valentina Studio of the latest version?
Parameter param3 is added on the parameters tab in the main report, right?

( expression and report is not printed)

So you run main report - and what happens? Nothing printed? Or the expression is empty?
Attachments (1)
Comment
There are no comments made yet.
jaume Accepted Answer
I added expression on main report to print param3 as "$P(param3) and it is printed.
I added expression on subreport to print param3 as "$P(param3) and report is not printed ( expression and report is not printed)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
No, that's not expected.
If the parameter is declared on the parameters tab of the main report - it must be visible to subreport in scripts and expressions.
Comment
There are no comments made yet.
jaume Accepted Answer
is it possible that only parameters used in the query in the subreport are available in the subreport and the rest of parameters are ignored ?
Comment
There are no comments made yet.
  • Page :
  • 1
  • 2


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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories