Linked reports

Commands

dbr.report - Create a link to another report
dbr.url - Create a link to an external URL
dbr.button - Create a button containing a link
dbr.list - Create a list containing a link to a report
dbr.embed_object - Create a placeholder or a popup window for the linked report's content
dbr.selectlist - Create a select list for linked reports
dbr.searchable - Create a search field to get dynamic content

Syntax

select 'dbr.report', procedure_name, [ColumnReference, ] [embed_target, ] [parameter_name=ColumnReference/ParameterReference, ...] [parameter_name*=ColumnReference/ParameterReference, ...] [parameter_name<=ColumnReference/ParameterReference, ...] [parameter_name="constant", ...] [,event=click|dblclick] [,callbefore=callbefore_function] [,append=url_parameter] [,'"menu title"'] [,show_link=expression] [html5-data-attribute] [,http_method=post], [callpopupclose=popupclose_function], [callpopupsubmit=popupsubmit_function] [plain_URL=1]
select 'dbr.url', external_url_base, 'URL name', [ColumnReference, ] [embed_target, ] [<=ColumnReference/ParameterReference to be added to base URL] [parameter_name=ColumnReference/ParameterReference, ...]
select 'dbr.button', [button text / ColumnReference ], [button class], [button wrapper class]
select 'dbr.list', [list_class], [menutitle]
select 'dbr.embed_object', embed_target [, embed_class]
select 'dbr.selectlist', default_selection, title[, 'find' [, select_class]]
select 'dbr.searchable', procedure_name[, 'placeholder text' [parameter_name=ColumnReference/ParameterReference, ...]]

Where:

ColumnReference
The optional parameter to which the linked report is attached. If no column is specified, the linked report is shown in the link menu, which will be automatically attached to the object. Note that the ColumnReference must be enclosed in brackets "[ColumnReference]".

A ColumnReference can also be the magic word row. In that case, the report is attached to the whole row. Any cell, except those containing other linked reports, will act as the starting point for the report.

When a ColumnReference refers to a crosstable's data column, the link is generated for each repeated data column in a row.

If you want to set a linked report to a crosstable's horizontal summary column, you can use the format "[ColumnReference.h]".
embed_target
This parameter defines where the output of the linked report is placed. You can choose to have it follow to a new report, open in a popup, open in a defined DIV within a report, or open in a new window, among other options. The 'embed_target' specifies the target embed element for the linked report content. 'embed_target' can be a DIV created with the 'dbr.embed_object' command or one of the predefined names (please only use lowercase letters without any special characters).

When the output is a DIV inside the current report and the DIV is not visible (scrolled outside the viewport), by default, the report automatically scrolls to the object to display the new data. However, if the object contains a CSS class "no_scroll_to," no scrolling will occur. If you add '[]' to the end of 'embed_target,' the 'embed_target' is created automatically, eliminating the need to use the 'dbr.embed_object' command. This is particularly useful in cases where 'embed_target' contains non-visible values. For example, a report might return JavaScript to remove the selected line.

If the target is a popup, you can add a Cancel button to a parameter popup by appending &cancel_button=1 to the link. There are also special targets available, such as popup_parameter (which opens the linked report's parameter in a popup before changing the page) and popup_parameter_new_window (which opens the linked report's parameter in a popup before opening the linked report in a new window). For more information, please refer to the Output destination of the linked report.
procedure_name
Refers to another myDBR report's stored procedure
parameter_name
Refers to linked stored procedure's / URL's parameter name to which we want to pass the value to
ColumnReference/ParameterReference
Value to be passed to the parameter. Different options include:
  • parameter_name=ColumnReference/ParameterReference The user is not allowed to change the parameter (p-parameter), nor is it shown in the parameter query form
  • parameter_name<=ColumnReference/ParameterReference The parameter becomes editable (e-parameter) to the user in the parameter query form
  • parameter_name+=ColumnReference/ParameterReference The parameter becomes editable (u-parameter) in the URL. The parameter is also editable in parameter form if there are parameters that trigger the parameter form (e-parameters or missing parameters)
  • parameter_name*=ColumnReference/ParameterReference The parameter is visible in the parameter query form (s-parameter), but the user is now allowed to change the parameter value
  • parameter_name="Constant" Pass a constant value to the parameter (p-parameter)
See more info on ColumnReference/ParameterReference at Referencing columns and parameters.
event=click|dblclick
The linked report can be attached directly to a table cell, allowing for report execution by clicking or double-clicking the cell. This option requires attaching the report to a column and using the cell's onclick/ondblclick event instead of an href link.
callbefore
This JavaScript function runs before launching the linked report. If the function returns true, the linked report is executed; if it returns false, it won't be executed. The function receives the clicked table cell as a parameter. The callbefore parameter is used when user confirmation is required before executing the linked report. For instance, if the linked report deletes the row where the user clicked, the function can prompt a delete confirmation.
callpopupclose
When a linked report's target is a popup, a JavaScript function can be attached to the closing of the popup. The parameter can be a function name (either a function created with dbr.javascript or a function included in a file) or an anonymous function definition.
callpopupsubmit
When a linked report's target is a popup, a JavaScript function can be executed before the parameter form in the popup is submitted. The parameter can be a function name (either a function created with dbr.javascript or a function included in a file) or an anonymous function definition.
append=url_parameter
If you want to add additional parameters to the generated URL, use the 'append'-parameter. For example, if you want to make a PDF document instead of an HTML report, add 'append=&export=pdf' as a parameter.
plain_URL=1
Instead of creating an HTTP hyperlink, only the URL is returned. This can be useful, for example, when generating form action attributes.
list_class
This CSS class is defined in the user/userstyle.css file and specifies the style for HTML UL/LI lists. There are predefined classes like 'htlist' for horizontal lists and 'vlist' for vertical lists, which serve as the foundation for user customization.
embed_class
This CSS class is defined either in the user/userstyle.css file or in the report using dbr.html. When the special value 'popup' is used, the placeholder becomes a popup window, enabling the use of multiple separate popups within a report.
default_selection
A default selection in the select list
'find'
The selectlist will be searchable if this constant is set.
"menu title"
The menu item can be defined here if the linked report is shown in a menu.
show_link=expression
If a PHP expression evaluates to true, the linked report is placed on the object. The expression is any valid PHP expression that can contain ColumnReferences. Determines if the link is created based on the data.
http_method=post
Uses HTTP POST when running the linked report. It can be used to handle texts that exceed HTTP GET URL maximum length
html5-data-attribute
A link to a report can be put in a html5 data-attribute with this. By setting the string "html5-data-callback", the link to the report will be placed to a "data-callback" attribute. This allows scripts to access the link (for example, editing callback).

Description

One of the powerful features of myDBR is the ability to link reports, enabling drill-down functionality. Linked reports can be attached to any object in a report, such as a column, table, chart, or graph, and can point to another report or an external web page.

Linked reports can also be embedded in an existing report using an embedded element or a popup window. This allows for quick drill-down content without the need for users to switch between reports, and the linked report's content is fetched dynamically. To embed a linked report, you need to set the embed_target parameter.

The linking process begins with the dbr.report command (or dbr.url for external sources), followed by a standard result set. When the dbr.report command is used, the linked report is attached to the next result set. The parameters of the dbr.report command define the linked report, including where it's attached, where the content is displayed, and any required parameters.

Linking to an external URL using dbr.url follows a similar process to dbr.report with the distinction that it requires defining the visible name of the URL.

Basic use of linking:

select 'dbr.report', 'sp_DBR_film';

select Title, fid
from mydb.film_list

Linked Report Parameters

The linked report is a stored procedure that may have parameters. These parameters can be derived from the incoming parameters of the original report and/or the data displayed in the report. If the linked report has parameters that are not populated during the linking process, they will be prompted from the user.

Adding a parameter to a linked report: In this case, 'inFilmID' is a parameter for the 'sp_DBR_film' stored procedure.

select 'dbr.report', 'sp_DBR_film','inFilmID=fid';

select Title, fid
from mydb.film_list

Linked Report Placement

By default, a linked report will be attached to the object via a link-menu (the user sees an icon). For tabular reports, you can also attach the link directly to a column by specifying the ColumnReference as a parameter."

A linked report is attached to the first column

select 'dbr.report', 'sp_DBR_film', '[Title]', 'inFilmID=fid';

select Title, fid
from mydb.film_list

Output Destination of the Linked Report

By default, a linked report will execute and display in the user's browser. Users can navigate between reports using the browser's back and forward buttons.

The content of the linked report can also be embedded in the current report using either a fixed embed element or a movable popup window. This approach streamlines navigation for users who need additional information without switching between separate reports.

Alternatively, the output destination can be set to open in a new browser window using the predefined value 'new_window', or as a dynamic popup with 'new_popup'.

The embed_target parameter can also include column references using [ColumnReference] notation, enabling multiple dynamic embeds simultaneously.

The embed_target parameter supports the following formats:

mytarget
Will use the 'mytarget' (or whatever name you choose to use) DIV defined by dbr.embed_object command. When the user clicks the link, the content of 'mytarget' is replaced with the new content.
mytarget[]
myDBR will automatically create a DIV with id mytarget (or whatever name you choose to use) if one is not defined. No need to create one dbr.embed_object command. Most suitable in cases where a linked report returns nothing or returns JavaScript not visible to the user.
popup
A predefined name popup will open a popup dialog for content
new_popup
A predefined name new_popup will open a new popup dialog for each individual linked window
popup[_whatever][ColumnReference]
Will dynamically create a new popup window for each ID (you can specify multiple columns). This allows each popup to open separately when a user clicks the linked report in different rows. For example, if ColumnReference points to customerID 1 and 2, and the target is popup_customer[CustID], dynamically created popups would be named popup_customer1 and popup_customer2. This feature enables users to compare different customers in separate popups.
new_window
A predefined name new_window will open a link into new browser window
parent_window
A predefined name parent_window will open a link into the parent window (can be used with iframe)
top_window
A predefined name top_window will open a link into the topmost window (can be used with multiple iframes)
mytarget[ColumnReference1][ColumnReference2]
When a user clicks a row where the column reference is '2012', it will use 'mytarget2012' as the target (you can use multiple column references if you like). If the target has not been created using dbr.embed_object, it will be dynamically created at the end of the report. Using dbr.embed_object, you can determine its placement.
inline
When using the predefined name inline, the linked report will display in a row below the linked row in a table report. A new row is added to the table where the linked report's content is shown. This link type is specifically available for table reports. Use this when you need to quickly open additional information from a row without losing the user context from the main report.
mytarget.myid[ColumnReference1]
When a user clicks a row where the column reference is '2012', it will create a target myid2012 inside mytarget. The myid element ensures the ID is unique. If myid2012 has not been created using dbr.embed_object, it will be dynamically created.
mytarget.myid[ColumnReference1].classname
This is similar to the previous entry, but adds a class name to the myid2012 target. For example, using the 'kwn' class (keepwithnext) will make linked elements appear side by side inside the mytarget element.
popup_parameter
A predefined name popup_parameter. If a linked report has user-enterable parameters, they will be requested using a popup window. The linked result will be shown in a new page. This should only be used with a report that has parameters. If used with a linked report that has no parameters, the result will be shown in a popup.
popup_parameter_new_window
A predefined name popup_parameter_new_window prefix. If the linked report contains parameters that need to be entered by the user, these parameters are requested in a popup window, and the linked report opens in a new window. Use this when you anticipate that the user might cancel the report after viewing the parameter dialog, ensuring they remain within the main report context.
embedded_report_[_whatever][ColumnReference]
A predefined embedded_report_ prefix. The linked report is embedded within the current report. If the linked report has parameters that need to be entered by the user, the parameter form is displayed within the report. Use this when you want to include another report into an existing report, allowing users to rerun the embedded report with different parameters.

Optional Links Based on Data

Links can be made optional by adding a 'show_link' parameter to the command. This parameter can be any valid PHP expression, including ColumnReferences. If the expression evaluates to true, the link is shown; otherwise, it is not displayed.

Examples of show_link include: 'show_link=[myColumn]=="disable"', 'show_link=[myColumn]' or 'show_link=[myColumn]>10'.

Links can also be made optional by adding the no_link option to the 'rowclass' or 'cellclass'. Rows or cells with this class will not have links attached. Using 'no_link' will disable all links to the defined row.

Examples

Basics of Linking

We have a film list from which we want to pick one film and obtain more details from it.

The film list is shown with a simple query:

select Title, fid
from mydb.film_list

The report (sp_DBR_film) showing the details and to which we wish to link an existing report, has one parameter inFilmID, which represents the film's ID.

create procedure sp_DBR_film ( inFilmID int )
begin

select description, release_year
from mydb.film
where film_id = inFilmID;

end

Then, we can link the sp_DBR_film report to the existing report using the dbr.report command and provide the parameter inFilmID with a value taken from the user's selected row's second column.

select 'dbr.report', 'sp_DBR_film','inFilmID=fid';

select Title, film_id
from mydb.film;

When the original report is executed, the user will see a mark indicating a linked report: When clicked, this mark presents a list of linked reports. The name shown in the list is the name given to the report when it was added to myDBR. Therefore, the linked report must be added to myDBR for it to appear in the linked report list.

The list of linked reports shown in the pull-down menu depends on the user's permissions, displaying only those reports the user has access to.

Passing Multiple Parameters

Linked reports can have multiple parameters, including values from the original report's parameters. In many drill-down report scenarios, certain parameters need to be carried over to the next report. The following example illustrates this:

The original report has a couple of parameters:

create procedure sp_DBR_rentals ( inStartDate date, inEndDate date)
begin

select s.first_name, s.last_name, count(*), s.staff_id
from mydb.rental r
  join mydb.staff s on s.staff_id=r.staff_id
where r.rental_date between inStartDate and inEndDate
group by s.first_name, s.last_name, s.staff_id;

end

The linked report has also parameters:

create procedure sp_DBR_rentaldetail ( 
inStaff_id int, 
inStartDate date, 
inEndDate date
)
begin

select r.customer_id, r.inventory_id, r.rental_date
from mydb.rental r
where r.rental_date between inStartDate and inEndDate and r.staff_id = inStaff_id;

end;

To link the report sp_DBR_rentaldetail to be called from sp_DBR_rentals, we need to add that link and define the parameters:

create procedure sp_DBR_rentals ( inStartDate date, inEndDate date)
begin
select 'dbr.report', 'sp_DBR_rentaldetail','inStaff_id=staff_id', 'inStartDate=(inStartDate)', 'inEndDate=(inEndDate)';
	
select s.first_name,
       s.last_name,
       count(*), 
       s.staff_id
from mydb.rental r
  join mydb.staff s on s.staff_id=r.staff_id
where r.rental_date between inStartDate and inEndDate
group by s.first_name, s.last_name, s.staff_id;

end

The inStaff_id parameter will get its value from the staff_id column in the result set, while the dates are carried over from the original parameters (parameter names in parentheses).

Output Destination of the Linked Report Example

When using an embedded element, a dbr.embed_object command needs to be used to create the placeholder for the linked report's content. If the embed object contains a CSS class no_highlite, the default yellow flashing highlight effect is not applied.

The content of the linked report will be displayed within an embedded element positioned after the original data.

-- Will not use yellow highlite
select 'dbr.embed_object','shared_embed', 'no_highlite';
select 'dbr.embed_object','embed_with_id';

-- Will open the link to predefined 'popup'
select 'dbr.report', 'sp_DBR_link_location_drill', 'popup', '[shared_popup]', 'inID=ID';

-- Will open the link always to new popup. No need to declare the new_popup
select 'dbr.report', 'sp_DBR_link_location_drill', 'new_popup', '[new_popup]', 'inID=ID';

-- Will open the link to popup with ID. No need to declare the popup
select 'dbr.report', 'sp_DBR_link_location_drill', 'popup[ID]', '[popup_id]', 'inID=ID';

-- Will open the link always to same embedded object. We declared shared_embed
select 'dbr.report', 'sp_DBR_link_location_drill', 'shared_embed', '[shared_embedded]', 'inID=ID';

-- Will open the link inside an embedded object (ID). We declared the placeholder embed_id
select 'dbr.report', 'sp_DBR_link_location_drill', 'embed_id.target[ID].kwn', '[embedded_id]', 'inID=ID';

-- Will open the link always to new window
select 'dbr.report', 'sp_DBR_link_location_drill', 'new_window', '[new_window]', 'inID=ID';

-- Will open the parameter form in a popup and open redirect the user to the linked report
select 'dbr.report', 'sp_DBR_film_detail', 'popup_parameter', '[popup_redirect]', 'inID=ID';

-- Will open the parameter form in a popup and open the linked report in a new window
select 'dbr.report', 'sp_DBR_film_detail', 'popup_new', '[popup_new]', 'inID=ID';

-- Will embed the report (including parameter form into the current report)
select 'dbr.report', 'sp_DBR_film_detail', 'embedded_report_film_detail', '[embed_report]', 'inID=ID';

select  film_id as 'ID', 
	'Shared popup' as 'Shared popup[shared_popup]', 
	'Always new popup' as 'New popup[new_popup]', 
	'Popup by ID' as 'Popup by ID[popup_id]', 
	'Shared embedded' as 'Shared embedded[shared_embedded]', 
	'Embedded by ID' as 'Embedded by ID[embedded_id]',
	'New window' as 'New window[new_window]',
	'Ask parameters in this report - redirect to new' as 'Popup - Redirect[popup_redirect]',
	'Ask parameters in this report - open in new window' as 'Popup - New[popup_new]',
	'Embedded report' as 'Embedded report[embed_report]'
from film
limit 10;

select 'dbr.embed_object','embedded_report_film_detail';


Linking to External Webpages with dbr.url

The syntax of dbr.url is similar to dbr.report. The difference in usage is that external URLs do not have permissions, so all external links are available to all users.

We'll assign a URL to the email column (third parameter for dbr.url) of the query. The second parameter (URL name) is used when the URL is displayed in a menu (multiple linked reports attached to a column or no link position column is specified). Data from rows can be embedded into the URL by adding ColumnReference inside brackets in the external_url_base.

select 'dbr.url', 'https://www.mydbr/forums/topic.php?id=[topic_id]#post[topic_last_post_id]', 'Show topic', '[email]';

select u.topic_title as 'Title',
       u.user_email as 'email,
       t.topic_id,
       t.topic_last_post_id
from forums.bb_topics t
  join forums.bb_users u on u.ID = t.topic_last_poster
order by topic_time desc

Will produce URL: https://mydbr.com/forums/topic.php?id=158#post-686 when user clicks a email-column in a row where topic_id=158 and topic_last_post_id=686.

Linked Reports and Charts

You can also assign linked reports to charts by connecting the report to a chart element (bar/line/node).

The Premium/OEM version's charts support an unlimited number of linked reports per chart.

The following table represents the supported linking in charts:

Chart type Chart command ChartDirector ChartJS Graphviz
Column column C L C L  
3D Column column3d C L    
Multi-Series column mscolumn C L C L  
3D Multi-Series column mscolumn3d C L    
Stacked Column stackedcolumn C L C L  
3D Stacked Column stackedcolumn3d C L    
Stacked Bar stackedbar C L C L  
3D Stacked Bar stackedbar3d C L    
Stacked Area stackedarea C L    
3D Stacked Area stackedarea3D C L    
Line line C L C L  
3D line line3d C L    
Multi-Series Line msline C L C L  
Spline spline C L C L  
Pie pie C L C L  
3D Pie pie3d C L    
Bar bar C L C L  
3D Bar bar3d C L    
Multi-Series Bar msbar C L C L  
Area area C L C L  
3D Area area3d C L    
Multi-Series Area msarea C L    
Donut donut C L C L  
3D donut donut3d C L    
Multi-Series Column Line Double Y mscolumnlinedy C L    
3D Multi-Series Column Line Double Y mscolumnlinedy3d C L    
Meter meter C    
Hierarchy hierarchy     C L
Diagram diagram     C L
C ... Chart supported, L ... Linking supported

Simple Chart Linking

Charts are always based on a single selection set. Linked reports are associated with specific rows from this result set.

Let's consider a simple scenario where a report is linked to a pie chart. The report itself is straightforward:

select 'dbr.report', 'sp_DBR_LinkedReport', 'vCode=code';
select 'dbr.hidecolumns', 'code';
select 'dbr.chart', 'pie';

select "First", 10, 1 as '[code]'
union 
select "Second", 21, 2
union 
select "Third", 35, 3
union 
select "Fourth", 44, 4;

The report has a result set with three columns: text expression, value, and a key ID. The linked report is called with the invisible key ID (column 'code').

The report will produce a pie chart with a linked chart attached to the slices. Column references (like vCode=code), refer to the particular row the user clicks ("Second" -> vCode's value becomes 2)

Buttons as Links

Sometimes, when designing a report network and needing to link to a single report, using a button link is the most straightforward approach. A button link functions like a standard HTML button and provides a direct link to the desired report with predefined parameters. The syntax of a button link is similar to a normal linked report, with the addition of the dbr.button command. The button text can include the linked report's name, custom text defined in the dbr.button command, or a column reference when generating multiple buttons. By default, the CSS class for the button is 'button'. You can add or replace this with your own class definition using a second parameter for the dbr.button command. The button element is wrapped in a wrapper DIV, which can be styled using the third wrapper class parameter.

Here's an example of making a button link to a customer given as a parameter:

select 'dbr.report', 'sp_DBR_Customer', 'inCustomerID=1';
select 'dbr.button', 'Show customer info';

select vCustomerID;

This will create a button-link to the sp_DBR_Customer report, passing the 'vCustomerID' as input (mapped to the inCustomerID parameter in the sp_DBR_Customer report). An example of this can be seen in the demo database.

Select Lists as Links

A linked report can also be associated with a select list. In this example, a linked report is triggered when the user selects an item from the list.

select 'dbr.report', 'sp_DBR_show_continent', 'inContinent=Continent';
select 'dbr.selectlist', 'Europe', 'Select title', 'find';


select distinct Continent
from demo_country;

This will create a select list with an attached linked report. The sp_DBR_show_continent report will be executed when the user selects an item from the list.

Lists as Links

A list link is primarily used with embedded reports, where the visible text of each list item corresponds to the first column of the result set.

List links can be styled using user-defined CSS classes in user/userstyle.css. myDBR includes two example styles: 'hlist' for horizontal lists and 'vlist' for vertical lists. These styles can serve as a basis for users to create their own custom definitions.

Here's an example of creating a list-link to display the list of continents. In this example, the second column (sum(Population)) determines the sorting order of the list items.

select 'dbr.report', 'sp_DBR_list_example', 'continent', 'inContinent=Continent';
select 'dbr.list', 'hlist';

select Continent, sum(Population)
from demo_country
group by Continent
order by 2 desc;

select 'dbr.embed_object', 'continent';

This will generate a list of horizontal links and the content of the linked report will be shown in the 'continent' object.

Here's an example where the list is displayed as a menu. By providing the menu title as a second parameter, the list is formatted as a menu.

select 'dbr.report', 'sp_DBR_list_example', 'continent', 'inContinent=Continent';
select 'dbr.list', 'hlist', 'Select continent';

select Continent, sum(Population)
from demo_country
group by Continent
order by 2 desc;

select 'dbr.embed_object', 'continent';

This will generate a list of horizontal links and the content of the linked report will be shown in the 'continent' object.

Clicking the menu expands it for selection:

Searchable Fields with dbr.searchable

The dbr.searchable command creates a searchable field, allowing users to dynamically fetch report output by typing search terms.

Here's an example demonstrating the use of dbr.searchable to fetch dynamic content. The user's search term automatically populates the first parameter. Additionally, dbr.searchable can be used to find items to add to the current selection.

select 'dbr.searchable', 'sp_DBR_search_data', 'Filter text', 'in_id=id';

select 2 as 'id';

The search report can be a full myDBR report. In the example we just search for single sample data.

create procedure sp_DBR_search_data(
in_search varchar(30),
in_id int
)
begin

select 'dbr.title', '';
select 'dbr.search', 0;

select 
  title as 'Title', 
  description as 'Description' 
from film
where title like concat('%', ifnull(in_search,""), '%') or description like concat('%', ifnull(in_search,""), '%')
limit 10;

end

Optional Links

You can make a link optional by adding a show_link parameter. This parameter accepts any PHP expression with column references. If the expression evaluates to true, the link is displayed; otherwise, it is hidden.

select 'dbr.report', 'sp_DBR_show_data', 'inID=ID', 'show_link=[Value]>0';

select ID, Name, Value
from mydata;

The [Value] for the first row evaluates to 0 resulting in a false expression "0>0". The link is not shown for the first row.

Download Links with 'append' Parameter

You can create a download link that allows users to download the linked report in a supported export format by using the 'append' parameter.

Here's an example of downloading an Excel report without any additional parameters:

select 'dbr.report', 'sp_DBR_data', 'append=&export=xlsx';

select 'placeholder;

Create a download link for an Excel report that prompts for parameters in a popup window before initiating the download. Use a dynamic div[] to indicate myDBR to utilize Ajax for fetching the file.

SELECT 'dbr.report', 'sp_DBR_single', 'div[]', 'append=&export=xlsx';

select 'placeholder;