Wednesday, July 31, 2013

Displaying multiple parameter values in a Crystal Report

When a Crystal report user chooses multiple values for a parameter, sometime it's nice to display all those parameter values in the report header. The following code can be added to a function for displaying in the header.

WhilePrintingRecords;
StringVar Array term := {?Term};
StringVar terms := term[1];
Local NumberVar i;
For i := 2 To count(term) Do
(
   terms := terms + ", " + term[i];
);
terms

Tuesday, July 2, 2013

Including a link to a javascript file in XSLT

In SharePoint 2010, I was updating a custom version of the ContentQueryMain.xsl file, needing to include javascript for the page. When I added the following code, the layout of the page changed, the ribbon stopped responding and the page would not respond when in edit mode.

<script type="text/javascript" src="/Script%20Files/myjavascript.js"></script> 

Turns out, the XSLT processor didn't care for the empty script tag. Adding the space entity &#160; fixed the problem.

<script type="text/javascript" src="/Script%20Files/myjavascript.js">&#160;</script>