Manipulate drill through definitions with JavaScript

This article is based on 10.2, and uses the 10.2 Prompt API. It can be easily adapted to earlier versions however.

When defining a drillthrough you can set various settings as report target, output format, locales and more. Unfortunately there is no easy way to change those settings on the fly. On the other hand, I just did all the work so now there is an easy way.

Drillthrough definitions come in two basic parts. The second part, which won’t be delved into in this article, has the actual values being passed. These can be seen in the links themselves.
drillthrough HTML
Looking at the code itself (modified for legibility):

<SPAN 
  dtTargets='
    <drillTarget 
      drillIdx=\"0\" 
      label=\"DrillThrough\">
      <drillParameter 
        name=\"Product Line\" 
        value=\"[sales_and_marketing].[Products].[Products].[Product line]-&amp;gt;:[PC].[@MEMBER].[991]\" 
        displayValue=\"Camping Equipment\"/>
      <drillParameter 
        name=\"Year\" 
        value=\"[sales_and_marketing].[Time].[Time].[Year]-&amp;gt;:[PC].[@MEMBER].[20100101-20101231]\" 
        displayValue=\"2010\"/>
    <\/drillTarget>'>
  <SPAN class=hy tabIndex=-1>
    81,929,179.22
  </SPAN>
</SPAN>

This can be modified by looping through with JavaScript fairly easily, but I’ll leave that for another time.

The first part describes the actual settings – the metadata of the drill. This is stored in JavaScript object in the page, which makes it significantly easier to modify. Stringifying the object returns (again, modified for legibility):

[
  {"m_label":"DrillThrough"
  ,"m_outputFormat":"HTMLFragment"
  ,"m_outputLocale":"en-us"
  ,"m_showInNewWindow":"true"
  ,"m_method":"execute"
  ,"m_path":"/content/folder[@name='JavaScript Examples']/folder[@name='Modifying Drillthrough Definitions']/report[@name='Drill 1']"
  ,"m_bookmark":""
  ,"m_parameters":"<bus:parameters xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:baseParameter[2]\"><item xsi:type=\"bus:parameter\"><bus:name xsi:type=\"xs:string\">Product Line</bus:name><bus:type xsi:type=\"bus:parameterDataTypeEnum\">memberUniqueName</bus:type></item><item xsi:type=\"bus:parameter\"><bus:name xsi:type=\"xs:string\">Year</bus:name><bus:type xsi:type=\"bus:parameterDataTypeEnum\">memberUniqueName</bus:type></item></bus:parameters>"
  ,"m_objectPaths":"<bus:objectPaths xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:searchPathSingleObject[4]\"><item xsi:type=\"bus:searchPathSingleObject\">storeID(&quot;i326070F7595B4B5BBCD38D945E66AAEB&quot;)</item><item xsi:type=\"bus:searchPathSingleObject\">storeID(&quot;iDB36CF1A0D654E99B3117B0B6A7F8789&quot;)/model[last()]</item><item xsi:type=\"bus:searchPathSingleObject\">/content/folder[@name=&apos;Samples&apos;]/folder[@name=&apos;Cubes&apos;]/package[@name=&apos;Sales and Marketing (cube)&apos;]/model[@name=&apos;2008-07-25T15:28:38.072Z&apos;]</item><item xsi:type=\"bus:searchPathSingleObject\">/content/folder[@name=&apos;Samples&apos;]/folder[@name=&apos;Cubes&apos;]/package[@name=&apos;Sales and Marketing (cube)&apos;]/model[last()]</item></bus:objectPaths>"
  ,"m_prompt":"false"
  ,"m_dynamicDrillThrough":false
  ,"m_parameterProperties":"<PARAMETER-PROPERTIES/>"}
  ,
  {"m_label":"DrillThrough"
  ,"m_outputFormat":"HTMLFragment"
  ,"m_outputLocale":"en-us"
  ,"m_showInNewWindow":"true"
  ,"m_method":"execute"
  ,"m_path":"/content/folder[@name='JavaScript Examples']/folder[@name='Modifying Drillthrough Definitions']/report[@name='Drill 1']"
  ,"m_bookmark":""
  ,"m_parameters":"<bus:parameters xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:baseParameter[2]\"><item xsi:type=\"bus:parameter\"><bus:name xsi:type=\"xs:string\">Product Line</bus:name><bus:type xsi:type=\"bus:parameterDataTypeEnum\">memberUniqueName</bus:type></item><item xsi:type=\"bus:parameter\"><bus:name xsi:type=\"xs:string\">Year</bus:name><bus:type xsi:type=\"bus:parameterDataTypeEnum\">memberUniqueName</bus:type></item></bus:parameters>"
  ,"m_objectPaths":"<bus:objectPaths xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:searchPathSingleObject[4]\"><item xsi:type=\"bus:searchPathSingleObject\">storeID(&quot;i326070F7595B4B5BBCD38D945E66AAEB&quot;)</item><item xsi:type=\"bus:searchPathSingleObject\">storeID(&quot;iDB36CF1A0D654E99B3117B0B6A7F8789&quot;)/model[last()]</item><item xsi:type=\"bus:searchPathSingleObject\">/content/folder[@name=&apos;Samples&apos;]/folder[@name=&apos;Cubes&apos;]/package[@name=&apos;Sales and Marketing (cube)&apos;]/model[@name=&apos;2008-07-25T15:28:38.072Z&apos;]</item><item xsi:type=\"bus:searchPathSingleObject\">/content/folder[@name=&apos;Samples&apos;]/folder[@name=&apos;Cubes&apos;]/package[@name=&apos;Sales and Marketing (cube)&apos;]/model[last()]</item></bus:objectPaths>"
  ,"m_prompt":"false"
  ,"m_dynamicDrillThrough":false
  ,"m_parameterProperties":"<PARAMETER-PROPERTIES/>"}]

Each of these settings is easily changed (except for the the m_parameters and m_parameterProperties because that means changing the settings on the actual drills themselves). People with sharp eyes may notice that both drillthrough definitions are exactly the same. Why does it appear twice? The drillthrough appears twice in my report’s crosstab. The definition appears for the detail row and again for the totals row. If I was passing the individual month with the detail, then the first drillthrough in the object would include the month.

Because the drills can appear twice, any function written to rewrite the settings must include a loop to check the m_label in each element.

Consider the following:

<script>
var paulScripts = {},  oCR = cognos.Report.getReport( "_THIS_" );

paulScripts.getControl = function (promptName) {
  return oCR.prompt.getControlByName(promptName);
}

/*
 * function: changeDrillAttribute
 * By Paul Mendelson
 * This allows the user to change any attribute in the drill. Attributes may be:
 * m_label, m_outputFormat, m_outputLocale, m_showInNewWindow, m_method, m_path, 
 * m_bookmark, m_parameters, m_objectPaths, m_prompt, m_dynamicDrillThrough, 
 * m_parameterProperties
 * Drills may appear multiple times in the object, so the loop goes through the entire array. Each 
 * matching drill will have the attribute changed as desired.
 * Valid m_outputFormat:  CSV, HTML, layoutDataXML, MHT,  PDF, rawXML, singleXLS, spreadsheetML, XLS, 
 * XML, XLWA.
 * m_path: /content/folder[@name='folderName']/folder[@name='folderName']/report[@name='reportName']
 */

paulScripts.changeDrillAttribute = function (drillName,attribute,newValue){
  var oCV = window['oCV'+'_THIS_']
  , drillsObj = oCV.getRV().getCV().getDrillTargets();

  for(var i=0;i<drillsObj.length;i++){
   if( drillsObj[i].m_label == drillName) drillsObj[i][attribute] = newValue;
  }
}

</script>

paulScripts.changeDrillAttribute function will receive the name of the drill, the attribute to change, and the new value of that attribute. It will then loop through all of the elements in the drill targets, and if the label matches, change the attribute.

The following screenshot shows the crosstab containing the drill, and two radio button groups.
radios can change the drill

The radios have a validator set on them to invoke the changeDrillAttribute function.

<script>
paulScripts.getControl('Format').setValidator(
  function (values) {
  paulScripts.changeDrillAttribute ('DrillThrough','m_outputFormat',values[0].use);
  return true;
  }
);

paulScripts.getControl('Target').setValidator(
  function (values) {
  paulScripts.changeDrillAttribute ('DrillThrough','m_path',values[0].use);
  return true;
  }
);

</script>

Whenever the radio is changed, it will modify the drill appropriately. That setValidator function is the only use of the new Prompt API, so this can be changed very easily to previous versions by using onChange events.

Ultimately the end user can decide which report he wants to drill to, and in what format, without having to right-click. Because users don’t like right-clicking.

The following XML is the report. Remember to create two targets for the drill and to fix the value prompt. To get the path of the report, simply go to the properties of the report, click on “View the search path, ID and URL” and copy the search path.

<report xmlns="http://developer.cognos.com/schemas/report/9.0/" useStyleVersion="10" expressionLocale="en-us">
				<modelPath>/content/folder[@name='Samples']/folder[@name='Cubes']/package[@name='Sales and Marketing (cube)']/model[@name='2008-07-25T15:28:38.072Z']</modelPath>
				<drillBehavior modelBasedDrillThru="true"/>
				<queries>
					<query name="Query1">
						<source>
							<model/>
						</source>
						<selection><dataItemLevelSet name="Year"><dmLevel><LUN>[sales_and_marketing].[Time].[Time].[Year]</LUN><itemCaption>Year</itemCaption></dmLevel><dmDimension><DUN>[sales_and_marketing].[Time]</DUN><itemCaption>Time</itemCaption></dmDimension><dmHierarchy><HUN>[sales_and_marketing].[Time].[Time]</HUN><itemCaption>Time</itemCaption></dmHierarchy></dataItemLevelSet><dataItemLevelSet name="Quarter"><dmLevel><LUN>[sales_and_marketing].[Time].[Time].[Quarter]</LUN><itemCaption>Quarter</itemCaption></dmLevel><dmDimension><DUN>[sales_and_marketing].[Time]</DUN><itemCaption>Time</itemCaption></dmDimension><dmHierarchy><HUN>[sales_and_marketing].[Time].[Time]</HUN><itemCaption>Time</itemCaption></dmHierarchy></dataItemLevelSet><dataItemLevelSet name="Product line"><dmLevel><LUN>[sales_and_marketing].[Products].[Products].[Product line]</LUN><itemCaption>Product line</itemCaption></dmLevel><dmDimension><DUN>[sales_and_marketing].[Products]</DUN><itemCaption>Products</itemCaption></dmDimension><dmHierarchy><HUN>[sales_and_marketing].[Products].[Products]</HUN><itemCaption>Products</itemCaption></dmHierarchy></dataItemLevelSet><dataItemMeasure name="Revenue"><dmMember><MUN>[sales_and_marketing].[Measures].[Revenue]</MUN><itemCaption>Revenue</itemCaption></dmMember><dmDimension><DUN>[sales_and_marketing].[Measures]</DUN><itemCaption>Measures</itemCaption></dmDimension><XMLAttributes><XMLAttribute name="RS_dataType" value="9" output="no"/></XMLAttributes></dataItemMeasure></selection>
					</query>
				</queries>
				<layouts>
					<layout>
						<reportPages>
							<page name="Page1"><style><defaultStyles><defaultStyle refStyle="pg"/></defaultStyles></style>
								<pageBody><style><defaultStyles><defaultStyle refStyle="pb"/></defaultStyles></style>
									<contents>
										<HTMLItem>
			<dataSource>
				<staticValue>&lt;script&gt;
var paulScripts = {},  oCR = cognos.Report.getReport( "_THIS_" );

paulScripts.getControl = function (promptName) {
  return oCR.prompt.getControlByName(promptName);
}

/*
 * function: changeDrillAttribute
 * Paul Mendelson
 * This allows the user to change any attribute in the drill. Attributes may be:
 *   m_label, m_outputFormat, m_outputLocale, m_showInNewWindow, m_method, m_path, 
  * m_bookmark, m_parameters, m_objectPaths, m_prompt, m_dynamicDrillThrough, 
  * m_parameterProperties
  * Drills may appear multiple times in the object, so the loop goes through the entire array. Each 
  * matching drill will have the attribute changed as desired.
  *  Valid m_outputFormat:  CSV, HTML, layoutDataXML, MHT,  PDF, rawXML, singleXLS, spreadsheetML, XLS, 
  * XML, XLWA.
  * m_path: /content/folder[@name='folderName']/folder[@name='folderName']/report[@name='reportName']
  */

paulScripts.changeDrillAttribute = function (drillName,attribute,newValue){
  var oCV = window['oCV'+'_THIS_']
  , drillsObj = oCV.getRV().getCV().getDrillTargets();

  for(var i=0;i&lt;drillsObj.length;i++){
   if( drillsObj[i].m_label == drillName) drillsObj[i][attribute] = newValue;
  }
}

  &lt;/script&gt;
	</staticValue>
			</dataSource>
		</HTMLItem>
									<table><style><defaultStyles><defaultStyle refStyle="tb"/></defaultStyles><CSS value="border-collapse:collapse"/></style><tableRows><tableRow><tableCells><tableCell><contents><crosstab refQuery="Query1" horizontalPagination="true" name="Crosstab1">
											<crosstabCorner><style><defaultStyles><defaultStyle refStyle="xm"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Revenue"/></dataSource></textItem></contents></crosstabCorner>
											
											
											<noDataHandler>
												<contents>
													<block>
														<contents>
															<textItem>
																<dataSource>
																	<staticValue>No Data Available</staticValue>
																</dataSource>
																<style>
																	<CSS value="padding:10px 18px;"/>
																</style>
															</textItem>
														</contents>
													</block>
												</contents>
											</noDataHandler>
											<style>
												<defaultStyles>
													<defaultStyle refStyle="xt"/>
												</defaultStyles>
												<CSS value="border-collapse:collapse"/>
											</style>
										<crosstabRows><crosstabNode><crosstabNestedNodes><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="Quarter" edgeLocation="e2"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="Year" edgeLocation="e3"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabNestedNodes><crosstabNodeMembers><crosstabNodeMember refDataItem="Year" edgeLocation="e1"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabRows><crosstabColumns><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="Product line" edgeLocation="e4"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabColumns><defaultMeasure refDataItem="Revenue"/><crosstabFactCell><contents><textItem><dataSource><cellValue/></dataSource><reportDrills><reportDrill name="DrillThrough"><drillLabel><dataSource><staticValue/></dataSource></drillLabel><drillTarget method="execute" showInNewWindow="true"><reportPath path="/content/folder[@name='JavaScript Examples']/folder[@name='Modifying Drillthrough Definitions']/report[@name='Drill 1']"><XMLAttributes><XMLAttribute name="ReportName" value="Drill 1" output="no"/><XMLAttribute name="class" value="report" output="no"/></XMLAttributes></reportPath><drillLinks><drillLink><drillTargetContext><parameterContext parameter="Product Line"/></drillTargetContext><drillSourceContext><dataItemContext refDataItem="Product line"/></drillSourceContext></drillLink><drillLink><drillTargetContext><parameterContext parameter="Year"/></drillTargetContext><drillSourceContext><dataItemContext refDataItem="Year"/></drillSourceContext></drillLink></drillLinks></drillTarget></reportDrill></reportDrills><style><defaultStyles><defaultStyle refStyle="hy"/></defaultStyles></style></textItem></contents><style><defaultStyles><defaultStyle refStyle="mv"/></defaultStyles></style></crosstabFactCell></crosstab></contents></tableCell><tableCell><contents><table><style><defaultStyles><defaultStyle refStyle="tb"/></defaultStyles><CSS value="border-collapse:collapse"/></style><tableRows><tableRow><tableCells><tableCell><contents><selectValue parameter="Format" selectValueUI="radioGroup" name="Format"><selectOptions><selectOption useValue="PDF"/><selectOption useValue="spreadsheetML"/><selectOption useValue="HTMLFragment"/><selectOption useValue="HTML"/></selectOptions><defaultSelections><defaultSimpleSelection>HTMLFragment</defaultSimpleSelection></defaultSelections></selectValue></contents></tableCell></tableCells></tableRow><tableRow><tableCells><tableCell><contents><selectValue parameter="Target" name="Target" selectValueUI="radioGroup"><selectOptions><selectOption useValue="/content/folder[@name='JavaScript Examples']/folder[@name='Modifying Drillthrough Definitions']/report[@name='Drill 1']"><displayValue>Target 1</displayValue></selectOption><selectOption useValue="/content/folder[@name='JavaScript Examples']/folder[@name='Modifying Drillthrough Definitions']/report[@name='Drill 2']"><displayValue>Target 2</displayValue></selectOption></selectOptions><defaultSelections><defaultSimpleSelection>/content/folder[@name='JavaScript Examples']/folder[@name='Modifying Drillthrough Definitions']/report[@name='Drill 1']</defaultSimpleSelection></defaultSelections></selectValue></contents></tableCell></tableCells></tableRow></tableRows></table></contents><style><CSS value="vertical-align:top"/></style></tableCell></tableCells></tableRow></tableRows></table><HTMLItem>
			<dataSource>
				<staticValue>&lt;script&gt;
paulScripts.getControl('Format').setValidator(
  function (values) {
  paulScripts.changeDrillAttribute ('DrillThrough','m_outputFormat',values[0].use);
  return true;
  }
);

paulScripts.getControl('Target').setValidator(
  function (values) {
  paulScripts.changeDrillAttribute ('DrillThrough','m_path',values[0].use);
  return true;
  }
);

&lt;/script&gt;</staticValue>
			</dataSource>
		</HTMLItem></contents>
								</pageBody>
								
								
							</page>
						</reportPages>
					</layout>
				</layouts>
			<XMLAttributes><XMLAttribute name="RS_CreateExtendedDataItems" value="true" output="no"/><XMLAttribute name="listSeparator" value="," output="no"/><XMLAttribute name="RS_modelModificationTime" value="2008-07-25T15:28:38.133Z" output="no"/></XMLAttributes><reportName>Report</reportName></report>

Checkbox List Prompts revisited

A long while back, I published an article detailing how to use a list to interact with a checkbox prompt. Since then, several people have asked me to add features to the code, and to fix some bugs. I’ve also learned quite a bit since I wrote that, so I’ve rewritten a parts of it.

The basic core of the code is the same. Using div tags to identify the list and prompt objects, with more HTML items to build the actual checkbox in the list. This is by no means optimized JavaScript, nor is it using the 10.2 Prompt API.

Previously the code would only work with one list. The reference to the list was hardcoded in the script and the checkboxes and select all buttons would fail for the second list. Also requested, using grouped rows. For instance, a user might want to select all of the months in 2011 by checking on the checkbox in the 2011 group. Another thing I fixed was the way it would loop through value prompts to find the correct value. If the key had any special characters, it wouldn’t be able to find it. Cognos would automatically escape those special characters.

The XML below was written on 10.2, but will downgrade easily to 10.1 by changing

xmlns="http://developer.cognos.com/schemas/report/9.0/"

to

xmlns="http://developer.cognos.com/schemas/report/8.0/"

The JavaScript will work in 8.4 as well, but downgrading will be a bit more difficult – you need to use /report/6.0/ and remove all of the version 10 only XML elements. If there’s a demand for it, I’ll go through and post all of the different JavaScript objects here. (But there shouldn’t be, because 10.2 is the greatest things since 10.1.1 and you should all upgrade and IBM should be paying me push upgrades like this.)

<report xmlns="http://developer.cognos.com/schemas/report/9.0/" expressionLocale="he" interactivePageBreakByFrame="true">
    <modelPath>/content/folder[@name='Samples']/folder[@name='Cubes']/package[@name='Sales and Marketing (cube)']/model[@name='2008-07-25T15:28:38.072Z']</modelPath> 
    <layouts> 
        <layout> 
            <reportPages> 
                <page name="Page1"> 
                    <pageBody> 
                        <contents><HTMLItem description="Styles"> 
                                <dataSource> 
                                    <staticValue>&lt;style type="text/css"&gt; 
  
input.updatebutton 
{ 
   font-size:11px; 
   font-weight:bold; 
   width:140px; 
   height:27px; 
   color:#000000; 
   background-color:#cdc9c9; 
   border-style:solid; 
   border-color:#003377; 
   border-width:3px; 
} 
  
  
  
input.matchbutton 
{ 
   font-size:11px; 
   font-weight:bold; 
   width:140px; 
   height:27px; 
   color:#EEFFFF; 
   background-color:#0088DD; 
   border-style:solid; 
   border-color:#003377; 
   border-width:3px; 
} 
  
input.selectbutton 
{ 
   font-size:9px; 
   font-weight:bold; 
   width:60px; 
   height:20px; 
   color:#000000; 
   background-color:#FFFFFF; 
   border-style:solid; 
   border-color:#FFFFFF; 
   border-width:3px; 
} 
  
&lt;/style&gt; 
  
&lt;script language="javascript"&gt; 
  
function goLite(FRM,BTN) 
{ 
   window.document.forms[FRM].elements[BTN].style.color = "#FFFF99"; 
   window.document.forms[FRM].elements[BTN].style.backgroundColor = "#11AAEE"; 
} 
  
function goDim(FRM,BTN) 
{ 
   window.document.forms[FRM].elements[BTN].style.color = "#EEFFFF"; 
   window.document.forms[FRM].elements[BTN].style.backgroundColor = "#0088DD"; 
} 
  
&lt;/script&gt; 
</staticValue> 
                                </dataSource> 
                            </HTMLItem> 
                            <HTMLItem description="Scripts"> 
                                <dataSource> 
                                    <staticValue>&lt;script&gt; 
function selectInCheckbox(cbGroup,id) 
{ 
   var inputs= document.getElementById(cbGroup).getElementsByTagName('input'); 
   for (var i=0;i&lt;inputs.length;i++) 
   { 
        if (inputs[i].value == id)  
        { 
            inputs[i].click(); 
        } 
   } 
} 
  
function selectInCheckboxRow(cbGroup,id) 
{ 
    var inputs= document.getElementById(cbGroup).getElementsByTagName('input'); 
    inputs[id].click(); 
} 

function checkAll(list){ 
var inputs=document.getElementById(list).getElementsByTagName('input') 
for (var i=0;i&lt;inputs.length;i++){ 
        if (inputs[i].type == 'checkbox') { 
            if (inputs[i].checked == true)  
        {} 
        else {inputs[i].click();} 
        } 
} 
}  
  
function unCheckAll(list){ 
var inputs=document.getElementById(list).getElementsByTagName('input') 
for (var i=0;i&lt;inputs.length;i++){ 
        if (inputs[i].type == 'checkbox') { 
            if (inputs[i].checked == true)  
        {inputs[i].click();} 
        else {} 
        } 
} 
}  

function getSource (){
    var targ; 
    if (!e) var e = window.event; 
    if(!e) return false; 
    if (e.target) targ = e.target; 
    else if (e.srcElement) targ = e.srcElement; 
    if (targ.nodeType == 3) // defeat Safari bug 
      targ = targ.parentNode; 
    return targ; 
} 
  

function checkNested(){

var 
    elm = getSource().parentNode
  , tbody = elm.parentNode.parentNode.parentNode
  , rowsLength = tbody.rows.length
  , rowSpanLength = elm.rowSpan
  , rowIndex = elm.parentNode.rowIndex
  , isChecked = getSource().checked;

  for(var i=rowIndex;i&lt;rowIndex+rowSpanLength;i++)
  {
     var e = i == rowIndex?elm.cellIndex + 1 : 0;
      if(tbody.rows[i].cells[e].getElementsByTagName('INPUT')[0].checked == isChecked) {continue;}
     else{  tbody.rows[i].cells[e].getElementsByTagName('INPUT')[0].click()}
      i = i+elm.nextSibling.rowSpan - 1;

  }
}
&lt;/script&gt; 
  
</staticValue> 
                                </dataSource> 
                            </HTMLItem> 
                              
                              
                            <promptButton type="reprompt"> 
            <contents/> 
            <style> 
                <defaultStyles> 
                    <defaultStyle refStyle="bp"/> 
                </defaultStyles> 
            </style> 
        </promptButton><table><style><defaultStyles><defaultStyle refStyle="tb"/></defaultStyles><CSS value="border-collapse:collapse"/></style><tableRows><tableRow><tableCells><tableCell><contents><HTMLItem description="div"> 
            <dataSource> 
                <staticValue>&lt;div id="checkbox1" &gt;</staticValue> 
            </dataSource> 
        </HTMLItem><selectValue multiSelect="true" parameter="code" range="false" refQuery="Prompt" required="false" selectValueUI="checkboxGroup"><useItem refDataItem="Product line code"/><sortList><sortItem refDataItem="Product line code"/></sortList></selectValue><HTMLItem description="/div"> 
            <dataSource> 
                <staticValue>&lt;/div&gt;</staticValue> 
            </dataSource> 
        </HTMLItem><HTMLItem description="div"> 
            <dataSource> 
                <staticValue>&lt;div id="checkbox2" &gt;</staticValue> 
            </dataSource> 
        </HTMLItem><selectValue multiSelect="true" parameter="Quarter" refQuery="Quarters" required="false" selectValueUI="checkboxGroup"><useItem refDataItem="Quarter - Category Code"><displayItem refDataItem="Quarter"/></useItem></selectValue><HTMLItem description="/div"> 
            <dataSource> 
                <staticValue>&lt;/div&gt;</staticValue> 
            </dataSource> 
        </HTMLItem></contents><style><CSS value="vertical-align:top"/></style></tableCell><tableCell><contents><HTMLItem description="div id=&quot;list1&quot;"> 
                                                                <dataSource> 
                                                                    <staticValue>&lt;div id="list1"&gt;</staticValue> 
                                                                </dataSource> 
                                                            </HTMLItem><list name="List2" pageBreakText="false" refQuery="Prompt" repeatEveryPage="true"> 
              
              
              
            <style> 
                <CSS value="border-collapse:collapse"/> 
                <defaultStyles> 
                    <defaultStyle refStyle="ls"/> 
                </defaultStyles> 
            </style> 
        <listColumns><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><staticValue>HTML Item</staticValue></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><HTMLItem description="Checkbox Start"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>&lt;input title="Faster but if the sorting is off then this won't work" type="checkbox"  
</staticValue></dataSource> 
                                                                                </HTMLItem><HTMLItem description="checked"> 
            <dataSource> 
                  
            <reportExpression>case when (ParamValue('code') +', ') contains ([Product line code] +', ') then (' checked ') else ('') end</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="onClick"> 
            <dataSource> 
                <staticValue>onClick="selectInCheckboxRow('checkbox1','</staticValue> 
            </dataSource> 
        </HTMLItem><HTMLItem description="Row"> 
            <dataSource> 
                  
            <reportExpression>RowNumber ()</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="CheckboxEnd"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>'); 
"&gt; 
</staticValue> 
                                                                                    </dataSource> 
                                                                                </HTMLItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><staticValue>By Code</staticValue></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><HTMLItem description="Checkbox Start"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>&lt;input title="Slower but less prone to error" type="checkbox"  
</staticValue></dataSource> 
                                                                                </HTMLItem><HTMLItem description="checked"> 
            <dataSource> 
                  
            <reportExpression>case when (ParamValue('code') +', ') contains ([Product line code] +', ') then (' checked ') else ('') end</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="onClick"> 
            <dataSource> 
                <staticValue>onClick="selectInCheckbox('checkbox1','</staticValue> 
            </dataSource> 
        </HTMLItem><HTMLItem description="Code"> 
            <dataSource> 
                  
            <dataItemValue refDataItem="Product line code"/></dataSource> 
        </HTMLItem><HTMLItem description="CheckboxEnd"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>'); 
"&gt; 
</staticValue> 
                                                                                    </dataSource> 
                                                                                </HTMLItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Product line"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Product line"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Quantity"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Quantity"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Revenue"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Revenue"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Gross profit"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Gross profit"/></dataSource></textItem></contents></listColumnBody></listColumn></listColumns><propertyList><propertyItem refDataItem="Product line code"/></propertyList><sortList><sortItem refDataItem="Product line code"/></sortList></list><HTMLItem description="/div"> 
                                                                <dataSource> 
                                                                    <staticValue>&lt;/div&gt;</staticValue> 
                                                                </dataSource> 
                                                            </HTMLItem><HTMLItem description="doAll"> 
                                                        <dataSource> 
                                                            <staticValue> &lt;input type="button" value="Select All" class="selectbutton" onmouseover = "this.style.cursor='hand'" onclick="checkAll('list1');"&gt; 
&lt;input type="button" value="Clear All" class="selectbutton" onmouseover = "this.style.cursor='hand'" onclick="unCheckAll('list1');"&gt;</staticValue> 
                                                        </dataSource> 
                                                    </HTMLItem><HTMLItem description="div id=&quot;list2&quot;"> 
                                                                <dataSource> 
                                                                    <staticValue>&lt;div id="list2"&gt;</staticValue> 
                                                                </dataSource> 
                                                            </HTMLItem><list horizontalPagination="true" name="List1" refQuery="Prompt">
			
			
			
			<noDataHandler>
				<contents>
					<block>
						<contents>
							<textItem>
								<dataSource>
									<staticValue>No Data Available</staticValue>
								</dataSource>
								<style>
									<CSS value="padding:10px 18px;"/>
								</style>
							</textItem>
						</contents>
					</block>
				</contents>
			</noDataHandler>
			<style>
				<CSS value="border-collapse:collapse"/>
				<defaultStyles>
					<defaultStyle refStyle="ls"/>
				</defaultStyles>
			</style>
		<listColumns><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Time"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><HTMLItem>
			<dataSource>
				<staticValue>&lt;input type="checkbox" onclick="
checkNested()"&gt;</staticValue>
			</dataSource>
		</HTMLItem><textItem><dataSource><dataItemValue refDataItem="Time"/></dataSource></textItem></contents><listColumnRowSpan refDataItem="Time"/></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Year"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><HTMLItem>
			<dataSource>
				<staticValue>&lt;input type="checkbox" onclick="
checkNested()"&gt;</staticValue>
			</dataSource>
		</HTMLItem><textItem><dataSource><dataItemValue refDataItem="Year"/></dataSource></textItem></contents><listColumnRowSpan refDataItem="Year"/></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Quarter"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><HTMLItem description="Checkbox Start"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>&lt;input title="Slower but less prone to error" type="checkbox"  
</staticValue></dataSource> 
                                                                                </HTMLItem><HTMLItem description="checked"> 
            <dataSource> 
                  
            <reportExpression>case when (ParamValue('Quarter') +', ') contains ([Quarter - Category Code] +', ') then (' checked ') else ('') end</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="onClick"> 
            <dataSource> 
                <staticValue>onClick="selectInCheckbox('checkbox2',unescape('</staticValue> 
            </dataSource> 
        </HTMLItem><HTMLItem description="Code"> 
            <dataSource> 
                  
            <reportExpression>URLEncode ([Prompt].[Quarter - Category Code])</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="CheckboxEnd"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>')); 
"&gt; 
</staticValue> 
                                                                                    </dataSource> 
                                                                                </HTMLItem><textItem><dataSource><dataItemValue refDataItem="Quarter"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Quantity"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Quantity"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Revenue"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Revenue"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Gross profit"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Gross profit"/></dataSource></textItem></contents></listColumnBody></listColumn></listColumns><propertyList><propertyItem refDataItem="Year - Category Code"/><propertyItem refDataItem="Quarter - Category Code"/></propertyList><listGroups><listGroup refDataItem="Time"/><listGroup refDataItem="Year"/></listGroups></list><HTMLItem description="/div"> 
                                                                <dataSource> 
                                                                    <staticValue>&lt;/div&gt;</staticValue> 
                                                                </dataSource> 
                                                            </HTMLItem><HTMLItem description="doAll"> 
                                                        <dataSource> 
                                                            <staticValue> &lt;input type="button" value="Select All" class="selectbutton" onmouseover = "this.style.cursor='hand'" onclick="checkAll('list2');"&gt; 
&lt;input type="button" value="Clear All" class="selectbutton" onmouseover = "this.style.cursor='hand'" onclick="unCheckAll('list2');"&gt;</staticValue> 
                                                        </dataSource> 
                                                    </HTMLItem><HTMLItem description="div id=&quot;list3&quot;"> 
                                                                <dataSource> 
                                                                    <staticValue>&lt;div id="list3"&gt;</staticValue> 
                                                                </dataSource> 
                                                            </HTMLItem><crosstab name="Crosstab1" pageBreakText="false" refQuery="Prompt" repeatEveryPage="true">
			<crosstabCorner>
				<contents/>
				<style>
					<defaultStyles>
						<defaultStyle refStyle="xm"/>
					</defaultStyles>
				</style>
			</crosstabCorner>
			
			
			
			<style>
				<CSS value="border-collapse:collapse"/>
				<defaultStyles>
					<defaultStyle refStyle="xt"/>
				</defaultStyles>
			</style>
		<crosstabFactCell><contents><textItem><dataSource><cellValue/></dataSource></textItem></contents><style><defaultStyles><defaultStyle refStyle="mv"/></defaultStyles></style></crosstabFactCell><crosstabColumns><crosstabNode><crosstabNodeMembers><crosstabNodeMember edgeLocation="e5" refDataItem="Product line"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><HTMLItem description="Checkbox Start"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>&lt;input title="Slower but less prone to error" type="checkbox"  
</staticValue></dataSource> 
                                                                                </HTMLItem><HTMLItem description="checked"> 
            <dataSource> 
                  
            <reportExpression>case when (ParamValue('code') +', ') contains ([Product line code] +', ') then (' checked ') else ('') end</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="onClick"> 
            <dataSource> 
                <staticValue>onClick="selectInCheckbox('checkbox1','</staticValue> 
            </dataSource> 
        </HTMLItem><HTMLItem description="Code"> 
            <dataSource> 
                  
            <dataItemValue refDataItem="Product line code"/></dataSource> 
        </HTMLItem><HTMLItem description="CheckboxEnd"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>'); 
"&gt; 
</staticValue> 
                                                                                    </dataSource> 
                                                                                </HTMLItem><textItem><dataSource><memberCaption/></dataSource></textItem></contents><propertyList><propertyItem refDataItem="Product line code"/></propertyList></crosstabNodeMember></crosstabNodeMembers><crosstabNestedNodes><crosstabNode><crosstabNodeMembers><crosstabNodeMember edgeLocation="e1" refDataItem="Quantity"><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style></crosstabNodeMember></crosstabNodeMembers></crosstabNode><crosstabNode><crosstabNodeMembers><crosstabNodeMember edgeLocation="e2" refDataItem="Revenue"><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style></crosstabNodeMember></crosstabNodeMembers></crosstabNode><crosstabNode><crosstabNodeMembers><crosstabNodeMember edgeLocation="e3" refDataItem="Gross profit"><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabNestedNodes></crosstabNode></crosstabColumns><crosstabRows><crosstabNode><crosstabNodeMembers><crosstabNodeMember edgeLocation="e4" refDataItem="Quarter"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><HTMLItem description="Checkbox Start"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>&lt;input title="Slower but less prone to error" type="checkbox"  
</staticValue></dataSource> 
                                                                                </HTMLItem><HTMLItem description="checked"> 
            <dataSource> 
                  
            <reportExpression>case when (ParamValue('Quarter') +', ') contains ([Quarter - Category Code] +', ') then (' checked ') else ('') end</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="onClick"> 
            <dataSource> 
                <staticValue>onClick="selectInCheckbox('checkbox2',unescape('</staticValue> 
            </dataSource> 
        </HTMLItem><HTMLItem description="Code"> 
            <dataSource> 
                  
            <reportExpression>URLEncode ([Prompt].[Quarter - Category Code])</reportExpression></dataSource> 
        </HTMLItem><HTMLItem description="CheckboxEnd"> 
                                                                                    <dataSource> 
                                                                                        <staticValue>')); 
"&gt; 
</staticValue> 
                                                                                    </dataSource> 
                                                                                </HTMLItem><textItem><dataSource><memberCaption/></dataSource></textItem></contents><propertyList><propertyItem refDataItem="Quarter - Category Code"/></propertyList></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabRows></crosstab><HTMLItem description="/div"> 
                                                                <dataSource> 
                                                                    <staticValue>&lt;/div&gt;</staticValue> 
                                                                </dataSource> 
                                                            </HTMLItem><HTMLItem description="doAll"> 
                                                        <dataSource> 
                                                            <staticValue> &lt;input type="button" value="Select All" class="selectbutton" onmouseover = "this.style.cursor='hand'" onclick="checkAll('list3');"&gt; 
&lt;input type="button" value="Clear All" class="selectbutton" onmouseover = "this.style.cursor='hand'" onclick="unCheckAll('list3');"&gt;</staticValue> 
                                                        </dataSource> 
                                                    </HTMLItem></contents><style><CSS value="vertical-align:top"/></style></tableCell></tableCells></tableRow></tableRows></table><block> 
                                <contents/> 
                            </block> 
                        <combinationChart maxHotspots="10000" name="Combination Chart1" refQuery="Report" showTooltips="true"> 
                                <legend> 
                                    <legendPosition> 
                                        <relativePosition/> 
                                    </legendPosition> 
                                    <legendTitle refQuery="Report"> 
                                        <style> 
                                            <defaultStyles> 
                                                <defaultStyle refStyle="lx"/> 
                                            </defaultStyles> 
                                        </style> 
                                    </legendTitle> 
                                    <style> 
                                        <defaultStyles> 
                                            <defaultStyle refStyle="lg"/> 
                                        </defaultStyles> 
                                    </style> 
                                </legend> 
                                <ordinalAxis> 
                                    <axisTitle refQuery="Report"> 
                                        <style> 
                                            <defaultStyles> 
                                                <defaultStyle refStyle="at"/> 
                                            </defaultStyles> 
                                        </style> 
                                    </axisTitle> 
                                    <axisLine color="black"/> 
                                    <style> 
                                        <defaultStyles> 
                                            <defaultStyle refStyle="al"/> 
                                        </defaultStyles> 
                                    </style> 
                                </ordinalAxis> 
                                <numericalAxisY1> 
                                    <axisTitle refQuery="Report"> 
                                        <style> 
                                            <defaultStyles> 
                                                <defaultStyle refStyle="at"/> 
                                            </defaultStyles> 
                                        </style> 
                                    </axisTitle> 
                                    <gridlines color="#cccccc"/> 
                                    <axisLine color="black"/> 
                                    <style> 
                                        <defaultStyles> 
                                            <defaultStyle refStyle="al"/> 
                                        </defaultStyles> 
                                    </style> 
                                </numericalAxisY1> 
                                <combinationChartTypes> 
                                    <bar><chartNodes><chartNode><chartNodeMembers><chartNodeMember refDataItem="Revenue"><chartContents><chartTextItem><dataSource><memberCaption/></dataSource></chartTextItem></chartContents></chartNodeMember></chartNodeMembers></chartNode></chartNodes></bar> 
                                </combinationChartTypes> 
                                <style> 
                                    <defaultStyles> 
                                        <defaultStyle refStyle="ch"/> 
                                    </defaultStyles> 
                                </style> 
                                <commonClusters><chartNodes><chartNode><chartNodeMembers><chartNodeMember refDataItem="Product type"><chartContents><chartTextItem><dataSource><memberCaption/></dataSource></chartTextItem></chartContents></chartNodeMember></chartNodeMembers></chartNode></chartNodes></commonClusters><conditionalRender refVariable="renderGraph"><renderFor refVariableValue="1"/></conditionalRender></combinationChart> 
                        </contents> 
                    <style><defaultStyles><defaultStyle refStyle="pb"/></defaultStyles></style></pageBody> 
                <style><defaultStyles><defaultStyle refStyle="pg"/></defaultStyles></style></page> 
            <page name="Page2"> 
                    <pageBody> 
                        <contents><HTMLItem description="Styles"> 
                                <dataSource> 
                                    <staticValue>&lt;style type="text/css"&gt; 
  
input.updatebutton 
{ 
   font-size:11px; 
   font-weight:bold; 
   width:140px; 
   height:27px; 
   color:#000000; 
   background-color:#cdc9c9; 
   border-style:solid; 
   border-color:#003377; 
   border-width:3px; 
} 
  
  
  
input.matchbutton 
{ 
   font-size:11px; 
   font-weight:bold; 
   width:140px; 
   height:27px; 
   color:#EEFFFF; 
   background-color:#0088DD; 
   border-style:solid; 
   border-color:#003377; 
   border-width:3px; 
} 
  
input.selectbutton 
{ 
   font-size:9px; 
   font-weight:bold; 
   width:60px; 
   height:20px; 
   color:#000000; 
   background-color:#FFFFFF; 
   border-style:solid; 
   border-color:#FFFFFF; 
   border-width:3px; 
} 
  
&lt;/style&gt; 
  
&lt;script language="javascript"&gt; 
  
function goLite(FRM,BTN) 
{ 
   window.document.forms[FRM].elements[BTN].style.color = "#FFFF99"; 
   window.document.forms[FRM].elements[BTN].style.backgroundColor = "#11AAEE"; 
} 
  
function goDim(FRM,BTN) 
{ 
   window.document.forms[FRM].elements[BTN].style.color = "#EEFFFF"; 
   window.document.forms[FRM].elements[BTN].style.backgroundColor = "#0088DD"; 
} 
  
&lt;/script&gt; 
</staticValue> 
                                </dataSource> 
                            </HTMLItem> 
                            <HTMLItem description="Scripts"> 
                                <dataSource> 
                                    <staticValue>&lt;script&gt; 
function selectInCheckbox(cbGroup,id) 
{ 
   var inputs= document.getElementById(cbGroup).getElementsByTagName('input'); 
   for (var i=0;i&lt;inputs.length;i++) 
   { 
        if (inputs[i].value == id)  
        { 
            inputs[i].click(); 
        } 
   } 
} 
  
function selectInCheckboxRow(cbGroup,id) 
{ 
    var inputs= document.getElementById(cbGroup).getElementsByTagName('input'); 
    inputs[id].click(); 
} 

function checkAll(list){ 
var inputs=document.getElementById(list).getElementsByTagName('input') 
for (var i=0;i&lt;inputs.length;i++){ 
        if (inputs[i].type == 'checkbox') { 
            if (inputs[i].checked == true)  
        {} 
        else {inputs[i].click();} 
        } 
} 
}  
  
function unCheckAll(list){ 
var inputs=document.getElementById(list).getElementsByTagName('input') 
for (var i=0;i&lt;inputs.length;i++){ 
        if (inputs[i].type == 'checkbox') { 
            if (inputs[i].checked == true)  
        {inputs[i].click();} 
        else {} 
        } 
} 
}  
&lt;/script&gt; 
  
</staticValue> 
                                </dataSource> 
                            </HTMLItem> 
                              
                              
                            <promptButton type="reprompt"> 
            <contents/> 
            <style> 
                <defaultStyles> 
                    <defaultStyle refStyle="bp"/> 
                </defaultStyles> 
            </style> 
        </promptButton><table><style><defaultStyles><defaultStyle refStyle="tb"/></defaultStyles><CSS value="border-collapse:collapse"/></style><tableRows><tableRow><tableCells><tableCell><contents><HTMLItem description="div"> 
            <dataSource> 
                <staticValue>&lt;div id="checkbox1" &gt;</staticValue> 
            </dataSource> 
        </HTMLItem><selectValue multiSelect="true" parameter="code" range="false" refQuery="Prompt" required="false" selectValueUI="checkboxGroup"><useItem refDataItem="Product line code"/><sortList><sortItem refDataItem="Product line code"/></sortList></selectValue><HTMLItem description="/div"> 
            <dataSource> 
                <staticValue>&lt;/div&gt;</staticValue> 
            </dataSource> 
        </HTMLItem><HTMLItem description="div"> 
            <dataSource> 
                <staticValue>&lt;div id="checkbox2" &gt;</staticValue> 
            </dataSource> 
        </HTMLItem><selectValue multiSelect="true" parameter="Year" refQuery="Quarters" required="false" selectValueUI="checkboxGroup"><useItem refDataItem="Quarter - Category Code"><displayItem refDataItem="Quarter"/></useItem></selectValue><HTMLItem description="/div"> 
            <dataSource> 
                <staticValue>&lt;/div&gt;</staticValue> 
            </dataSource> 
        </HTMLItem></contents><style><CSS value="vertical-align:top"/></style></tableCell><tableCell><contents/><style><CSS value="vertical-align:top"/></style></tableCell></tableCells></tableRow></tableRows></table><block> 
                                <contents/> 
                            </block> 
                        <combinationChart maxHotspots="10000" name="Combination Chart2" refQuery="Report" showTooltips="true"> 
                                <legend> 
                                    <legendPosition> 
                                        <relativePosition/> 
                                    </legendPosition> 
                                    <legendTitle refQuery="Report"> 
                                        <style> 
                                            <defaultStyles> 
                                                <defaultStyle refStyle="lx"/> 
                                            </defaultStyles> 
                                        </style> 
                                    </legendTitle> 
                                    <style> 
                                        <defaultStyles> 
                                            <defaultStyle refStyle="lg"/> 
                                        </defaultStyles> 
                                    </style> 
                                </legend> 
                                <ordinalAxis> 
                                    <axisTitle refQuery="Report"> 
                                        <style> 
                                            <defaultStyles> 
                                                <defaultStyle refStyle="at"/> 
                                            </defaultStyles> 
                                        </style> 
                                    </axisTitle> 
                                    <axisLine color="black"/> 
                                    <style> 
                                        <defaultStyles> 
                                            <defaultStyle refStyle="al"/> 
                                        </defaultStyles> 
                                    </style> 
                                </ordinalAxis> 
                                <numericalAxisY1> 
                                    <axisTitle refQuery="Report"> 
                                        <style> 
                                            <defaultStyles> 
                                                <defaultStyle refStyle="at"/> 
                                            </defaultStyles> 
                                        </style> 
                                    </axisTitle> 
                                    <gridlines color="#cccccc"/> 
                                    <axisLine color="black"/> 
                                    <style> 
                                        <defaultStyles> 
                                            <defaultStyle refStyle="al"/> 
                                        </defaultStyles> 
                                    </style> 
                                </numericalAxisY1> 
                                <combinationChartTypes> 
                                    <bar><chartNodes><chartNode><chartNodeMembers><chartNodeMember refDataItem="Revenue"><chartContents><chartTextItem><dataSource><memberCaption/></dataSource></chartTextItem></chartContents></chartNodeMember></chartNodeMembers></chartNode></chartNodes></bar> 
                                </combinationChartTypes> 
                                <style> 
                                    <defaultStyles> 
                                        <defaultStyle refStyle="ch"/> 
                                    </defaultStyles> 
                                </style> 
                                <commonClusters><chartNodes><chartNode><chartNodeMembers><chartNodeMember refDataItem="Product type"><chartContents><chartTextItem><dataSource><memberCaption/></dataSource></chartTextItem></chartContents></chartNodeMember></chartNodeMembers></chartNode></chartNodes></commonClusters><conditionalRender refVariable="renderGraph"><renderFor refVariableValue="1"/></conditionalRender></combinationChart> 
                        </contents> 
                    <style><defaultStyles><defaultStyle refStyle="pb"/></defaultStyles></style></pageBody> 
                <style><defaultStyles><defaultStyle refStyle="pg"/></defaultStyles></style></page></reportPages> 
        </layout> 
    </layouts> 
<queries> 
      
      
      
          
    <query name="Prompt"> 
            <source> 
                <model/> 
            </source> 
            <selection><dataItem aggregate="none" name="Product line code" rollupAggregate="none"><expression>[sales_and_marketing].[Products].[Products].[Product line].[Product line - Category Code]</expression></dataItem><dataItem aggregate="none" name="Product line" rollupAggregate="none"><expression>[sales_and_marketing].[Products].[Products].[Product line]</expression></dataItem><dataItem aggregate="total" name="Quantity"><expression>[sales_and_marketing].[Measures].[Quantity]</expression></dataItem><dataItem aggregate="total" name="Revenue"><expression>[sales_and_marketing].[Measures].[Revenue]</expression></dataItem><dataItem aggregate="total" name="Gross profit"><expression>[sales_and_marketing].[Measures].[Gross profit]</expression></dataItem><dataItem aggregate="none" name="Year - Category Code"><expression>[sales_and_marketing].[Time].[Time].[Year].[Year - Category Code]</expression></dataItem><dataItem aggregate="none" name="Year" rollupAggregate="none" sort="ascending"><expression>[sales_and_marketing].[Time].[Time].[Year]</expression></dataItem><dataItem aggregate="none" name="Quarter" rollupAggregate="none"><expression>[sales_and_marketing].[Time].[Time].[Quarter]</expression></dataItem><dataItem aggregate="none" name="Quarter - Category Code" rollupAggregate="none"><expression>[sales_and_marketing].[Time].[Time].[Quarter].[Quarter - Category Code]</expression></dataItem><dataItem name="Time" aggregate="none" rollupAggregate="none"><expression>[sales_and_marketing].[Time].[Time].[Time]-&gt;:[PC].[@MEMBER].[Time]</expression></dataItem></selection> 
        </query><query name="Report"><source><model/></source><selection><dataItem aggregate="total" name="Revenue"><expression>[sales_and_marketing].[Measures].[Revenue]</expression></dataItem><dataItem aggregate="none" name="Product type" rollupAggregate="none"><expression>[sales_and_marketing].[Products].[Products].[Product type]</expression></dataItem></selection><detailFilters><detailFilter><filterExpression>[sales_and_marketing].[Products].[Products].[Product line].[Product line - Category Code] in (?code?)</filterExpression></detailFilter><detailFilter use="optional"><filterExpression>[sales_and_marketing].[Time].[Time].[Quarter].[Quarter - Category Code] in (?Quarter?)</filterExpression></detailFilter></detailFilters></query><query name="Quarters"><source><model/></source><selection><dataItem aggregate="none" name="Quarter - Category Code"><expression>[sales_and_marketing].[Time].[Time].[Quarter].[Quarter - Category Code]</expression></dataItem><dataItem aggregate="none" name="Quarter" sort="ascending"><expression>[sales_and_marketing].[Time].[Time].[Quarter]</expression></dataItem></selection></query></queries><XMLAttributes><XMLAttribute name="RS_CreateExtendedDataItems" output="no" value="false"/><XMLAttribute name="listSeparator" output="no" value=","/><XMLAttribute name="RS_modelModificationTime" output="no" value="2008-07-25T15:28:38.133Z"/></XMLAttributes><reportVariables><reportVariable name="renderGraph" type="boolean"> 
            <reportExpression>ParamValue('code') is not null</reportExpression> 
            <variableValues> 
                <variableValue value="1"/> 
            </variableValues> 
        </reportVariable></reportVariables><reportName>checkbox 2</reportName></report>