1. Jay Madren
  2. Report Editor
  3. Mittwoch, Dezember 20 2017, 12:38 PM
  4.  Abonnieren via E-Mail
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?
Kommentar
There are no comments made yet.
Scott Akzeptierte Antwort
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
Kommentar
There are no comments made yet.
Jay Madren Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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;
Kommentar
There are no comments made yet.
Jay Madren Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Check the property of the group header on_each_page to print on a continuation page.
Kommentar
There are no comments made yet.
Jay Madren Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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;
Kommentar
There are no comments made yet.
Jay Madren Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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.
Anhänge
Referenzen
  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
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