1. jaume
  2. Valentina Reports ADK
  3. 土, 2月 01 2020, 11:58 AM
  4.  メールで購読
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
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Hello Jaume,

What type of control PREUVENDA1 is? A field?

You have
" report.controls.PREUVENDA1.print = false;"

in some script of the subreport, which one?

Then you edit this script and set to true but the control is not shown anyway.
Is that how it happens?
コメント
There are no comments made yet.
jaume 承諾済みの回答
Yes, it is a field.

Pre_build.

if it is set = false it is not shown

if it set = true it is not shown

if line it is removed it is shown again
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
The issue is that properties don't accept true/false now, only 1/0.
The following should work:
report.controls.PREUVENDA1.print = 1;
コメント
There are no comments made yet.
jaume 承諾済みの回答
Do the report parameters must be redeclared in the subreport ?
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
No, it’s not necessary.
コメント
There are no comments made yet.
jaume 承諾済みの回答
I have in main report script
var v = report.parameterValue('param3');

if (v == 'N') {
report.controls.label22.print ='';
report.controls.expression12.print = 0;
report.controls.expression11.print = 0;
report.controls.label25.print = 0;

}

and it works fine

in the subreport I have this sniped code

var v = report.parameterValue('param3');

if (v == 'N') {
report.controls.PREUVENDA1.print = 0;
report.controls.DPTE1.print = 0;
report.controls.IMPORT1.print =0 ;

}

and the report controls are printed always even v =='N'

What am i doing wrong ?
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Looks correct. Is it in the Valentina Studio? How do you define the parameter?

Added screenshots of how it worked for me.
添付ファイル
コメント
There are no comments made yet.
jaume 承諾済みの回答
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 ?
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
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.
コメント
There are no comments made yet.
jaume 承諾済みの回答
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)
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
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?
添付ファイル
コメント
There are no comments made yet.
jaume 承諾済みの回答
yes, it is added

Main report is printed and expresion param3 is printed
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
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.
添付ファイル
コメント
There are no comments made yet.
jaume 承諾済みの回答
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.
コメント
There are no comments made yet.
jaume 承諾済みの回答
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.
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
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?
コメント
There are no comments made yet.
jaume 承諾済みの回答
Hello, I can see param3 in the subreport rightnow and the value is correct

but can't hide columms

What am I doing wrong ?
添付ファイル
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
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;
コメント
There are no comments made yet.
jaume 承諾済みの回答
whitout conditions works properly.

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

there is no capital letters
添付ファイル
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
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;
添付ファイル
コメント
There are no comments made yet.
  • ページ :
  • 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