Get your own customer support community
 

Lost in {Report Block}

I m using a {report-block} macro to list table in the template.
The code I have used

{report-table}
{expanding-reporter:data:cls|as=cls}
{local-reporter:page:children}
{text-sort:page:title}
{text-filter:data:FormName|include=Student}
{local-reporter}
{expanding-reporter}

{report-column:title=Position}{report-info:expanded:cls > data:Position}{report-column}
{report-column:title=Location}{report-info:expanded:cls > data:Location}{report-column}
{report-column:title=Jan}{report-info:expanded:cls > data:Jan}{report-column}
{report-column:title=Feb}{report-info:expanded:cls > data:Feb}{report-column}
{report-column:title=March}{report-info:expanded:cls > data:March}{report-column}
{report-column:title=April}{report-info:expanded:cls > data:April}{report-column}
{report-column:title=May}{report-info:expanded:cls > data:May}{report-column}
{report-column:title=June}{report-info:expanded:cls > data:June}{report-column}
{report-column:title=July}{report-info:expanded:cls > data:July}{report-column}
{report-column:title=Aug}{report-info:expanded:cls > data:Aug}{report-column}
{report-column:title=Sept}{report-info:expanded:cls > data:Sept}{report-column}
{report-column:title=Oct}{report-info:expanded:cls > data:Oct}{report-column}
{report-column:title=Nov}{report-info:expanded:cls > data:Nov}{report-column}
{report-column:title=Dec}{report-info:expanded:cls > data:Dec}{report-column}

{report-table}

The code works fine in the scenario where all the pages where cls table is , are childrens of the page.
I would like to add this code to the page where all the pages are chldrens of the Sibling.
For eg. Scaffold templates (pages) are childrens of A page And A and B are on same Hirarchy. I would like to List the table data in B Page

I have change {expanding-reporter} as follow

{expanding-reporter:data:cls|as=cls}
{content-reporter:space=concharter|types=page}
{text-sort:page:title}
{text-filter:page:title|include=

I dont know what to pass here.

{content-reporter}
{expanding-reporter}

Please Help

Thanks
Shweta
 
sad I’m sad
Inappropriate?
1 person has this question

  • Inappropriate?
    Hi Shweta,

    Probably the simplest option is if you can put a unique label on the sibling 'B' page, perhaps using {add-label} in the scaffold template.

    Let's say you call the label 'myscaffoldtemplate', you would have something like this in your reporter definition:


    {expanding-reporter:data:cls|as=cls}
    {local-reporter:page:parent > page:children}
    {text-sort:page:title}
    {text-filter:data:FormName|include=Student}
    {content-filter:@self|label=myscaffoldtemplate}
    {local-reporter}
    {expanding-reporter}


    That will only list sibling pages that have the 'myscaffoldtempate' (pick something appropriate to the template type for the label name).
  • shweta
    Inappropriate?
    Thanks David
    But Nope this doesnt solve my purpose

    I could not add image on the site as it is giving me an error 'responseText'
    is null or not an object.

    i may send you the images or code on your Id.

    I will try if I could describe the scenario.
    Page structure is as follow

    2009
    | 2009 Strudent
    | ---> student1
    | ---> student2
    | ---> student3
    |
    | Student List

    I have to display list of student in the Student list not in 2009 student.

    Student tempate is as below
    {html}
    <style>

    #children-section, #labels-section {
    display:none;
    height:0px;
    }

    TABLE.blue_dot th {
    background-color:treedface;

    }

    TABLE.bd_header {
    width:800px;

    }
    .textdetails
    {
    border:none;
    font-family: "Times New Roman";

    font-style:italic;
    vertical-align:top;
    }

    </style>{html}

    {table:class=bd_header|cellpadding=0|cellspacing=0}

    {tr}{th:colspan=4}h3.Source of Funds:{th}{tr}
    {tr}{td:class=textdetails|colspan=4}
    {text-data:s-f|content=wiki|type=area|width=95%|height=75px} {td}{tr}

    {tr}{th:colspan=4}h3.Source of Return:{th}{tr}
    {tr}{td:class=textdetails|colspan=4}
    {text-data:s-r|content=wiki|type=area|width=95%|height=75px}{text-data} {td}{tr}
    {tr}{th:colspan=4}\\{th}{tr}

    {tr}{th:colspan=4}h3.Travel Costs:{th}{tr}
    {tr}{td:class=textdetails|colspan=4}
    text-data:travel_cost|content=wiki|type=area|width=95%|height=75px}{text-data} {td}{tr}
    {tr}{th:colspan=4}\\{th}{tr}

    {table}

    h3.Labor Cost Details:
    {table-data:cls|width=790px|cellpadding=0|cellspacing=0}
    ||Position||Estimated Rate||Location||Jan||Feb||March||April||May||June||July||Aug||Sept||Oct||Nov||Dec||
    | {text-data:Position|width=50px}{text-data} | {number-data:est|width=50px}{number-data} |{text-data:Location|width=50px} | {number-data:Jan|width=50px}{number-data} | {number-data:Feb|width=50px}{number-data} | {number-data:March|width=50px}{number-data} | {number-data:April|width=50px}{number-data} | {number-data:May|width=50px}{number-data} | {number-data:June|width=50px}{number-data} | {number-data:July|width=50px}{number-data}| {number-data:Aug|width=50px}{number-data} | {number-data:Sept|width=50px}{number-data}| {number-data:Oct|width=50px}{number-data} | {number-data:Nov|width=50px}{number-data} | {number-data:Dec|width=50px}{number-data} |
    {table-data}

    ______________________________________________________

    And the List template code is as below

    {report-block}

    {content-reporter:types=page|scope=2009 Strudent> children}
    {text-filter:data:FormName|include=Student}
    {content-reporter}

    {report-body}

    ||Student ||Teacher||
    ||{report-info:page:title}||{page-info:created-user}||

    h3. Position

    {report-table}
    {expanding-reporter:data:cls|as=cls}
    {local-reporter:page:2009 Charters> page:children}
    {text-sort:page:title}
    {text-filter:data:FormName|include=Opportunity}

    {local-reporter}
    {expanding-reporter}

    {report-column:title=Position}{report-info:expanded:cls > data:Position}{report-column}
    {report-column:title=Estimated Rate}{report-info:expanded:cls > data:est}{report-column}
    {report-column:title=Location}{report-info:expanded:cls > data:Location}{report-column}
    {report-column:title=Jan}{report-info:expanded:cls > data:Jan}{report-column}
    {report-column:title=Feb}{report-info:expanded:cls > data:Feb}{report-column}
    {report-column:title=March}{report-info:expanded:cls > data:March}{report-column}
    {report-column:title=April}{report-info:expanded:cls > data:April}{report-column}
    {report-column:title=May}{report-info:expanded:cls > data:May}{report-column}
    {report-column:title=June}{report-info:expanded:cls > data:June}{report-column}
    {report-column:title=July}{report-info:expanded:cls > data:July}{report-column}
    {report-column:title=Aug}{report-info:expanded:cls > data:Aug}{report-column}
    {report-column:title=Sept}{report-info:expanded:cls > data:Sept}{report-column}
    {report-column:title=Oct}{report-info:expanded:cls > data:Oct}{report-column}
    {report-column:title=Nov}{report-info:expanded:cls > data:Nov}{report-column}
    {report-column:title=Dec}{report-info:expanded:cls > data:Dec}{report-column}

    {report-table}

    ||Source of Return:||
    |{report-info:data:s-r||render=wiki}|
    ||Travel Costs:||
    |{report-info:data:travel_cost|render=wiki}|

    {report-body}

    {report-block}

    I get everything else correct but only table is giving problem .

    Please Help
     
    sad I’m sad
  • Inappropriate?
    Ok. I think I get it now. For performance reasons I would suggest using {local-reporter} for both the 'Student' Forms and the 'Opportunity' forms. Something like this:

    Old 'Student' reporter:

    {content-reporter:types=page|scope=2009 Strudent> children}
    {text-filter:data:FormName|include=Student}
    {content-reporter}


    New 'Student' reporter:


    {local-reporter:page:children|source=2009 Strudent}
    {text-filter:data:FormName|include=Student}
    {local-reporter}


    This is equivalent, and should be much faster, particularly as your site gets more pages.

    Old 'Opportunity' form:


    {expanding-reporter:data:cls|as=cls}
    {local-reporter:page:2009 Charters> page:children}
    {text-sort:page:title}
    {text-filter:data:FormName|include=Opportunity}

    {local-reporter}
    {expanding-reporter}


    New 'Opportunity' form:

    {expanding-reporter:data:cls|as=cls}
    {local-reporter:page:children|source=2009 Charters}
    {text-sort:page:title}
    {text-filter:data:FormName|include=Opportunity}
    {local-reporter}
    {expanding-reporter}


    This should work as you expect (hopefully).

    Good luck!
  • shweta
    Inappropriate?
    Thanks David.
    But I suppose I m doing some mistake.

    The above code gives me output but it just fetch all the data in all charters and post it in single table multiple times.

    I wish to print data differently for every charter.
    I suppose I will have to search for another way to display this .
    May be I will chang the view level

    Thanks David
    :)
     
    indifferent I’m undecided
User_default_medium