Reporting Dashboard - Adding Hyperlinks

The example below described how to display a list of current Calls via a report for a given queue and enable a unique item hypelink to display the Printer Friendly view of a Call from the report output.

Step 1. Add a new UDF to the versaSRS database. The syntax for the UDF is shown below:


Sample Code

CREATE FUNCTION udf_PrintCallURL( @CallID int ) RETURNS nvarchar(300) AS BEGIN DECLARE @RetVal nvarchar(300) Set @RetVal = '<a href="printcall.aspx?callid=' + CONVERT(varchar, @CallID) + '" target="_blank">' + CONVERT(varchar, @CallID) + '</a>' RETURN @RetVal END

Step 2: Grant Execute permission to the versaSRS database user (e.g. versaSRS)

Step 3: Construct The Report

Sample Code

<Reporting> <ReportTitle>Current Calls For Help Desk Queue</ReportTitle> <ReportHeader></ReportHeader> <ReportFooter></ReportFooter> <Parameters> <Queue>true</Queue> <SkillGroup></SkillGroup> <User></User> <CallType></CallType> <ReceivedBy></ReceivedBy> <Status></Status> <Priority></Priority> <Key1></Key1> <Key2></Key2> <Key3></Key3> </Parameters> <Report> <Title>Current Calls</Title> <Totals></Totals> <Query>SELECT dbo.udf_PrintCallURL(CallID), Subject FROM tbl_Calls WHERE QueueID = [PARAM1] AND CallStatusID IN (1, 2, 4, 7)</Query> <Columns> <column id="1" visible="true">Case Number (click to view details)</column> <column id="2" visible="true">Problem</column> </Columns> </Report> </Reporting>

Step 4. Run the report and click on a Case Number to display the versaSRS - Call Printer Friendly view.

See Also

Overview
Writing a Report
Passing Parameters
Specifying a Date Range
Customizing Columns
Displaying Multiple Reports