1. Trevor Campbell
  2. Report Editor
  3. Friday, October 06 2017, 12:41 AM
  4.  Subscribe via email
I am trying to use values such as $(record) or $(page) in the print_if property. Can't get it to work.

I have tried the following
$(record) < $(recordtotal)

Am I doing this wrong?

Does anyone have any suggestions?
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hello Trevor,

The print_if property accepts:
- The field name from the source cursor
- SQL expression

So currently it is impossible to use macros here.

But with JavaScript, I was able to hide a field in the last record.

To do it I added the following Report Body pre_place script:

report.controls.field_to_hide.print = report.cursor.position < report.cursor.recordCount ? 1 : 0;
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 1
Trevor Campbell Accepted Answer
Thanks for the reply. I am trying to stop a page break if it is the last record. Will this code work for a page break?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 2
Sergey Pashkov Accepted Answer
Yes, it works.

And the page break is inside of the page body, right?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 3
Trevor Campbell Accepted Answer
It's in a grouped footer.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 4
Trevor Campbell Accepted Answer
I couldn't get the above to work.

I have included a screen shot to make things a bit clearer. I am wanting the pagebreak to not create another page at the end of the report.

Thanks
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 5
Sergey Pashkov Accepted Answer
There's the property new_page in the group header, but it will make a page break after the Report Header and Page Footer, so can't be used here.

I've placed the following code in the group footer pre_place script and it worked:
report.controls.break1.print = report.cursor.position < report.cursor.recordCount ? 1 : 0;
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 6
Trevor Campbell Accepted Answer
Works perfect.:D

Thanks
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 7
Trevor Campbell Accepted Answer
It works great in the report designer but when I use it in the app it doesn't work.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 8
Sergey Pashkov Accepted Answer
Hi Trevor,

It's strange.

It is used in Xojo, right? Does the version of the plugin match the version of the Valentina Studio?
Are there any parameters in this report?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 9
Trevor Campbell Accepted Answer
I'm using the latest version of valentina studio. I will check the plugin. I haven't updated the plugin for a while. Where do I get the latest version of the plugin.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 10
Sergey Pashkov Accepted Answer
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 11
Trevor Campbell Accepted Answer
Updated plugins and it seems to work now.:D

Thanks
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 12
  • 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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories