public System.string SortParamName {get; set;}
The Programmable Object Settings enable you to specify names for special parameters that will be passed from Exago to identically named parameters in stored procedures or .NET Assemblies. Using these parameters will allow filtering to be done before the data is sent to Exago. This can increase performance and reduce server resources when using Programmable Objects. For more information on these types of Data Objects see Web Services & .NET Assemblies.
WebReportsAsmi.dll
. Provide a parameter name in the programmable object that will hold the sort string for the report.
If using call type 2, it can indicate which direction the user is scrolling a filter dropdown. ASC indicates scrolling down or DESC indicates scrolling up.
public System.string SortParamName {get; set;}
CREATE PROCEDURE [dbo].[sp_webrpt_person] @callType INT, @columnStr varchar(1000), @filterStr varchar(1000), @fullFilterStr varchar(1000), @sortStr varchar(1000) AS SET NOCOUNT ON /*for performance reasons */ SET FMTONLY OFF /*force procedure to return data and process IF conditions */ declare @sql varchar(2000) declare @columnInfo varchar(1000) declare @orderbyClause varchar(1000) declare @operator varchar(max) if @callType = 0 /*return schema; no need to return any rows */ begin set @sql = 'select * from vw_webrpt_person where 0 = 1' end else if @callType = 1 /*return all data for execution */ begin set @orderbyClause = '' if @sortStr is not NULL AND @sortStr <> 'null' set @orderbyClause = ' ORDER BY ' + @sortStr set @sql = 'select ' + @columnStr + ' from vw_webrpt_person where ' + @filterStr + @orderbyClause end else if @callType = 2 /*return filter dropdown values; limit # rows to some value; sortStr will indicate which direction user is scrolling the dropdown*/ begin set @orderByClause = '' set @operator = ' >= ' if @sortStr is not NULL AND @sortStr <> 'null' AND @sortStr <> '' Begin SET @orderByClause = ' ORDER BY ' + @sortStr END if (RIGHT(@sortStr, 4) = 'DESC')Begin SET @operator = ' <= 'END set @columnInfo = '[' + @columnStr + ']' SET @sql = 'select top 100 ' + @columnInfo + ' from Northwind.dbo.OrderDetails where ' + @columnInfo + @operator + @filterStr + ' AND ' + @fullFilterStr + @orderByClause end exec(@sql)
api.General.CallTypeParamName = "callType"; api.General.ColumnParamName = "columnStr"; api.General.FilterParamName = "filterStr"; api.General.FullFilterParamName = "fullFilterStr"; api.General.SortParamName = "sortStr";