This discussion is archived
8 Replies Latest reply: Sep 27, 2013 12:41 PM by fac586 RSS

Q.how to generate a multi row report

Gordon_Freeman Newbie
Currently Being Moderated

i am newbie and hard to find the place to implement the function....

I am doing a kind of transcript application that will report different terms of the results I have used the form before and it only display one row of the result by a PK if I create a view like this

+------+--------+-------+------+

|ID  | Term   | Sub |Grade |

+------+--------+-------+------+

|1001  |201301  |  BIO  | A   |

|1001  |201301  |  CHEM ||

|1001  |201309  |  HIS  ||

|1001  |201401  |  ENG  ||

+------+--------+-------+------+

which type of page in apex can help me to generate a multi-row report?like that:

ID:1001


term:201301

SUB:  Grade:

BIO A

CHEM B


term:201309

sub : Grade:

his C


term:201401

sub Grade:

eng F

if user insert new row for new term and grade ,the report should add the new term partition.

  • 1. Re: Q.how to generate a multi row report
    fac586 Guru
    Currently Being Moderated

    0e9e46fd-1b89-44c9-bba1-6271454a2ebd wrote:

    Please update your forum profile with a real handle instead of "0e9e46fd-1b89-44c9-bba1-6271454a2ebd".

    i am newbie and hard to find the place to implement the function....

    I am doing a kind of transcript application that will report different terms of the results I have used the form before and it only display one row of the result by a PK if I create a view like this

    +------+--------+-------+------+

     

    |ID  | Term   | Sub |Grade |

     

    +------+--------+-------+------+

     

    |1001  |201301  |  BIO  | A   |

     

    |1001  |201301  |  CHEM ||

     

    |1001  |201309  |  HIS  ||

     

    |1001  |201401  |  ENG  ||

     

    +------+--------+-------+------+

     

     

    which type of page in apex can help me to generate a multi-row report?like that:

    ID:1001


    term:201301

    SUB:  Grade:

    BIO A

    CHEM B


    term:201309

    sub : Grade:

    his C


    term:201401

    sub Grade:

    eng F

    if user insert new row for new term and grade ,the report should add the new term partition.

    Do you require a report (read-only) or a tabular form (for data entry)? Personally, I do not recommend the use of tabular forms, particularly by inexperienced APEX developers...

     

    For a read-only report, use a classic SQL report region with a custom named column report template. The report query should use analytic functions to determine when new ID and term partitions start, and conditional row templates to display the appropriate row structure/contents accordingly.

     

    Here's a detailed (if rather complex) example.

  • 2. Re: Q.how to generate a multi row report
    Gordon_Freeman Newbie
    Currently Being Moderated

    yes ,i need a read-only report only

    it seems i have to understand how to locate the row date implement to javascript for calculate some score and find a way to insert his variable in the page

    thanks for the help

  • 3. Re: Q.how to generate a multi row report
    fac586 Guru
    Currently Being Moderated

    0e9e46fd-1b89-44c9-bba1-6271454a2ebd wrote:

     

    yes ,i need a read-only report only

    it seems i have to understand how to locate the row date implement to javascript for calculate some score and find a way to insert his variable in the page

    If this somehow relates to the original question then I have no idea what it means. There is no JavaScript or "variable" involved in the use of a custom report template as described above.

  • 4. Re: Q.how to generate a multi row report
    StewStryker Journeyer
    Currently Being Moderated

    As face586 was trying to say, nstead of using javascript to calculate a report value, you'll need to calculate it within the SQL that your report is based on. 


    I'm guessing that you're not familiar enough with Apex to realize that the report query really drives the results that show up on your report, doing all the heavy lifting.  If you have a complex calculation to be done, it should probably be done in the database, rather than with javascript manipulating the report fields after the database has returned them.


    Best of luck,


    Stew

  • 5. Re: Q.how to generate a multi row report
    Gordon_Freeman Newbie
    Currently Being Moderated

    Friends,

    i am going to user the custom named column templates

    as the above example ,each row contain a term value #2

    buy i only want it show once

    and the table can create a new header when there is new term

    is it write something at the row template expression ?

  • 6. Re: Q.how to generate a multi row report
    Vite DBA Pro
    Currently Being Moderated

    Hi Gordon,

     

    I'm not sure, but I get the feeling you may be overthinking this. One of the main features of Apex is that you can achieve quite acceptable results without having to delve too deeply into the technology stack.

     

    In order to create a multirow report, create a query that gives you the data you require, then use one of the wizards to create either a classic report or an interactive report, accepting defaults as you go through the wizard. Once you are comfortable with the wizard, you can then start exploring the various options that are available to you in the wizard process. After this you will then find there is a huge amount of options in the builder part of Apex for customising the look and feel and functionality of your report, all without having to touch a line of code, or maybe a line here or there.

     

    Further to this, once again on the subject of look and feel, you can investigate the huge number of themes and template options that are available to you and if you feel more adventurous and if your HTML/CSS skills are up to it, you can start customising these. Finally, if you need to get specific results that don't seem to be catered for out of the box, you can investigate the world of plugins and javascript.

    I hope I've understood your situation correctly.

     

    Andre

  • 7. Re: Q.how to generate a multi row report
    Gordon_Freeman Newbie
    Currently Being Moderated

    thanks for your advice

  • 8. Re: Q.how to generate a multi row report
    fac586 Guru
    Currently Being Moderated

    Gordon_Freeman wrote:

     

    Friends,

    i am going to user the custom named column templates

    as the above example ,each row contain a term value #2

    buy i only want it show once

    and the table can create a new header when there is new term

    is it write something at the row template expression ?

    Yes, exactly that. Look at the example linked to above: Row Template 1 is displayed to start a new row group when the row template expression using column values computed in the query evaluates to true. If the row template expression is false, then the default Row Template 2 is used.

     

    Here's another example (Row Template with rowspan II) that uses analytics in a diferent way to provide report breaks using  rowspan.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points