1. PBI
  2. Report Editor
  3. Saturday, March 04 2017, 08:05 AM
  4.  Subscribe via email
Hi,
I have to make visible or not some objects depending on the value of a boolean parameter.

I do not understand how to set the print_if properties of this objects.

If it's possible, please show me some examples,

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

Currently it is not possible to use parameter directly in this property, but you can add it to the source query, for example
SELECT $P(pShow) as fShow FROM table1


And then use new field in an expression for print_if property for control:
fShow=true
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 1
PBI Accepted Answer
:(

I have to show or hide some objects,
picture and label, in the footer region,
Independe from the content of the query.

Example:


...

MyProject.MakeNewReport( ReportName, DBFile, "SELECT * FROM TableXXX "
...

if ShowPicture1 = True Then
mVReport.SetParameterValue( "ShowPic1", True)
else
mVReport.SetParameterValue( "ShowPic1", False )
end if

if ShowPicture2 = True Then
mVReport.SetParameterValue( "ShowPic2", True)
else
mVReport.SetParameterValue( "ShowPic2", False )
end if

...

Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 2
Sergey Pashkov Accepted Answer
I've rechecked how the print_if is processed and it is possible to use the shorter way.

For example provided you can write the following print_if expression:
$P(ShowPic1)=true

And set the parameter (note, the type is string):
mVReport.SetParameterValue( "ShowPic1", "true" )
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 3
PBI Accepted Answer
This is correct:

on print_if field

$P(ShowPic1)= "true"

( note that "true" is string )

the setting of the parameter is ok

mVReport.SetParameterValue( "ShowPic1", "true" )


Thanks.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 4
Sergey Pashkov Accepted Answer
And you have declared ShowPic1 as a Boolean on the Parameters tab on the left in the design mode of the Report Editor, right?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 5
PBI Accepted Answer
And you have declared ShowPic1 as a Boolean on the Parameters tab on the left in the design mode of the Report Editor, right?


No, I have declared the parameter as a string.

If I declare as a Boolean value it does not work.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 6
Sergey Pashkov Accepted Answer
Can't reproduce with my test data source. What database kind is used?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 7
PBI Accepted Answer
SQLite version 3.8.8 created from XOJO
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 8
Sergey Pashkov Accepted Answer
Thank you, now it's clear - SQLite doesn't have boolean literals, so need to use string or number.
There will be fix for interactive parameters - to pass not true or false, but 1 or 0 for SQLite.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 9
PBI Accepted Answer
yes, I know,
but I thought to pass parameters to the boolean properties as: print_if (true / false), Transparent (true / false), etc ...,
like with other report editor where I can pass boolean values independently from the data source.

Thanks.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 10
  • Page :
  • 1


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