Passing HTML into the page

Commands

dbr.html - Pass HTML directly into the report
dbr.purehtml - Same as dbr.html, kept for compatibility
dbr.html: - Include HTML into a string
dbr.purehtml: - Same as dbr.html:, kept for compatibility
dbr.javascript - Include Javascript code in the report
dbr.css - Include CSS definitions in the report
dbr.head - Include tags into HTML head part
dbr.file - Include a HTML file into the report

Syntax

select 'dbr.html', 'HTML statement'
select 'dbr.purehtml', 'HTML statement'
select 'dbr.html:HTML statement'
select 'dbr.purehtml:HTML statement'
select 'dbr.javascript', 'javascript code' [, 'onload']
select 'dbr.css', 'css'
select 'dbr.head', html_tags
select 'dbr.file', path_to_file

Explanation

By default, a myDBR report will show any HTML-commands that may be selected within the data as a raw code without letting the browser to render it. With these commands, myDBR allows the browser to render the selected HTML-code.

With the dbr.html-command you can allow client browser to render the HTML. The dbr.html-command makes the whole result set to be passed directly to the browser, as with the dbr.html:-syntax this allows mixing HTML within the query. The dbr.html: allows HTML formatting inside the result table's cell.

You can also pass Javascript code with 'dbr.javascript'. The command is a short version of 'dbr.html' and adds script tags around the parameter. The optional 'onload'-parameter makes the script to run after the DOM-tree has been loaded Adding your own CSS can be done with 'dbr.css' which works similarly.

This allows the report author to include any content in the report and also to affect the layout of the report.

Example - dbr.html

Putting a logo in the left top corner of the report. Embed Google Maps map and YouTube video side by side in a report.

select 'dbr.title', ''; /* We do not need the title */

/* Putting up the logo. We'll use a predefined left div */
select 'dbr.html', '<div class="left"><img src="http://mydbr.nocsos.com/images/nocsos-logo.png"></div>'; 

/* Use this as title */
select 'dbr.hideheader';
select 'BMW F1 vs, BMW M5';

/* Put map and video side by side. 1st column */
select 'dbr.html', '<table align="center"><tr><td>'; 

select 'dbr.hideheader';
select 'Google map: Rockingham Race Track';

/* We have the Google Map URL here */
select 'dbr.html', RockinghamURL
from mydb.Racetracks;

/* 2nd column */
select 'dbr.html', '</td><td>'; 

select 'dbr.hideheader';
select 'Video: Fifth Gear';

/* We have the YouTube video URL here */
select 'dbr.html', F1vsM5URL
from mydb.Videos;

/* Close the table */
select 'dbr.html', '</td></tr></table>';

Report will position the logo on top left. Map and video will appear side-by-side:

Example - 'dbr.html:'

The report will output a list of parts and their picture.

select 'Part 1' as 'Part name', 
       'WDC-2345-1' as 'Code', 
       'dbr.html:<img src="http://www.mysite.com/parts/WDC-2345-1.jpg">' as 'Preview'
union
select 'Part 2', 
       'WDC-2345-2', 
       'dbr.html:<img src="http://www.mysite.com/parts/WDC-2345-2.jpg">'
union
select 'Part 3', 
       'WDC-2345-3', 
       'dbr.html:<img src="http://www.mysite.com/parts/WDC-2345-3.jpg">';

The report will output a normal myDBR report list. myDBR will just put the indicated picture in the third column's cell.

Example - 'dbr.head'

You can include your own tags into HTML HEAD section with dbr.head

select 'dbr.head', '<meta property="og:url" content="http://mydomain.com/index.htm">';
select 'dbr.head', '<meta name="twitter:card" content="summary_large_image">';
select 'dbr.head', '<meta name="twitter:card" content="summary_small_image">';

The report will output a normal myDBR report list. myDBR will just put the indicated picture in the third column's cell.