dbr.html
- Pass HTML directly into the reportdbr.purehtml
- Same as dbr.html, kept for compatibilitydbr.html:
- Include HTML into a stringdbr.purehtml:
- Same as dbr.html:, kept for compatibilitydbr.javascript
- Include Javascript code in the reportdbr.css
- Include CSS definitions in the reportdbr.head
- Include tags into HTML head partdbr.file
- Include a HTML file into the reportdbr.redirect
- Do a server side 302 redirect to another page. Uses the same syntax as dbr.reportdbr.http.get
- Make a HTTP GET requests and optionally return the resultdbr.http.post
- Make a HTTP POST requests and return the result
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
select 'dbr.redirect', URL | report [, param1,[ ,param2]]]
select 'dbr.http.get', URL [, 'silent']
select 'dbr.http.post', URL [params..[, 'silent']]
By default, if you include HTML tags in the report, myDBR will escape those tags. With these commands, myDBR lets the browser render the selected HTML-code.
With the dbr.html
-command you can allow the 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 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.
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>';
The report will position the logo on the top left. Map and video will appear side-by-side:
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.
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 OEM license allows for you to use dbr.redirect to redirect page to another page with server side 302. The syntax is the same as in dbr.report. The command takes a single line as a result set. The redirect is useful when handling forms with Post/Redirect/Get pattern where the page handling the POST, redirects the page to another page after it has handled the POST.
select 'dbr.redirect', 'sp_DBR_landing_page', 'inInt=par', 'append=&hdr=0' select 12345 as 'par';
The OEM license allows for you to set dynamic title element
select 'dbr.head', concat('<title'>', thetitle, '</title'>');
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">';
Commands allow for you to make HTTP POST and HTTP GET calls and optionally return results.
A HTTP POST call. The call shows the data returning from the call.
select 'dbr.http.post', 'https://financial_system/entry.php?action=cost', 'Purchase' as 'title', 200 as 'amount';
A silent HTTP POST call. The call is made and no data is shown. After silent call one can do a redirect. Can be used for example on form handling.
select 'dbr.http.post', 'https://financial_system/entry.php?action=cost', 'Purchase' as 'title', 200 as 'amount', 'silent'; select 'dbr.redirect', 'sp_DBR_entry_finished';
A HTTP GET call with return data stored in the record variable. Can be shown/handled in the template code.
select 'dbr.title', ''; select 'dbr.record', 'begin', 'get'; select 'dbr.http.post', 'http://seppo.local/slaakso/post_get.php?a=2', 1234 as 'businessline'; select 'dbr.record', 'end'; select 'dbr.template', '#get'; select 1 as 'dummy';