How to set the printing direction of the column area of a cross tab on pages when using an interval

alex_wie
edited February 11, 2022 in Analytics #1

Hello everybody,

we are relatively new to BIRT and work with version 4.7.0.

How is it possible to determine the printing direction of the column area (cross tab) on the respective pages? First, the pages containing the different values for the column headers should be created. Only then should the other data from the rows appear. I have already tested the options "horizontal" and "vertical" in the property "Orientation" of the cross tab itself, but unfortunately without success.
To have only 4 header columns on one page, we use the interval under "Cross Tab" -> "Column Area" -> "Page Break" -> "Interval".

Thank you very much.
Many greetings
Alex

Best Answer

  • jfranken
    #2 Answer ✓

    Hi Alex,

    Open source does run and render together. The pro version does them separately. You said, "We use separate run and render task." That's why I asked if you were running pro.

    If you can't find a solution with your Java class, take a look at this thread:

    https://communities.opentext.com/forums/discussion/57705/dynamic-creation-of-tables-in-birt

    My thought is that you can use the technique described in this thread to run the query in code and get the length of the text that will be displayed in the crosstab before the crosstab's onPrepare event triggers. You can use that information to set the row page break interval in onPrepare.

    I have not tested this so I am not certain it will work.

    Warning No formatter is installed for the format ipb

Answers

  • Can you help answer this question?

    We have noticed this question is over 30 days old and hasn't received a response. We're turning to you, the community, to help answer it.

    This generic response is intended to prompt discussion in this post. The question remains open to your answers, suggestions, and best practices.

    If you posted this question and were able to resolve the issue, please share your solution here with others. If you still need additional help, though, please let us know. Your question and its resolution are important to us, and we want to help.

    • Please note that questions to the developer network are typically peer-to-peer, best effort responses.
    • Additionally, note that posting questions to General may not be answered by a product expert. The General forum is for non-product questions. Please be sure to your product-specific questions to the proper product forum.

    David Sciuto

  • Hello, everybody,

    does anyone have a solution or a workaround for me?

    Many greetings
    Alex

  • Hi Alex,

    I was able to replicate the behavior you are seeing. I was also able to generate your desired output by adding a Row Area page break interval in addition to the Column Area page break interval. Please give that a try.

    Warning No formatter is installed for the format ipb
  • Hello, Jeff,

    thank you for your answer. In the example I've shown, your solution works perfectly. Unfortunately I didn't mention that the number of lines is variable and that the first column is a text item with variable high. Therefore I don't know how many rows are fitting on the first, second, third ... page.

    Do you see a way that the interval of the Row Area Page Break can be set dynamically per page (depending on the row previously printed)?

    Many greetings
    Alex

  • jfranken
    edited April 24, 2018 #7

    Hi Alex,

    There is a way to set the Row Page Break Interval dynamically, but I don't think it is going to help for the case that you described. To dynamically configure the page break, add the following code to the onPrepare event handler of the crosstab:

    function onPrepareCrosstab( crosstab, reportContext )
    {
    crosstab.setRowPageBreakInterval();
    }

    Here is the issue:
    This only works in the onPrepare event of the crosstab. The data set has not yet run when this event fires, so dynamically getting the length of the data is not possible. I tried putting the above code in the onCreate event of the crosstab thinking that I could create a computed column to get the length of the data and use that value to set the value of the Row Page Break Interval. The setRowPageBreakInterval() method wouldn't run in the onCreate event of the crosstab. It makes sense that the page breaks would need to be known prior to creating the elements.

    There might be a way to query the database ahead of the crosstab's onPrepare event. It would require a significant amount of custom coding if it's possible. Another option is to adjust the data element, crosstab, and/or master page formatting to display the data in a way where the page break isn't an issue. If that can't be done, perhaps you could fix the size of the data element so the page break will be constant and add a hyperlink to the data element. The hyperlink could be clicked to pop up a window showing the full text when it is too large to display in the crosstab.

    If you come up with a better solution, please post it.

    Warning No formatter is installed for the format ipb
  • jfranken
    edited April 24, 2018 #8

    In my previous post, crosstab.setRowPageBreakInterval() should have an integer value inside the parenthesis indicating the number of rows. For example:

    crosstab.setRowPageBreakInterval(10)

    or

    var n = code that gets no. of rows
    crosstab.setRowPageBreakInterval(n)

    Warning No formatter is installed for the format ipb
  • One additional option is to create one or more Highlight rules for the crosstab. The Highlight rule can adjust the size of the font based on the length of the text in the field.

    Warning No formatter is installed for the format ipb
  • Hello, Jeff,

    thank you for your tips. Unfortunately the required layout is given by a legal sample, so that I have little or no scope for changes to the font sizes etc. there.

    I'm going to try a little more. Maybe I can find another way. If things get tough and I can't find a solution, I'll probably have to deal with automatically separating the PDF pages and then putting them back together in the required order. But that wouldn't be a nice solution.

    Now that I'm thinking about it again... We use separate run and render task. Is there a way to manipulate the document after the run task or during the render task and change the order of the pages there?

    Many greetings
    Alex

  • Hi Alex,

    I thought you were using open source BIRT. Are you running pro? If so, what version? Also, are you able to open a support ticket?

    Warning No formatter is installed for the format ipb
  • Hello, Jeff,

    your assumption was correct. We use open source BIRT version 4.7.0. For the later call I wrote a Java class, which does the creation via the BIRT library.

    What statement makes you think we're using the pro version?

    Many greetings
    Alex

  • jfranken
    #13 Answer ✓

    Hi Alex,

    Open source does run and render together. The pro version does them separately. You said, "We use separate run and render task." That's why I asked if you were running pro.

    If you can't find a solution with your Java class, take a look at this thread:

    https://communities.opentext.com/forums/discussion/57705/dynamic-creation-of-tables-in-birt

    My thought is that you can use the technique described in this thread to run the query in code and get the length of the text that will be displayed in the crosstab before the crosstab's onPrepare event triggers. You can use that information to set the row page break interval in onPrepare.

    I have not tested this so I am not certain it will work.

    Warning No formatter is installed for the format ipb