dbr.template and template variables

(2 posts) (2 voices)
  1. ajdjackson, Member

    Hi

    I've an issue with a template that I can't figure out.

    The report code is as follows:

    select 'dbr.record', 'begin', 'ticker'; select concat(ticker, " Sales: " , ifnull(sales,"None"), " Bookings: ", ifnull(books,"None"), " Fall-Throughs: ", ifnull(fallthrough,"None")); select 'dbr.record', 'end';

    select 'dbr.template','#Dashboard_V5'; select 'dbr.record', 'begin', 'bankall'; select (concat("£",(select format(sum(a.Tran_CB)/1000000,3) from hilmark.tblbank_trans a join (select Acc_ID, max(Tran_Date) as maxdate from hilmark.tblbank_trans group by Acc_ID) dp on a.Acc_ID = dp.Acc_ID where a.Tran_Date = dp.maxdate)," M")) as balbank; select 'dbr.record', 'end';

    The template looks like this:

    <header id="header"> <hgroup> <h1 class="site_title">Hilmark MIS System</h1> <h2 class="section_title">Dashboard</h2> </hgroup> </header>

    <section id="main" >

    <h4 class="alert_info">{#ticker}</h4>

    <article class="module width_full"> <header><h3>Finance</h3></header> <div class="module_content">

    <article class="module width_quarter column">

    <header> <h3 class="tabs_involved">Bank</h3> <ul class="tabs">

    < li>< a href="#tab1">Summary< /li> < li>< a href="#tab2">Detail< /li> </header>

    <div class="tab_container"> <div id="tab1" class="tab_content"> <div class="bank_overview_today"> <p class="overview_day">Last Night's Closing Balance</p> <p class="overview_count">{#bankall}</p> </div> </div><!-- end of #tab1 -->

    <div id="tab2" class="tab_content"> Details Tab

    </div><!-- end of #tab2 -->

    </div><!-- end of .tab_container -->

    </article><!-- end of bank article --> </section>

    When I run this I get no output.

    If I change the report as follows I get an output:

    select 'dbr.hideheader'; select 'dbr.record', 'begin', 'ticker'; select concat(ticker, " Sales: " , ifnull(sales,"None"), " Bookings: ", ifnull(books,"None"), " Fall-Throughs: ", ifnull(fallthrough,"None")); select 'dbr.record', 'end';

    select 'dbr.hideheader'; select 'dbr.record', 'begin', 'bankall'; select (concat("£",(select format(sum(a.Tran_CB)/1000000,3) from hilmark.tblbank_trans a join (select Acc_ID, max(Tran_Date) as maxdate from hilmark.tblbank_trans group by Acc_ID) dp on a.Acc_ID = dp.Acc_ID where a.Tran_Date = dp.maxdate)," M")) as balbank; select 'dbr.record', 'end';

    select 'dbr.template','#Dashboard_V5'; select '';

    However the template variables appear in the template wrapped in <td> tags - not want I wanted. I only need their values.

    When I change the code to the following

    select 'dbr.divify','ticker'; select 'dbr.hideheader'; select 'dbr.record', 'begin', 'ticker'; select concat(ticker, " Sales: " , ifnull(sales,"None"), " Bookings: ", ifnull(books,"None"), " Fall-Throughs: ", ifnull(fallthrough,"None")); select 'dbr.record', 'end';

    select 'dbr.divify','bankall'; select 'dbr.hideheader'; select 'dbr.record', 'begin', 'bankall'; select (concat("£",(select format(sum(a.Tran_CB)/1000000,3) from hilmark.tblbank_trans a join (select Acc_ID, max(Tran_Date) as maxdate from hilmark.tblbank_trans group by Acc_ID) dp on a.Acc_ID = dp.Acc_ID where a.Tran_Date = dp.maxdate)," M")) as balbank; select 'dbr.record', 'end';

    select 'dbr.template','#Dashboard_V5'; select '';

    I get the variables in the correct format in the html but the first variable ticker is displayed as {ticker}. If I comment out the second dbr.record block {#ticker} is displayed ok.

    I'm not sure what I'm doing wrong here.

    Also I had to call the template after recording the 2 variables by using a select '';. It didn't work when I called it just before the second record block as per your docs.

    Thanks

    Jake

  2. myDBR Team, Key Master

    Jake,
    the forum sw is not best suited for complex HTML content so it is bit hard to see if your template HTML is correct. Use support email for larger questions.

    The template variable is wrapped in a table element as you are using dbr.record which records whole elements. If you just want data content, use the normal template queries.

    --
    myDBR Team


Reply

You must log in to post.