1. PBI
  2. Report Editor
  3. Samstag, März 04 2017, 08:05 AM
  4.  Abonnieren via E-Mail
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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
Kommentar
There are no comments made yet.
PBI Akzeptierte Antwort
:(

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

...

Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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" )
Kommentar
There are no comments made yet.
PBI Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
And you have declared ShowPic1 as a Boolean on the Parameters tab on the left in the design mode of the Report Editor, right?
Kommentar
There are no comments made yet.
PBI Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Can't reproduce with my test data source. What database kind is used?
Kommentar
There are no comments made yet.
PBI Akzeptierte Antwort
SQLite version 3.8.8 created from XOJO
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
PBI Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
  • Seite :
  • 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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories