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

Multi-line column headers #4

Open
lee-lindley opened this issue May 25, 2023 · 0 comments
Open

Multi-line column headers #4

lee-lindley opened this issue May 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@lee-lindley
Copy link
Owner

Fernando Luna requests:
Is it possible to set a (column) header so that it spans two rows?
I believe that’s possible within something like Oracle reports by specifying something like “Sales|2022”. If not, is there another way to get this done?

My response:
If you want to do it, you can fork and try to do it yourself. There is already a mechanism to provide the column headers independent of the cursor in a structure t_col_headers. Perhaps allow that structure to have 2 or three lines, so an array of arrays. Then the local procedure named show_header inside cursor2table would need to walk those. Instead of doing that, you could parse the incoming headers for '|' as you say is established convention somewhere. I think I would use CHR(10) newline for that instead, but either way you would need to parse the column headers and break them into internal arrays representing each line of the column header.

The bigger problem is the concept of the vertical location on the page which is maintained in variable v_y. This bit of code shown below in cursor2table is assuming the column headers are a single line. You would need to figure out how to advance v_y based on the maximum number of lines in any of the column headers values. It is also nasty because we go down in value of v_y as we go down the page, so you subtract instead of add. It can be very confusing. I did a lot of drawing on a scrap of paper and putting in values.

        IF v_page_count = 0 OR v_y < as_pdf3.get(as_pdf3.c_get_margin_bottom) 
        THEN -- either nothing done yet or already wrote a full page and need to start a new one
            as_pdf3.new_page;
            v_page_count := as_pdf3.get(as_pdf3.c_get_page_count);
            v_y := y_top_margin - v_lineheight; 
        END IF;

        show_header;

It is more than I want to do, but I would support you if you want to add it. I'm starting a new job next week, so I'm not going to have much time for a while. Good luck with it.

@lee-lindley lee-lindley added the enhancement New feature or request label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant