Forum Stats

  • 3,838,721 Users
  • 2,262,395 Discussions
  • 7,900,739 Comments

Discussions

Classic report template

Phil W
Phil W Member Posts: 707 Bronze Badge
edited Apr 27, 2022 1:38PM in APEX Discussions

I need to create a report template in v21.1 that shows both a row and column group cell but to complicate matters, the report will have x rows and y columns as the query is dynamic.

Is this possible as what I have found is the ability to create this when the number of cols/rows is known?

Thanks in advance,

Phil


Tagged:

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    Answer ✓

    I wasn't as clear as I meant to be, sorry but yes #1 is what is already done and it works well. But what I'd like to do is have a row added on the top above cell 3 with a colspan of 5 which will contain a description of the type details in each cell.

    You can continue with that approach and use a custom copy of the Standard (generic column) report template with the additional header row added to the Before Column Heading definition.

Answers

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond

    Methods of developing dynamic pivot/matrix classic reports in APEX have been discussed on several occasions in this forum. Two of them are:

    1. Dynamic SQL + standard report template + generic columns: APEX 5.0 : dynamic pivot 'in' clause returning no data and a more recent thread on similar lines.
    2. Static SQL (XML pivot) + XSLT + custom report template: Matrix report

    Option 1 is generally the simplest approach as it utilises an existing report template and built-in declarative options. Option 2 is good for more complex report layouts (as long as your requirements are realistic).

  • Phil W
    Phil W Member Posts: 707 Bronze Badge

    I wasn't as clear as I meant to be, sorry but yes #1 is what is already done and it works well. But what I'd like to do is have a row added on the top above cell 3 with a colspan of 5 which will contain a description of the type details in each cell.

    The number of cols is dynamic as are the number of rows so jQuery might be the way to go. I can also take off the border on the top and left of cell 1 on the top left.

    I think this is the approach I'll take tomorrow at work 🤞

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    Answer ✓

    I wasn't as clear as I meant to be, sorry but yes #1 is what is already done and it works well. But what I'd like to do is have a row added on the top above cell 3 with a colspan of 5 which will contain a description of the type details in each cell.

    You can continue with that approach and use a custom copy of the Standard (generic column) report template with the additional header row added to the Before Column Heading definition.

  • Phil W
    Phil W Member Posts: 707 Bronze Badge

    Thanks, I had a quick go but the problem is that with the rowspan, it will mean irregular cell numbers on the rows below the first one as I need to add in a colspan at the top to group the "types" and have a text description in that.

    I can't see that this will work so might try constructing it from code instead.

    It is a nice to have, the end user does not need this but asthetcially it would be pretty :)