Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FRG] absoluteY does not reset after page break #201

Open
beauwest opened this issue Aug 18, 2020 · 4 comments
Open

[FRG] absoluteY does not reset after page break #201

beauwest opened this issue Aug 18, 2020 · 4 comments
Assignees

Comments

@beauwest
Copy link
Contributor

In the Fluent API, we can specify a manual report.newPage(), but I don't see a way to do that in FRG.

Currently, even if I try to copy the newLine JSON syntax, and manually add

{"type":"newPage"}

as a child of a section, it does not create a new page.

I have a large final summary section that I would like to place a page break inside of.

@beauwest
Copy link
Contributor Author

beauwest commented Aug 18, 2020

I did just find that manually setting

{"type":"newPage", "active":true},

In the JSON will work.

However, after a new page, absoluteY has to be reset to 0, but in the visual editor that causes elements to overlap.

@NathanaelA
Copy link
Owner

Their is two things...

  1. Are you aware that all sections has a Page break feature, this allows you to force a page feed before or after a section is printed (however, I'm not sure that would help you in this case).

  2. On the toolbar;
    image
    this has been available; the double page on the right creates this entry (that you found) in the JSON. 😀

Now as to the absoluteY; that is an interesting glitch -- I'll have to figure a good work around for it...

@NathanaelA NathanaelA self-assigned this Aug 19, 2020
@beauwest
Copy link
Contributor Author

Huh, I'm not quite sure how I missed that button. 😳

My workaround for the absoluteY issue, so far, is something like this, in case it's useful to see what I'm wanting.

  let pastPageBreak = false;
  let subtract = 0;
  for (const child of structure.finalSummary.children) {
    if (child.type === 'newPage') {
      pastPageBreak = true;
      subtract = 0;
    }
    if (!subtract && pastPageBreak && child.settings && child.settings.absoluteY) {
      subtract = child.settings.absoluteY;
    }
    if (subtract) {
      child.settings.absoluteY -= subtract;
    }
  }

In my use case, I have a final summary, with 2 manual page breaks in it, as well as a pageBreak "before". It's a long one.

@beauwest beauwest changed the title [FRG] Allow manual "newPage" [FRG] absoluteY does not reset after page break Aug 20, 2020
Frustrated-Programmer added a commit to Frustrated-Programmer/fluentreports that referenced this issue Aug 23, 2020
@NathanaelA
Copy link
Owner

@beauwest - This issue ended up being a bit more tricky to fix and ended up messing up some reports... So all the other issues you reported have been fixed in the new 1.3.4 version; this specific one we are still working on& dealing with the several corner cases that occurred when we implemented this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants