Interject Documentation > jDataPortal()
Estimated reading time:
2 minutes
Function Summary
jDataPortal() function is a helpful function for developers to further leverage DataPortals. It can reduce the number of data connections used by INTERJECT in a report, speeding the report process and conserving server resources. It allows DataPortals to be re-used in the same report pull event, so multiple report functions can access the data in memory and place specific data in the tab using different methods. jDataPortal() can also be used to adjust the sort order and filter the data in memory before the it is presented. jDataportal can only be used inside of a report formula as a helper function. It can only be used in a ReportRange() , ReportVariable() , or a ReportFixed() .
For users with the ClientAdmin user role, jDataPortal() can also be used to redirect the connection, stored procedure, or API during testing.
Function Arguments
Parameter Name
|
Description
|
Default
|
Optional
|
DataPortalName
|
The name of the INTERJECT DataPortal set up to connect with data.
|
|
NO
|
DataResultNumber
|
This controls the data set from a stored procedure that is returned based on the order of the data sets in the SQL stored procedure.
|
|
YES
|
Filter
|
Filter using syntax that would normally follow a WHERE statement in SQL. For example, if only filtering accounts that start with 5, see the below example. This assumes a column named Account is present in the DataPortal. OR and AND can be used, as well as other advanced filter syntax available in SQL.
[Account] Like '5%'
|
|
YES
|
OrderBy
|
A sort can be added using syntax that would normally follow an "Order By" statement in SQL. For example:
CompanyName Desc
|
|
YES
|
CommandOverride
|
Directs the data call to a different Stored Procedure or API command. This is used only for testing and can only be done by ClientAdmin or Editor roles.
|
|
YES
|
ConnectionOverride
|
Changes the Data Connection name used for testing. Only available for ClientAdmin or [ Editor ](/wPortal/INTERJECT-Roles_324468787.html) roles.
|
|
YES
|
Function Composition
Formula
|
Example
|
Explanation
|
= ReportRange (
DataPortalName
,DataResultNumber
,Filter
, OrderBy
, MethodOverride
, ConnectionOverride
)
|
=ReportRange(
**jDataPortal** (
**"NorthwindCustomers"**
, **"1"**
, **"CompanyName like 'A%'"**
**,"ContactName"**
**,**
)
|
← A DataPortal configured to connect to a Northwind demo database.
← The name of the data portal used.
← The result set to retrieve for the report.
← A custom WHERE statement that applies a filter over the final results
← A custom Order By statement that will order the results by Contact Name Ascending.
|
Example from:
From File
|
Worksheet
|
InterjectBasic
|
jDataPortalAndMultipleData
|