1. Jay Madren
  2. Report Editor
  3. Wednesday, December 20 2017, 12:38 PM
  4.  Subscribe via email
I wish to print a label/expression at the top of the page whenever a group is being continued from a previous page. How can I determine if this has occurred so I can print a message?
Comment
There are no comments made yet.
Scott Accepted Answer
You can use a column header for this. It will print at the top of the column on every page it breaks across. I can be more detailed when I get back to the office.

Scott
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 1
Jay Madren Accepted Answer
A column header will print on every page, not just pages that the group breaks across. I only want something printed at the top of the page on the second and further pages of a group that spans more than one page.

I found a way to do it - I had to add a lot more to the report query to make this determination, and that I could use in a print_if conditional on the control. But it works fine now.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 2
Sergey Pashkov Accepted Answer
Hello Jay,

You can determine it in the JavaScript.

Here's an example.
Group header contains expMessage expression field to output a message if group continues on the next page.

pre_place script of the group header:
grp = report.cursor.columnValue( 'fldGroup' );
report.controls.expMessage.label = grp == report.last_grp ? 'group continues' : '';
report.last_grp = grp;
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 3
Jay Madren Accepted Answer
You can determine it in the JavaScript.

Here's an example.
Group header contains expMessage expression field to output a message if group continues on the next page.

pre_place script of the group header:
grp = report.cursor.columnValue( 'fldGroup' );
report.controls.expMessage.label = grp == report.last_grp ? 'group continues' : '';
report.last_grp = grp;

I tried this and it doesn't work correctly. It only displays the message when the group starts on a page. Also, putting it on the group header won't work, as the group header isn't printed on a continuation page, only where the group starts. I tried moving the above to the page header, but then it never displayed the message.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 4
Sergey Pashkov Accepted Answer
Check the property of the group header on_each_page to print on a continuation page.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 5
Jay Madren Accepted Answer
Check the property of the group header on_each_page to print on a continuation page.

I have other items on the group header (a label, a field and a line) that I don't want printed on subsequent pages.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 6
Sergey Pashkov Accepted Answer
Then you can hide the other items in the same script

p = grp == report.last_grp ? 0 : 1;

report.controls.fieldGroup.print = p;
report.controls.lblGroup.print = p;
report.controls.lineGroup.print = p;
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 7
Jay Madren Accepted Answer
Then you can hide the other items in the same script

p = grp == report.last_grp ? 0 : 1;

report.controls.fieldGroup.print = p;
report.controls.lblGroup.print = p;
report.controls.lineGroup.print = p;

I couldn't get this to work.

As I said before, I got it working by adding some stuff to the query, and I'm tired of messing around with these alternate solutions.

But what is really needed is a comprehensive guide to using these javascript scripts, including a complete object model reference. Otherwise, we're just shooting in the dark trying these various snippets that are posted here.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 8
Sergey Pashkov Accepted Answer
Could you please add more details about your report layout (screenshot of layout would be very helpful)?
What database engine/server used, what type of the field used for grouping?

There must be some difference, why it works in my sample(attached) and doesn't work for you.

And there is a JavaScript reference in a wiki. Mostly it's all about manipulating the control's properties.
Attachments (1)
References
  1. http://valentina-db.com/docs/dokuwiki/v7/doku.php?id=valentina:products:vstudio:help:report_editor:scripts:javascript:javascript
  2. http://valentina-db.com/docs/dokuwiki/v7/doku.php?id=valentina:products:vstudio:help:report_editor:scripts:javascript:api:api
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 9
  • 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