//--------------------------------------------------------------
// Report List Element Template
//--------------------------------------------------------------

//------------------------------------
// General Info
//------------------------------------
// This templates generates the report list main frame.
// To minimize HTML size, the template generates calls to JavaScript functions defined in js_reportlist.js.
// These functions generate the requred HTML to display a working report list.
// the main entry-point functions in js_reportlist.js are:
// RD (Report Data) stores the internal data of each report in an array (data that is not shown in report list columns - RID, RepName, IsTextReport...).
// AL generates the requred HTML for each report. The content of the report fields are passed as parameters.
// SF (Set Field) stores information about report fields that are about to be shown in the report list.
// BuildTitlesHTML returns the HTML to display the report list titles.

//------------------------------------
// Adding new fields
//------------------------------------
// If you want to add a regular data fields, that is like Remark or Copies, no template change is required,
// only adding it to wainit.ini and update config server (initialization.exe).
//
// To add new special field with special behavior to the report list,
// you need to follow these steps"
//
// 1. Add to folderandreportlist.txt a component named function.YourFunctionName with
//    an Event.OnClick element (see function.OpenReport, function.ReportLocalSave for examples of how to do it)
//
// 2. Add to folderandreportlist.htm (in the wa_ defintion section) the line
//      'var wa_YourFunctionName = "<!WA function.YourFunctionName>";'
//
// 3. Add a case to the switch in the function AL in js_reportlist.js.
//    Use exiting case examples in this function.
//    Special utility functions such as BuildImageActionHTML are use to build common HTML components.
//    All this function uses the GetActionCall function, which is used to ensure
//    calling SetReportData, before calling the request function.
//    This function (SetReportData) sets report internal data, such as RID, as global JS variables.
//
// How to pass parameters to your function
// 1. If the parameter is a Report data (not a "field") that can be accessed as [Line].YourParam
//    such as [Line].RID, [Line].RepName:
//
//    Such parameters are set as global JS variables before calling request
//    See, EvalAction in js_reportlist.js
//
//    First, check Template (RepData) if it already includes your param
//    If no,
//			a) add your param to the template RepData (in two locations in this template)
//			b) add your param to functions SetRepDataNames and RD in js_reportlist.js
//
//    To pass the parameter to the request use the form
//		YourParam		= (*) Action( VarName([ReportData].YourParam) ) {const}
//
//    For example,
//		RID				= (*) Action( VarName([ReportData].RID) ) {const}
//
//    This guarantees that the correct param name will be used ("rid", ...), and protects you from spelling mistakes and typos.
//
// 2. Special parameters, such as szRulerID. You must care that they are set
//    as global variables in JS
//
//    a) In the request definition, use the form
//		 RulerId		= (*) Action("szRulerID")				  {const}
//
//	  b) when you pass your function name (wa_YouFunction) to the HTML utility function
//       (e.g BuildImageActionHTML or BuildTextFieldHTML), you are in charge
//       of setting your special parameters (e.g. RulerId).
//       The common & easy way to do it is:
//
//		 1) In js_reportlist.js add a helper function that sets your special parameters. For examples, see the functions UF & VC in js_reportlist.js, or the function SetGlobalsForRulerManagment in js_dmenurl.hs
//       2) Prefix a call to this function to the wa_YourFunction string, for string params use BuildStrParam (escaping) for example:
//           szOnClick = "helper_func(" + nNumberParam + "," + BuildStrParam(szStrParam) + ");" + wa_YourFunction
//
//         See the calling to UF, VC function in BuildTextFieldHTML function in js_reportlist.js
//
// 3. Params that are other report fields (for example, see checkedoutby)
//	  a) Treat them as other "special" parameters
//    b) In the specific case in the switch inside the AL function (in js_reportlist.js) you can access fields using GetFieldText(repFields,"checkedoutby")
//
//-----------------------------------------------------------------------------------------------
//--------------------------------------------------------------
// Check whether Report List is empty
//--------------------------------------------------------------
if(eq($Position.TopLine,0) && eq($Position.BottomLine,0))
{
	Begin Component ReportListWindow.List
	Begin Label
			When (ExistsAndEqual($std.origin,"controlm"))
			{
				Label = "document.write(EmptyReportListControlM())"
			}
			else
			{
				Label = "document.write(EmptyReportList())"
				EscapeType = None
			}
		End
	End

	Begin Component SortIsSupported // when report list is empty,
		Begin Label
			Label = "0"
		End
	End

	Begin Component IsRLEmpty
		Begin Label
			label = "true"
			EscapeType = None
		End
	End
}
else
{
	#include "generaltemplate.txt"

	Begin Component IsRLEmpty
		Begin Label
			label = "false"
			EscapeType = None
		End
	End

	ForContext(%User.ReportList.Fields named DisplayTypes)
	{
		Template (IfShowField)
		{
			if (     noteq(VarName([Field]), ConstName{notes})
			     &&  noteq(VarName([Field]), ConstName{indexes})
				 &&  noteq(VarName([Field]), ConstName{logicalviews})
				 &&  noteq(VarName([Field]), ConstName{transformers})
			   )
			{
				Begin Counter IfShowField
					value = 1
				End
			}
			else
			{
				Begin Counter IfShowField
					value = 0
				End
			}
		}
		Template (RLTitles)
		{
			ForEach($ReportListFields.Titles)
			{
				DoTemplate (IfShowField on [] as Field)

				if (eq (Counter.IfShowField(), 1))
				{
					Begin StrVariable FunctionName
						value = "SF"
					End

					DoTemplate (StartFunction)

					DoTemplate (StrParam on [] as Param)
					DoTemplate (StrParam on [].title as Param)
					DoTemplate (IntParam on [].datatype as Param)
					DoTemplate (IntParam on [].col as Param)
					DoTemplate (IntParam on [].width as Param)


					if (eq(VarValue([DisplayTypes], VarName([]), ConstName{updateable}), true) && eq([].IsUpdateable, true))
					{
						DoTemplate (TrueParam)
					}
					else
					{
						DoTemplate (FalseParam)
					}

					DoTemplate (IntParam on [].min as Param)
					DoTemplate (IntParam on [].max as Param)

					DoTemplate (EndFunction)
				}
			}
		}

		Begin Component ReportListWindow.Titles
			DoTemplate(RLTitles)

			Begin Label
				Label = "if(bUseFreezeTitles) document.write(BuildTitlesHTML(true));"
				EscapeType = None
			End
		End

		Template (RepData)
		{
			// !!! Set Report Data in the same order as in the recipient JS functions
			// "SetRepDataNames" and "RD"

			// names
			if (eq(Counter.RepDataMode(), 0))
			{
				Begin StrVariable FunctionName
					value = "SetRepDataNames"
				End

				DoTemplate (StartFunction)
				DoTemplate (VarNameParam on [ReportData].RID as Param)
				DoTemplate (VarNameParam on [ReportData].RepName as Param)
				DoTemplate (VarNameParam on [ReportData].HasNotes as Param)
				DoTemplate (VarNameParam on [ReportData].HasIndexes as Param)
				DoTemplate (VarNameParam on [ReportData].HasRulers as Param)
				DoTemplate (VarNameParam on [ReportData].HasConvertors as Param)
				DoTemplate (VarNameParam on [ReportData].IsActiveTextReport as Param)
				DoTemplate (VarNameParam on [ReportData].TotalPagesSize as Param)
				DoTemplate (VarNameParam on [ReportData].IsCheckedOutAvailable as Param)
				DoTemplate (VarNameParam on [ReportData].CheckedOutByValue as Param)
				DoTemplate (VarNameParam on [ReportData].LocationValue as Param)
				if(exists([ReportData].reporticon.ActiveIcon))
				{
					DoTemplate (VarNameParam on [ReportData].reporticon.ActiveIcon as Param)
				}
				else
				{
					DoTemplate (NullParam)
				}
				if(exists([ReportData].reporticon.ActiveIconHighlight))
				{
					DoTemplate (VarNameParam on [ReportData].reporticon.ActiveIconHighlight as Param)
				}
				else
				{
					DoTemplate (NullParam)
				}
				if(exists([ReportData].reporticon.Icon))
				{
					DoTemplate (VarNameParam on [ReportData].reporticon.Icon as Param)
				}
				else
				{
					DoTemplate (NullParam)
				}
				if(exists([ReportData].reporticon.IconHighlight))
				{
					DoTemplate (VarNameParam on [ReportData].reporticon.IconHighlight as Param)
				}
				else
				{
					DoTemplate (NullParam)
				}
				DoTemplate (VarNameParam on [ReportData].ReportActiveExt as Param)
				DoTemplate (VarNameParam on [ReportData].ReportPageMode as Param)
				DoTemplate (VarNameParam on [ReportData].ReportOrgEncoding as Param)
				DoTemplate (VarNameParam on [ReportData].ReportLanguage as Param)
				DoTemplate (VarNameParam on [ReportData].ReportApprovalStatus as Param)
				DoTemplate (VarNameParam on [ReportData].ReportApprovalName as Param)
				DoTemplate (VarNameParam on [ReportData].HasHistory as Param)
				if(exists([ReportData].copies))
				{
					DoTemplate (VarNameParam on [ReportData].copies as Param)
				}
				else
				{
					DoTemplate (NullParam)
				}
				DoTemplate (VarNameParam on [ReportData].ReportIndexValue as Param)

				DoTemplate (EndFunction)
			}
			// values
			else
			{
				Begin StrVariable FunctionName
					value = "RD"
				End

				DoTemplate (StartFunction)
				DoTemplate (StrParam on [Line].RID as Param)
				//DoTemplate (StrParam on [Line].RepName as Param)
				Begin Label
					Label = "'"
					EscapeType = None
				End
				Begin Label
					Label = [Line].RepName
					EscapeType = JS
				End
				Begin Label
					Label = "  ',"
					EscapeType = None
				End

				DoTemplate (IntParam on [Line].HasNotes as Param)
				DoTemplate (IntParam on [Line].HasIndexes as Param)
				DoTemplate (IntParam on [Line].HasRulers as Param)
				DoTemplate (IntParam on [Line].HasConvertors as Param)
				DoTemplate (IntParam on [Line].IsActiveTextReport as Param)
				DoTemplate (IntParam on [Line].TotalPagesSize as Param)
				DoTemplate (IntParam on [Line].IsCheckedOutAvailable as Param)
				DoTemplate (StrParam on [Line].CheckedOutByValue as Param)
				DoTemplate (StrParam on [Line].LocationValue as Param)
				if(exists([Line].reporticon.ActiveIcon))
				{
					DoTemplate (StrParam on [Line].reporticon.ActiveIcon as Param)
				}
				else
				{
					DoTemplate (EmptyParam)
				}
				if(exists([Line].reporticon.ActiveIconHighlight))
				{
					DoTemplate (StrParam on [Line].reporticon.ActiveIconHighlight as Param)
				}
				else
				{
					DoTemplate (EmptyParam)
				}
				if(exists([Line].reporticon.Icon))
				{
					DoTemplate (StrParam on [Line].reporticon.Icon as Param)
				}
				else
				{
					DoTemplate (EmptyParam)
				}
				if(exists([Line].reporticon.IconHighlight))
				{
					DoTemplate (StrParam on [Line].reporticon.IconHighlight as Param)
				}
				else
				{
					DoTemplate (EmptyParam)
				}

				//DoTemplate (IntParam on Counter.IsForceIndex() as Param)
				Begin Label
					when(!ExistsAndNotEmpty($FilterInfo.index)
						 && eq([Line].HasIndexes, true)
						 && eq(VarValueWhenExists(%user.extentions, [Line].ReportExt, ConstName{forceindex}), true))
					{
						Label = "1,"
					}
					else
					{
						Label = "0,"
					}
					EscapeType = None
				End
				DoTemplate (StrParam on [Line].ReportActiveExt as Param)
				DoTemplate (IntParam on [Line].ReportPageMode as Param)
				DoTemplate (StrParam on [Line].ReportOrgEncoding as Param)
				DoTemplate (StrParam on [Line].ReportLanguage as Param)
				DoTemplate (StrParam on [Line].ReportApprovalStatus as Param)
				DoTemplate (StrParam on [Line].ReportApprovalName as Param)
				DoTemplate (IntParam on [Line].HasHistory as Param)
				if(exists([Line].copies))
				{
					DoTemplate (IntParam on [Line].copies.text as Param)
				}
				else
				{
					DoTemplate (EmptyParam)
				}
				DoTemplate (StrParam on [Line].ReportIndexValue as Param)
				DoTemplate (EndFunction)
			}
		}

		Template(OpenIndexWindow)
		{
			Begin Event.OnClick
				Begin OpenWindow
					TargetWindow		= WindowByName	{const}
					TargetWindowName	= IndexPopup	{const}
					TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=620,height=465" {const}

					Begin Request
						RequestType		= Index			{const}
						SID				= WhenExists($STD.csid, $params.sid)	{const}
						FID				= $Params.FID	{const}
						Lang			= $Params.Lang	{const}
						RID				= (*) Action( VarName([ReportData].RID) ) {const}
						ReportListContext	= $Params.ParamsString	{const}
						ErrorFlowStr		= "onerrorclose.htm"	{const}
						ErrorFlowElem		= "onerrorclose.txt"	{const}

						Begin VariableAttribute u
							
							when(ExistsAndEqual($FilterInfo.Approvals, 1))
							{
								Approval =1
							}
							Audit = true {const}
							when(eq(Counter.ShowLV(), 1))
							{
								ShowLV = (*) Action (VarName([ReportData].HasRulers)) {const}
							}

							when(eq(Counter.ShowTR(), 1))
							{
								ShowTR = (*) Action (VarName([ReportData].HasConvertors)) {const}
							}

							when(ExistsAndNotEmpty($FilterInfo.Index))
							{
								IndexPath = $FilterInfo.Index {const}
							}
							else
							{
								IndexPath =  (*) Action(VarName([ReportData].ReportIndexValue))	{const}
							}

							Force = (*) Action("forceindex") {const} // force window to be opened with index
							Action = StrVariable.ActionForForcedIndex()

							when(eq(Counter.IndexOpenReport(), 1))
							{
								RulerId		= (*) Action("szRulerID")
								ConvertorId	= (*) Action("szTransformerID")
							}
							OrgEncoding =(*) Action (VarName([ReportData].ReportOrgEncoding)) {const}
							Language = (*) Action (VarName([ReportData].ReportLanguage)) {const}
							OutputMode	= (*) Action (VarName([ReportData].ReportPageMode))	{const}
							CanRunActiveX = (*) Action("CanRunActiveX()")
							IsText		= (*) Action(VarName([ReportData].IsActiveTextReport))	{const}
							When(exists(VarName([ReportData].copies)))
							{
								copies = (*) Action(VarName([ReportData].copies))	{const}
							}
							
							an = (*) Action(VarName([ReportData].ReportApprovalName))	{const}
							astatus = (*) Action(VarName([ReportData].ReportApprovalStatus))	{const}
						End
					End
				End
			End
		}

		ForContext ($ReportListFields.Lines."0" named ReportData)
		{
			//----------------------------------------------------------------
			// Specific Fields
			//----------------------------------------------------------------
			Begin Component ReportListWindow.List

				// Start Report List Table
				// Add Report Titles inside table if they would not be freezed or if the browser is NS6
				Begin Label
					Label = "document.write(StartTable());" + NewLine()
							+ "if(!bUseFreezeTitles) document.write(BuildTitlesHTML(false));" + NewLine()
					EscapeType = None
				End

				// Store names of report data that you want to use in JS
				Begin Counter RepDataMode
					value = 0
				End
				DoTemplate (RepData)

				// Per report
				ForEach(Line in $ReportListFields.Lines)
				{
					//===========================================================
					// Set Report Data
					//===========================================================
					Begin Counter RepDataMode
						value = 1
					End
					DoTemplate (RepData)

					//=============================================================
					// Set Report Fields, create HTML
					//=============================================================
					Begin Label
						Label = "document.write(AL("
						EscapeType = None
					End

					ForEach([Line])
					{
						if(exists([].text))
						{
							DoTemplate (IfShowField on [] as Field)

							if (eq (Counter.IfShowField(), 1))
							{
								if (eq(VarName([]), ConstName{ReportIcon}))
								{
									DoTemplate (StrParam on [].activeicon as Param)
								}
								else
								{
									//DoTemplate (StrParam on [].text as Param)
									Begin Label
									Label = "'"
										EscapeType = None
									End
									Begin Label
										Label = [].text
										EscapeType = JS
									End
									Begin Label
										Label = "  ',"
										EscapeType = None
									End
								}
							}
						}

					} // End For each Field in Line

					Begin Label
						Label = "null));" + NewLine()
						EscapeType = None
					End

				} // End ForEach Line

				// need for freeze titles
				Begin Label
					Label = "if(bUseFreezeTitles) document.write(AddRowHTML());" + NewLine()
							+ "document.write(EndTable());"
					EscapeType = None
				End
			End		// ReportListWindow.List

			//=================================================================================
			// Functions that could be called from Report List
			//=================================================================================
			Begin Component function.OpenReport
				Begin Event.OnClick
					when(eq(%User.GeneralSettings.ReportsTarget, 0))
					{
						Precondition = "(window.NoWaitMessage = true)" // assign NoWaitMessage to true, so it will not be displayed, since the report might be opened in an external application, and the wait message will not be hidden.
					}

					Begin OpenWindow
						when(eq(%User.GeneralSettings.ReportsTarget, 1))
						{
							TargetWindow		= WindowByName				{const}
							TargetWindowName	= WA_ReportsWindow			{const}
						}
						else
						{
							when(eq(%User.GeneralSettings.ReportsTarget, 2))
							{
								TargetWindow		= WindowByName			{const}
								TargetWindowName	= (*) Action("GetUniqueWindowName()") {const}
							}
						}

						TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1"	{const}

						Begin Request
							RequestType = Report	{const}
							SID		= WhenExists($STD.csid, $params.sid)	{const}
							FID		= $Params.FID	{const}
							Lang	= $Params.Lang	{const}
							ReportListContext = $Params.ParamsString {const}
							Mode	= INFO		{const}
							CacheKey= DoCache	{const}
							ReportCacheKey	= DoCache {const}
							Audit			= true	{const}
							AuditEventType	= Open	{const}
							// Due to CAR00040891 remove output mode and let Server Interface decide.
							//OutputMode		= (*) Action (VarName([ReportData].ReportPageMode))	{const}

							Index = WhenExists($FilterInfo.Index) {const}

							when(eq(%User.GeneralSettings.ReportsTarget, 0))
							{
								ErrorFlowStr	= "onerrorrlback.htm" {const}
								ErrorFlowElem	= "onerrorrlback.txt" {const}
							}
							else
							{
								ErrorFlowStr	= "onerrorclose.htm" {const}
								ErrorFlowElem	= "onerrorclose.txt" {const}
							}

							RID			= (*) Action( VarName([ReportData].RID) ) {const}

							// These variables are set inside "EvalReportAction" in js_dmenurl.js
							RulerId		= (*) Action("szRulerID")  	{const}
							ConvertorId	= (*) Action("szTransformerID")	{const}
							Begin VariableAttribute u
								an = (*) Action(VarName([ReportData].ReportApprovalName))	{const}
								astatus = (*) Action(VarName([ReportData].ReportApprovalStatus))	{const}
								when(ExistsAndEqual($FilterInfo.Approvals, 1))
								{
									Approval =1
								}
							End
						End
					End
				End
			End

			Begin Component function.OpenReportWithIndexForced
				Begin StrVariable ActionForForcedIndex
					Value = string()
				End

				Begin Counter IndexOpenReport // signal OpenIndexWindow template to use selected RulerId and TransformerId
					Value = 1
				End

				DoTemplate(OpenIndexWindow)

				Begin Counter IndexOpenReport
					Value = 0
				End
			End

			if (eq(VarValue([DisplayTypes], ConstName{localsave.show}),true) || eq(%User.ApplicationFeatures.ReportListSaveFeature.IsChecked, 1))
			{
				Begin Component function.ReportLocalSave
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow			= WindowByName
							TargetWindowName		= "_blank"
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=10,height=10,"	{const}

							// NOTE: if this request changes, the matchin request should also be changed in indexrequest.txt for ForceIndex cases
							Begin Request
								RequestType		= Report					{const}
								ElemTemplate	= "localoperation.txt"
								StrTemplate		= "localoperation.htm"
								ErrorFlowStr	= "onerrorclose.htm"		{const}
								ErrorFlowElem	= "onerrorclose.txt"		{const}
								SID				= WhenExists($STD.csid, $params.sid)				{const}
								FID				= $Params.FID				{const}
								RID				= (*) Action( VarName([ReportData].RID) ) {const}
								Lang			= $Params.Lang				{const}
								Mode			= INFO						{const}
								CacheKey		= DoNotCache				{const}
								ReportCacheKey	= DoNotCache				{const}
								Index			= WhenExists($FilterInfo.Index) {const}
								//OutputMode		= (*) Action(VarName([ReportData].ReportPageMode))	{const}

								// we pass none, so default transformer won't be executed when we get report info.
								// default transformation might be problematic, so we pass none to enable the dialog to be opened.
								ConvertorId		= "none"					{const}

								Begin VariableAttribute u
									Operation = "save"
									Audit = true {const}
									// any addition to the variable attribute should also be reflected in ReportLocalSaveWithIndexForced
									RID				= (*) Action( VarName([ReportData].RID) ) {const}
									ReportName	= (*) Action (VarName([ReportData].RepName))		{const}               
									OrgEncoding 	= (*) Action (VarName([ReportData].ReportOrgEncoding)) 	{const}     
									Language 	= (*) Action (VarName([ReportData].ReportLanguage)) 	{const}           
									                                                                                  
									when (eq(Counter.ShowLV(), 1))                                                    
									{                                                                                 
									ShowLV = (*) Action (VarName([ReportData].HasRulers)) {const}                     
									}                                                                                 
									                                                                                  
									                                                                                  
									Mode		= text		{const}                                                         
									Direction	= Current	{const}                                                       
									                                                                                  
									when(ExistsAndNotEmpty($FilterInfo.index))                                        
									{                                                                                 
									Index = $FilterInfo.Index {const}                                                 
									ShowIND = "0"                                                                     
									}                                                                                 
									else                                                                              
									{                                                                                 
										MaxPages = (*) Action (VarName([ReportData].TotalPagesSize)) {const}              
										                                                                                  
										when(eq(Counter.ShowIndexes(), 1))                                                
										{                                                                                 
											ShowIND = (*) Action(VarName([ReportData].HasIndexes)) {const}                  
										}                                                                                 
										else                                                                              
										{                                                                                 
											ShowIND = "0"                                                                   
										}                                                                                 
									}
									ReportListContext = $Params.ParamsString	{const}                                 
									Force = (*) Action("forceindex") {const} // force window to be opened with index  
									rext	= (*) Action(VarName([ReportData].ReportActiveExt))		{const}
									CanRunActiveX = (*) Action("CanRunActiveX()")
									//OutputMode		= (*) Action(VarName([ReportData].ReportPageMode))	{const}
									
								End
							End
						End
					End
				End

				Begin Component function.ReportLocalSaveWithIndexForced
					Begin StrVariable ActionForForcedIndex
						Value = "LocalSave"
					End

					DoTemplate(OpenIndexWindow)
				End
			}

			if (eq(VarValue([DisplayTypes], ConstName{localmail.show}),true) || eq(%User.ApplicationFeatures.ReportListMailFeature.IsChecked, 1))
			{
				Begin Component function.ReportLocalMail
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow			= WindowByName
							TargetWindowName		= "_blank"
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=0,width=630,height=500,"

							Begin Request
								RequestType	= base				{const}
								ElemTemplate= "mail.txt"	{const}
								StrTemplate	= "mail.htm"	{const}
								ErrorFlowStr	= "onerrorclose.htm"	{const}
								ErrorFlowElem	= "onerrorclose.txt"	{const}
								SID		= WhenExists($STD.csid, $params.sid)			{const}
								FID		= $Params.FID			{const}
								//RID			= (*) Action(VarName([ReportData].RID))	
								Lang	= $Params.Lang			{const}

								Begin VariableAttribute u
									Operation = "mail"

									// These variables must be set in JS before calling to the function
									ReportName	= (*) Action(VarName([ReportData].RepName))				{const}
									RID			= (*) Action(VarName([ReportData].RID))					{const}
									IsText		= (*) Action(VarName([ReportData].IsActiveTextReport))	{const}
									ReportExt	= (*) Action(VarName([ReportData].ReportActiveExt))		{const}
									OrgEncoding = (*) Action(VarName([ReportData].ReportOrgEncoding)) 	{const}
									Language 	= (*) Action(VarName([ReportData].ReportLanguage)) 		{const}
									OutputMode	= (*) Action(VarName([ReportData].ReportPageMode))		{const}

									when (eq(Counter.ShowLV(), 1))
									{
										ShowLV = (*) Action (VarName([ReportData].HasRulers))		{const}
									}

									when (eq(Counter.ShowTR(), 1))
									{
										ShowTR = (*) Action (VarName([ReportData].HasConvertors))	{const}
									}

									when(ExistsAndNotEmpty($FilterInfo.Index))
									{
										Index = $FilterInfo.Index {const}
										ShowIND = "0" {const}
									}
									else
									{
										MaxPages = (*) Action(VarName([ReportData].TotalPagesSize))		{const}
										when(eq(Counter.ShowIndexes(), 1))
										{
											ShowIND = (*) Action(VarName([ReportData].HasIndexes))		{const}
										}
										else
										{
											ShowIND = "0"
										}
									}

									Force = (*) Action("forceindex") {const} // force window to be opened with index
									CanRunActiveX = (*) Action("CanRunActiveX()")
									rname	= (*) Action (VarName([ReportData].RepName))		{const}               
								End
							End
						End
					End
				End
			}

			if (eq(VarValue([DisplayTypes], ConstName{properties.show}),true) || eq(%User.ApplicationFeatures.ReportListPropertiesFeature.IsChecked, true))
			{
				Begin Component function.ReportProperties
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow		= WindowByName		{const}
							TargetWindowName	= PropertiesPopup	{const}
							TargetWindowParameters = "toolbar=0,statusbar=0,menubar=0,resizable=1,scrollbars=1,width=500,height=500" {const}

							Begin Request
								RequestType = ReportListWindow
								SID		= WhenExists($STD.csid, $params.sid)
								FID		= $Params.FID
								Lang	= $Params.Lang
								LastTopRID		= (*) Action (VarName([ReportData].RID))	 {const}
								LastBottomRID	= (*) Action (VarName([ReportData].RID))	 {const}
								StrTemplate		= "reportproperties.htm"
								ElemTemplate	= "reportproperties.txt"
								ErrorFlowStr	= "onerrorclose.htm"
								ErrorFlowElem	= "onerrorclose.txt"
								Direction		= Current
								Mode		= LINES
								CacheKey	= DoNotCache
								ShowMode	= Properties
								MaxLinesRetrive = 1

								Begin VariableAttribute u
									Filter	= $Params.Filter	{const}
									Sort	= $Params.Sort		{const}
									when(notempty($Params.ReportListFields))
									{
										RLF	= $Params.ReportListFields  {const}
									}

									RLTopRID = $Position.TopRID			{const}
									RLBottomRID = $Position.BottomRID	{const}
									ReportName	= (*) Action (VarName([ReportData].RepName)) {const}
									an = (*) Action(VarName([ReportData].ReportApprovalName))	{const}
									astatus = (*) Action(VarName([ReportData].ReportApprovalStatus))	{const}
									iv = (*) Action(VarName([ReportData].ReportIndexValue))	{const}
								End
							End
						End
					End
				End
			}

			Begin Component function.UpdateField
				Begin Event.OnClick
					Begin OpenWindow
						TargetWindow		= WindowByName		{const}
						TargetWindowName	= UpdateField		{const}
						TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=330,height=150"	{const}

						Begin Request
							RequestType		= Base					{const}
							StrTemplate 	= "updatewindow.htm"	{const}
							ElemTemplate	= "updatewindow.txt"	{const}
							ErrorFlowStr	= "onerrorclose.htm"	{const}
							ErrorFlowElem	= "onerrorclose.txt"	{const}
							Lang			= $Params.Lang			{const}

							Begin VariableAttribute u
								SID		= WhenExists($STD.csid, $params.sid)	{const}
								FID		= $Params.FID	{const}
								Lang	= $Params.Lang	{const}

								//--------------------
								//Report List state
								//--------------------
								Filter	= $Params.Filter	{const}
								Sort	= $Params.Sort		{const}
								LastTopRID		= $Position.TopRID		{const}
								LastBottomRID	= $Position.BottomRID	{const}

								when(notempty($Params.ReportListFields))
								{
									RLF = $Params.ReportListFields				{const}
								}

								RID		= (*) Action(VarName([ReportData].RID)) {const}

								//-------------------
								// Field Data
								//-------------------
								// These variables are set inside "UF" in js_reportlist.js
								Title	= (*) Action("szFieldTitle")	{const}
								Name	= (*) Action("szFieldName")	{const}
								Value	= (*) Action("szFieldText")	{const}
								Type	= (*) Action("nFieldType")	{const}
								Min	= (*) Action("nFieldMin")	{const}
								Max	= (*) Action("nFieldMax")	{const}
								cp = (*) Action("MainRLWindow.wa_CurrentPageInReportList")
							End
						End
					End
				End
			End

			if (eq(%User.ApplicationFeatures.ReportListNoteFeature.IsChecked, 1)) //(eq(VarValue([DisplayTypes], ConstName{notes.show}),true))
			{
				Begin Component function.NoteList
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow		= WindowByName	{const}
							TargetWindowName	= NotePopup		{const}
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=640,height=480" {const}

							Begin Request
								RequestType		= NoteListWindow	{const}
								SID				= WhenExists($STD.csid, $params.sid)		{const}
								FID				= $Params.FID		{const}
								Lang			= $Params.Lang		{const}

								Mode			= LIST				{const}
								CacheKey		= DoCache			{const}

								ErrorFlowStr	= "onerrorclose.htm"{const}
								ErrorFlowElem	= "onerrorclose.txt"{const}

								RID			= (*) Action (VarName([ReportData].RID))

								Begin VariableAttribute ReportContext
									ReportListContext = $Params.ParamsString {const}
									Index = WhenExists($FilterInfo.Index)    {const}
								End

								Begin VariableAttribute u
									ReportName	= (*) Action (VarName([ReportData].RepName)) {const}

									RefreshWhat = ReportList	{const}

									//--------------------
									// Report List state
									//--------------------
									Filter	= $params.Filter	{const}
									Sort	= $Params.Sort		{const}
									LastTopRID		= $Position.TopRID		{const}
									LastBottomRID	= $position.BottomRID	{const}
									OpenTagNoteTab = false {const}
									Audit = true {const}
									when(ExistsAndEqual($FilterInfo.Approvals, 1))
									{
										Approval =1
									}
						
									OutputMode	= (*) Action (VarName([ReportData].ReportPageMode))	{const}
									cp = (*) Action("MainRLWindow.wa_CurrentPageInReportList")
									When(exists(VarName([ReportData].copies)))
									{
										copies = (*) Action(VarName([ReportData].copies))	{const}
									}
									an = (*) Action(VarName([ReportData].ReportApprovalName))	{const}
									astatus = (*) Action(VarName([ReportData].ReportApprovalStatus))	{const}
								End
							End
						End
					End
				End
			}

			if (eq(%User.ApplicationFeatures.ReportListIndexFeature.IsChecked, 1))
			{
				Begin Component function.IndexList
					Begin StrVariable ActionForForcedIndex
						Value = string()
					End

					DoTemplate(OpenIndexWindow)
				End
			}

			if (eq(%User.ApplicationFeatures.ReportListLocalPrintFeature.IsChecked, 1) || eq(%User.ApplicationFeatures.ReportListLocalPrintAsFeature.IsChecked, 1))
			{
				Begin Component function.ReportLocalPrint
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow			= WindowByName
							TargetWindowName		= "_blank"
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=10,height=10,"	{const}

							// NOTE: if this request changes, the matchin request should also be changed in indexrequest.txt for ForceIndex cases
							Begin Request
								RequestType		= Report				{const}
								ErrorFlowStr	= "onerrorclose.htm"	{const}
								ErrorFlowElem	= "onerrorclose.txt"	{const}
								ElemTemplate	= "localoperation.txt"
								StrTemplate		= "localoperation.htm"
								SID		= WhenExists($STD.csid, $params.sid)	{const}
								FID		= $Params.FID	{const}
								Lang	= $Params.Lang	{const}
								Mode	= INFO			{const}
								CacheKey		= DoNotCache	{const}
								ReportCacheKey	= DoNotCache	{const}
								Index	= WhenExists($FilterInfo.Index)	{const}
								RID		= (*) Action(VarName([ReportData].RID)) {const}
								ConvertorId	= (*) Action("GetTransformerForLocalPrint()") {const}
								OutputMode	= (*) Action(VarName([ReportData].ReportPageMode)) {const}

								Begin VariableAttribute u
									Operation = "print"
									Audit = true 				{const}
									OrgEncoding =(*) Action (VarName([ReportData].ReportOrgEncoding)) {const}
									Language = (*) Action (VarName([ReportData].ReportLanguage)) {const}
									// any addition to the variable attribute should also be reflected in ReportLocalPrintWithIndexForced
									RID				= (*) Action( VarName([ReportData].RID) ) {const}
									ReportName	= (*) Action (VarName([ReportData].RepName))		{const}               
									OrgEncoding 	= (*) Action (VarName([ReportData].ReportOrgEncoding)) 	{const}     
									when (eq(Counter.ShowLV(), 1))                                                    
									{                                                                                 
									ShowLV = (*) Action (VarName([ReportData].HasRulers)) {const}                     
									}                                                                                 
									IsText		= (*) Action(VarName([ReportData].IsActiveTextReport)) {const}                                                         
									Direction	= Current	{const}                                                       
									                                                                                  
									when(ExistsAndNotEmpty($FilterInfo.index))                                        
									{                                                                                 
									Index = $FilterInfo.Index {const}                                                 
									ShowIND = "0"                                                                     
									}                                                                                 
									else                                                                              
									{                                                                                 
										MaxPages = (*) Action (VarName([ReportData].TotalPagesSize)) {const}              
										                                                                                  
										when(eq(Counter.ShowIndexes(), 1))                                                
										{                                                                                 
											ShowIND = (*) Action(VarName([ReportData].HasIndexes)) {const}                  
										}                                                                                 
										else                                                                              
										{                                                                                 
											ShowIND = "0"                                                                   
										}                                                                                 
									}
									ReportListContext = $Params.ParamsString	{const}                                 
									Force = (*) Action("forceindex") {const} // force window to be opened with index  
									ConvertorId	= (*) Action("GetTransformerForLocalPrint()") {const}
									ReportExt	= (*) Action(VarName([ReportData].ReportActiveExt))		{const}
									CanRunActiveX = (*) Action("CanRunActiveX()")
								End
							End
						End
					End
				End

				Begin Component function.ReportLocalPrintWithIndexForced
					Begin StrVariable ActionForForcedIndex
						Value = "LocalPrint"
					End

					DoTemplate(OpenIndexWindow)
				End
			}
			if (eq(%User.ApplicationFeatures.ReportListPreparePrintFeature.IsChecked, 1))
			{
				Begin Component function.PrepareToPrint
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow 		= WindowByName			{const}
							TargetWindowName 	= PrepareToPrintPopup	{const}
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=630,height=410" {const}

							Begin Request
								RequestType		= report					{const}
								ErrorFlowStr	= "onerrorclose.htm"	{const}
								ErrorFlowElem	= "onerrorclose.txt"	{const}
								StrTemplate 	= "prepare.htm"			{const}
								ElemTemplate	= "prepare.txt"			{const}
								NoBrowserCache	= false {const} // With NoBrowserCache we have problem in Netscape4.7 when resize the window, that has aplet (Index)

								// Need for correct IsSupport checking
								SID		= WhenExists($STD.csid, $params.sid)		{const}
								FID		= $Params.FID		{const}
								RID			= (*) Action (VarName([ReportData].RID))			{const}
								SubId	= $Params.SubID		{const}
								Lang	= $Params.Lang		{const}

								Begin VariableAttribute u
									//--------------------
									// Report Data
									//--------------------
									RID			= (*) Action (VarName([ReportData].RID))			{const}
									ReportName	= (*) Action (VarName([ReportData].RepName))		{const}
									OrgEncoding 	= (*) Action (VarName([ReportData].ReportOrgEncoding)) 	{const}
									Language 	= (*) Action (VarName([ReportData].ReportLanguage)) 	{const}

									when (eq(Counter.ShowLV(), 1))
									{
										ShowLV = (*) Action (VarName([ReportData].HasRulers)) {const}
									}


									Mode		= text		{const}
									Direction	= Current	{const}

									when(ExistsAndNotEmpty($FilterInfo.index))
									{
										Index = $FilterInfo.Index {const}
										ShowIND = "0"
									}
									else
									{
										MaxPages = (*) Action (VarName([ReportData].TotalPagesSize)) {const}

										when(eq(Counter.ShowIndexes(), 1))
										{
											ShowIND = (*) Action(VarName([ReportData].HasIndexes)) {const}
										}
										else
										{
											ShowIND = "0"
										}
									}

									ReportListContext = $Params.ParamsString	{const}
									Force = (*) Action("forceindex") {const} // force window to be opened with index
									hasnotes = (*) Action (VarName([ReportData].HasNotes)) 	{const}
								End
							End
						End
					End
				End
			}
			if (eq(counter.HostPrintSupported(), 1) && eq(%User.ApplicationFeatures.ReportListRemotePrintFeature.IsChecked, 1)  )
			{
					Begin Component function.HostPrint
						Begin Event.OnClick
							//------------------------
							// For default print
							//
							// Comment out the
							//	StrTemplate 	= "remoteprintmf.htm"
							//	ElemTemplate	= "remoteprintmf.txt"
							//-----------------------
							//------------------------
							// For MF print
							//-----------------------
							Begin OpenWindow
								TargetWindow 		= WindowByName		{const}
								TargetWindowName 	= RemotePrintPopup	{const}
								TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=1000,height=600"	{const}

								Begin Request
									RequestType	= RemotePrintParams	{const}
									SID 		= WhenExists($STD.csid, $params.sid)		{const}
									FID			= $Params.FID		{const}
									Lang		= $Params.Lang		{const}
									RID			= (*) Action (VarName([ReportData].RID)) {const}
									ErrorFlowStr	= "onerrorclose.htm"	{const}
									ErrorFlowElem	= "onerrorclose.txt"	{const}
									StrTemplate		= "remoteprintmf.htm"	{const}
									ElemTemplate	= "remoteprintmf.txt"	{const}
									NoBrowserCache	= false {const} // With NoBrowserCache we have problem in Netscape4.7 when resize the window, that has aplet (Index)
									IndexPath		= WhenExists($FilterInfo.Index) {const}

									Begin VariableAttribute u
										when(ExistsAndNotEmpty($FilterInfo.Index))
										{
											HasIndexes	= "false"
										}
										else
										{
											HasIndexes	= (*) Action (VarName([ReportData].HasIndexes)) 	{const}
										}
										ReportName 	= (*) Action (VarName([ReportData].RepName)) 		{const}
										OrgEncoding = (*) Action (VarName([ReportData].ReportOrgEncoding)) 	{const}
										Language 	= (*) Action (VarName([ReportData].ReportLanguage)) 	{const}
										Audit = true	{const}
										Force = (*) Action("forceindex") {const} // force window to be opened with index
									End
								End
							End

						End
					End
			}
	
			// Subscription
			if (ExistsAndEqual($Info.IsSupported.subscription, 1) && eq(%User.ApplicationFeatures.ReportSubscriptionFeature.IsChecked, 1)  )
			{
				Begin Component function.Subscription
						Begin Event.OnClick
							Begin OpenWindow
										TargetWindow 		= WindowByName		{const}
										TargetWindowName 	= SubscriptionPopup	{const}
										TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=630,height=700"	{const}
		
										Begin Request
											RequestType	= RemotePrintParams	{const}
											SID 		= WhenExists($STD.csid, $params.sid)		{const}
											FID			= $Params.FID		{const}
											Lang		= $Params.Lang		{const}
											RID			= (*) Action (VarName([ReportData].RID)) {const}
											ErrorFlowStr	= "onerrorclose.htm"	{const}
											ErrorFlowElem	= "onerrorclose.txt"	{const}
											StrTemplate		= "subscription.htm"	{const}
											ElemTemplate	= "subscription.txt"	{const}
											NoBrowserCache	= false {const} // With NoBrowserCache we have problem in Netscape4.7 when resize the window, that has aplet (Index)
											IndexPath		= WhenExists($FilterInfo.Index) {const}
											subscription = "1"
											Email = (*) Action("subscriptionEmail") {const} 
		
											Begin VariableAttribute u
												when(ExistsAndNotEmpty($FilterInfo.Index))
												{
													HasIndexes	= "false"
												}
												else
												{
													HasIndexes	= (*) Action (VarName([ReportData].HasIndexes)) 	{const}
												}
												ReportName 	= (*) Action (VarName([ReportData].RepName)) 		{const}
												OrgEncoding = (*) Action (VarName([ReportData].ReportOrgEncoding)) 	{const}
												Language 	= (*) Action (VarName([ReportData].ReportLanguage)) 	{const}
												Audit = true	{const}
												Force = (*) Action("forceindex") {const} // force window to be opened with index
											End
											
										End
									End
								End
					End
			}
		
			//-------------------------------------------------------------------
			//  APPROVALS
			//-------------------------------------------------------------------
			
			if (eq(counter.ApprovalSupported(), 1) && eq(%User.ApplicationFeatures.ApprovalsAdd.IsChecked, 1)  )
			{
				Begin Component function.AddReportToApprovals
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow			= WindowByName
							TargetWindowName	= ApprovalActionPopup	{const}
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,width=330,height=250"

							Begin Request
								RequestType	= Base				{const}
								ElemTemplate= "approvalaction.txt"	{const}
								StrTemplate	= "approvalaction.htm"	{const}
								ErrorFlowStr	= "onerrorclose.htm"	{const}
								ErrorFlowElem	= "onerrorclose.txt"	{const}
								SID		= WhenExists($STD.csid, $params.sid)			{const}
								FID		= $Params.FID			{const}
								Lang	= $Params.Lang			{const}

								Begin VariableAttribute u
									Action = "add"
									// These variables must be set in JS before calling to the function
									ReportName	= (*) Action(VarName([ReportData].RepName))				{const}
									RID			= (*) Action(VarName([ReportData].RID))					{const}
									//--------------------
									//Report List state
									//--------------------
									Filter	= $Params.Filter	{const}
									Sort	= $Params.Sort		{const}
									LastTopRID		= $Position.TopRID		{const}
									LastBottomRID	= $Position.BottomRID	{const}
	
									when(notempty($Params.ReportListFields))
									{
										RLF = $Params.ReportListFields				{const}
									}

								End
							End
						End
					End
				End
			}
		
			if (eq(counter.ApprovalSupported(), 1) && eq(%User.ApplicationFeatures.ApprovalsHistory.IsChecked, 1)  )
			{
				Begin Component function.History
					Begin Event.OnClick
						Begin OpenWindow
							TargetWindow			= WindowByName
							TargetWindowName	= HistoryPopup	{const}
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=1,scrollbars=1,width=800,height=500"

							Begin Request
								RequestType	= ApprovalHistory				{const}
								ElemTemplate= "approvalhistory.txt"	{const}
								StrTemplate	= "approvalhistory.htm"	{const}
								ErrorFlowStr	= "onerrorclose.htm"	{const}
								ErrorFlowElem	= "onerrorclose.txt"	{const}
								SID		= WhenExists($STD.csid, $params.sid)			{const}
								FID		= $Params.FID			{const}
								Lang	= $Params.Lang			{const}
								RID			= (*) Action(VarName([ReportData].RID))					{const}
								Begin VariableAttribute u
									ReportName = (*) Action(VarName([ReportData].RepName))				{const}
								End
							End
						End
					End
				End
			}
		
			//------------------------
			// Ruler management
			//------------------------
			if(ExistsAndEqual($Info.IsSupported.RulerManagement, true))
			{
				Template (EditLogicalView)
				{
					if(IsRequestExists(LogicalViewText))
					{
								Begin Strvariable encoding
										value = "{!WA Common.Charset}"
								End
								Begin Strvariable encoding
									When(noteq(find(Strvariable.encoding(),">"),NotFound()))
									{
										value = substring(Strvariable.encoding(),0,find(Strvariable.encoding(),">"))
									}
								End
						
								Begin Request
									RequestType		= Base						{const}
									SID				= WhenExists($STD.csid, $params.sid)				{const}
									FID				= $Params.FID				{const}
									StrTemplate		= "logicalvieweditor.htm"	{const}
									ElemTemplate	= "logicalvieweditor.txt"	{const}
									ErrorFlowStr	= "onerrorback.htm"		{const}
									ErrorFlowElem	= "onerrorback.txt"		{const}
									Lang			= $Params.Lang				{const}

									Begin VariableAttribute u
										operation = "logicalview" {const}
										encoding = Strvariable.encoding()
										baseUrl =  (*) Action ("GetBaseUrl()") {const}
										location = (*) Action ("location.href.split('?')[0]") {const}
										RID			= (*) Action (VarName([ReportData].RID))		{const}
										ReportName	= (*) Action (VarName([ReportData].RepName))	{const}

										when(ExistsAndNotEmpty($FilterInfo.Index))
										{
											Index = $FilterInfo.Index {const}
										}

										// These variables are set inside "SetGlobalsForRulerManagment" in js_dmenurl.js
										RulerID		= (*) Action ("szRulerID")		{const}
										RulerName	= (*) Action ("szRulerName")	{const}
										ProxyAddress = %User.GeneralSettings.ProxyAddress
										ProxyPort = String(%User.GeneralSettings.ProxyPort)
										CharSet = "{!WA lang.CharSet}"
										DisplayFont = "{!WA lang.DisplayFont}"
										EditFont = "{!WA lang.EditFont}"
										UIFont = "{!WA lang.UIFont}"
										HelpDir = "{!WA Common.HelpDir}"
										Language = "{!WA lang.LangName}"
										DParamDisplayName = "yes"
										when( eq($Info.IsSupported.PrivateLV,0) )
										{
											IsPrivateLVSupported = "false"
										}
										else
										{
											IsPrivateLVSupported = "true"
										}
										WAVersion = $Params.Version
										when(eq(%User.Applicationfeatures.Helpfeature.ischecked , 0) )
										{
											label = "false"
										}
										else
										{
											label = "true"
										}
										when (ExistsAndEqual(%User.Applicationfeatures.Helpfeature.ischecked, "1"))
										{
											showHelp = "true"
										}
										else
										{
											showHelp = "false"
										}
									End
						End
					}
				}

				Template (LogicalViewManagement)
				{
					Begin Event.OnClick

						Begin OpenWindow
							TargetWindow		= WindowByName						{const}
							TargetWindowName	= StrVariable.TargetWindowName()
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=0,width=425,height=" + StrVariable.HeightWnd()

							Begin Request
								RequestType	= Base			{const}
								SID			= WhenExists($STD.csid, $params.sid)	{const}
								FID			= $Params.FID	{const}
								Lang		= $Params.Lang	{const}
								SubId		= $Params.SubID	{const}
								StrTemplate		= "rulermanagement.htm"	{const}
								ElemTemplate	= "rulermanagement.txt"	{const}
								ErrorFlowStr	= "onerrorclose.htm"	{const}
								ErrorFlowElem	= "onerrorclose.txt"	{const}

								Begin VariableAttribute u
									Mode		= StrVariable.Mode()
									RID		= (*) Action (VarName([ReportData].RID)) {const}

									// These variables are set inside "SetGlobalsForRulerManagment" in js_dmenurl.js
									RulerId		= (*) Action ("szRulerID")		{const}
									RulerName	= (*) Action ("szRulerName")	{const}
									IsRulerPublic	= (*) Action ("bIsPublic")	{const}
									RulerReportNameMask = (*) Action ("szRulerReportNameMask")	{const}
								End
							End
						End
					End
				}

				//--------------------------------------------------------------
				// CreateRuler
				//--------------------------------------------------------------
				if(eq(%User.ApplicationFeatures.ReportListLVManagmentCreateFeature.IsChecked, 1))
				{
					Begin Component function.CreateRuler
						DoTemplate (EditLogicalView)
					End
				}

				//--------------------------------------------------------------
				// EditRuler
				//--------------------------------------------------------------
				if(eq(%User.ApplicationFeatures.ReportListLVManagmentEditFeature.IsChecked, 1))
				{
					Begin Component function.EditRuler

							DoTemplate (EditLogicalView)
					End
				}

				//--------------------------------------------------------------
				// RenameRuler
				//--------------------------------------------------------------
				if(eq(%User.ApplicationFeatures.ReportListLVManagmentRenameFeature.IsChecked, 1))
				{
					Begin Component function.RenameRuler

						Begin StrVariable TargetWindowName
							value = "RenameRulerPopup"
						End

						Begin StrVariable Mode
							value = "Rename"
						End

						Begin StrVariable HeightWnd
							when(eq($Info.IsSupported.PrivateLV, true) )
							{
								value = "155"
							}
							else
							{
								value="100"
							}
						End

						DoTemplate (LogicalViewManagement)
					End
				}

				//--------------------------------------------------------------
				// DeleteRuler
				//--------------------------------------------------------------
				if(eq(%User.ApplicationFeatures.ReportListLVManagmentDeleteFeature.IsChecked, 1))
				{
					Begin Component function.DeleteRuler

						Begin StrVariable TargetWindowName
							value = "DeleteRulerPopup"
						End

						Begin StrVariable Mode
							value = "Delete"
						End

						Begin StrVariable HeightWnd
							value="100"
						End

						DoTemplate(LogicalViewManagement)
					End
				}
			}

			//===============================================================
			// Create document
			//===============================================================
			 //when filter for all subfolders is applied CreateDocumentSupported is 0 for ROOT
			 if(eq(counter.CreateDocumentSupported(), 1) || exists($ReportListFields.Titles.ischeckedout) && eq(%User.ApplicationFeatures.ReportManagementVersionControlFeature.IsChecked, 1))
			{
				if (eq(VarValue([DisplayTypes], ConstName{ischeckedout.show}),true))
				{
					Begin Component function.VersionControl
						Begin Event.OnClick
							Begin OpenWindow
								TargetWindow		= WindowByName			{const}
								TargetWindowName	= VersionControlPopup	{const}
								TargetWindowParameters = "toolbar=0,statusbar=0,menubar=0,resizable=1,width=450,height=250" {const}

								Begin Request
									RequestType		= Base					{const}
									StrTemplate		= "versioncontrol.htm"	{const}
									ElemTemplate	= "versioncontrol.txt"	{const}
									ErrorFlowStr	= "onerrorclose.htm"	{const}
									ErrorFlowElem	= "onerrorclose.txt"	{const}

									SID		= WhenExists($STD.csid, $params.sid)	{const}
									FID		= $Params.FID	{const}
									Lang	= $Params.Lang	{const}

									Begin VariableAttribute u
										SubId = String()			{const}
										Filter	= $Params.Filter	{const}
										Sort	= $Params.Sort		{const}
										LastTopRID		= $Position.TopRID				{const}
										LastBottomRID	= $Position.BottomRID			{const}
										Direction		= $Params.Direction				{const}

										RID	= (*) Action (VarName([ReportData].RID))	{const}
										ReportName = (*) Action (VarName([ReportData].RepName))	{const}

										// these variables are set inside "VC" function in js_reportlist.js
										IsCheckedOut = (*) Action ("IsCheckedOut") {const}
										CheckedOutBy = (*) Action ("CheckedOutBy") {const}
									End
								End
							End
						End
					End
				}
			}
			//===============================================================
			// REPORT EDITMENU
			//===============================================================
			if( eq(counter.CreateDocumentSupported(), 1) || eq(counter.UpdateDocumentSupported(), 1) )
			{
				Template (ReportManagment)
				{
					Begin Event.OnClick
						Begin	OpenWindow
							TargetWindow		= WindowByName		{const}
							TargetWindowName	= StrVariable.Mode() + "ReportPopup"
							TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=0,width=510,height=" + StrVariable.WindowHeight()

							Begin Request
								RequestType		= Base						{const}
								Lang			= $Params.Lang				{const}
								StrTemplate		= "reportmanagement.htm"	{const}
								ElemTemplate	= "reportmanagement.txt"	{const}
								ErrorFlowStr	= "onerrorclose.htm"		{const}
								ErrorFlowElem	= "onerrorclose.txt"		{const}
								SID			= WhenExists($STD.csid, $params.sid)			{const}
								FID			= $Params.FID			{const}
								SubId		= $Params.SubID			{const}

								Begin VariableAttribute u
									Mode    = StrVariable.Mode()
									Filter	= $Params.Filter		{const}
									Sort = $Params.Sort				{const}
									RID		= (*) Action (VarName([ReportData].RID)) {const}
									Name	= (*) Action (VarName([ReportData].RepName)) {const}
								End
							End
						End
					End
				}

				if(eq(counter.UpdateDocumentSupported(), 1))
				{
					if(eq(%User.ApplicationFeatures.ReportManagementRenameFeature.IsChecked, 1) && noteq(counter.HostPrintSupported(), 1) ) // Bypass: Rename is not supported on Mainframe, so we test for Host Print. We actually need an explicit IsSupported for Rename.
					{
						Begin Component function.RenameReport
							Begin StrVariable WindowHeight
								value = "130"
							End

							Begin StrVariable Mode
								value = "Rename"
							End

							DoTemplate (ReportManagment)
						End
					}

					if(eq(%User.ApplicationFeatures.ReportManagementMoveFeature.IsChecked, 1))
					{
						Begin Component function.MoveReport
							Begin StrVariable WindowHeight
								value = "330"
							End


							Begin StrVariable Mode
								value = "Move"
							End

							DoTemplate (ReportManagment)
						End
					}

					if(eq(%User.ApplicationFeatures.ReportManagementCopyFeature.IsChecked, 1))
					{
						Begin Component function.CopyReport
							Begin StrVariable WindowHeight
								value = "330"
							End

							Begin StrVariable Mode
								value = "Copy"
							End

							DoTemplate (ReportManagment)
						End
					}

					if(eq(%User.ApplicationFeatures.ReportManagementDeleteFeature.IsChecked, 1))
					{
						Begin Component function.DeleteReport
							Begin StrVariable WindowHeight
								value = "130"
							End

							Begin StrVariable Mode
								value = "Delete"
							End

							DoTemplate (ReportManagment)
						End
					}
				}
			}

			if (eq(%User.ApplicationFeatures.ReportListLVFeature.IsChecked, 1))
			{
				Begin Component RequestQSRulerList
					Begin Counter ShowExportDefinitionIcons
						value = %User.GeneralSettings.ShowExportDefinitionIcons
					End

					Begin QueryString
						Begin Request
							RequestType = RulerList		{const}
							SID		= WhenExists($STD.csid, $params.sid)		{const}
							SUBID	= $Params.SubID		{const}
							FID		= $Params.FID		{const}
							Lang	= $Params.Lang		{const}
							RID		= (*) Action(VarName([ReportData].RID)) {const}
							ShowExportDefinitionIcons = Counter.ShowExportDefinitionIcons() {const}
							nobrowsercache = true

							Begin VariableAttribute u
								ReportRow =  (*) Action("nReportRow") {const}
								ReportListContext = $Params.ParamsString {const}
								CreateLV = String()	{const}
							End
						End
					End
				End

				if(eq(Counter.ShowExportDefinitionIcons(), 0))
				{
					//===================================================
					// QueryString to ask ruler info
					// szRulerID - set before eval
					//===================================================
					Begin Component RequestQSRulerInfo
						Begin QueryString
							Begin Request
								RequestType = RulerList			{const}
								SID		= WhenExists($STD.csid, $params.sid)			{const}
								SUBID	= $Params.SubID			{const}
								FID		= $Params.FID			{const}
								Lang	= $Params.Lang			{const}
								RID		= (*) Action(VarName([ReportData].RID))	{const}
								MODE	= INFO					{const}
								RulerId	= (*) Action("szRulerID") {const}
								strtemplate = "rulerinfo.htm"	{const}
								elemtemplate = "rulerinfo.txt"	{const}
							End
						End
					End
				}
			}

			if (eq(%User.ApplicationFeatures.ReportListTransformersFeature.IsChecked, 1))
			{
				Begin Component RequestQSTransformerList
					Begin QueryString
						Begin Request
							RequestType = TransformerList		{const}
							SID		= WhenExists($STD.csid, $params.sid)				{const}
							SUBID	= $Params.SubID				{const}
							FID		= $Params.FID				{const}
							RID		= (*) Action(VarName([ReportData].RID))	{const}
							Lang	= $Params.Lang				{const}

							Begin VariableAttribute u
								ReportListContext = $Params.ParamsString {const}
								// OutputMode = Auto (defualt) or Page or Document {const}
							End
						End
					End
				End
			}
		}
	}

	Begin Component FreezeTitles
		Begin Label
			label = String(Counter.FreezeTitles())
		End
	End

	Begin Component VisitedRID
		if (exists($UserData.RID) && notempty($UserData.RID))
		{
			Begin Label
				label = $UserData.RID
			End
		}
	End

	Begin Component SortIsSupported
		Begin Label
			when (ExistsAndEqual($Info.IsSupported.Sorting, true) && eq(%User.ApplicationFeatures.sortfeature.IsChecked, 1) )
			{
				Label = "1"
			}
			else
			{
				Label = "0"
			}
		End
	End
}

//---------------------------------------------------------------
// Version Component
//---------------------------------------------------------------
Begin Component ReportListWindow.Version
	Begin Label
		label = "{!WA Rl.Version} " + $Params.Version
	End
End

//===========================================================
// Url for getting Report List with all screen parts
// ==========================================================
Begin Component ReportListScreenPartsUrl

	Begin Url
		Begin Request
			RequestType = ReportListWindow
			ElemTemplate= "folderscreenparts.txt"
			Mode		= None
			CacheKey	= DoNotCache
			Lang			= $Params.Lang
			Sort			= $Params.Sort
			ReportListFields = $Params.ReportListFields
			FID				= $Params.FID
			ElemTemplate	= "folderscreenparts.txt"
			StrTemplate		= "wascreenparts.htm"
			NoBrowserCache	= 0
			Filter			= $Params.filter
			LastTopRID		= $Params.LastTopRID
			LastBottomRID	= $Params.LastBottomRID
			Direction		= $Params.Direction
			when(exists($std.gtc))
			{
				gettotalcount = $std.gtc 
			}


			Begin VariableAttribute u
				SID = WhenExists($STD.csid, $params.sid)
				WSF = $Info.IsSupported.WithSubfolders

				ForEach(attr in $UserData)
				{
					if(noteq(VarName([attr]), SID) && noteq(VarName([attr]), WSF)) // we also don't need WithSubFolder setting
					{
						Begin Attribute
							name = VarName([attr])
							value = [attr]
						End
					}
				}
			End
		End
	End
End

Begin Component	ProgramName
	Begin Label
		label = $Params.Directory
	End
End

//------------------------------------------------------------------
// Support for Refreshing only main area
//------------------------------------------------------------------

// Parameters that can be changed by user

Begin Component SID
	Begin Label
		Label = WhenExists($STD.csid, $params.sid)
		EscapeType = JS
	End
End

Begin Component FID
	Begin Label
		Label = $Params.FID
		EscapeType = JS
	End
End

Begin Component OrgFID
	Begin Label
		Label = $Params.FID
		EscapeType = JS
	End
End

Begin Component FIDWithoutSubFolders
	Begin Label
		Label = GetFolderIdWithoutSubfolders($Params.FID)
		EscapeType = JS
	End
End

Begin Component FolderName
	Begin Label
		Label = $Info.FolderName
		EscapeType = JS
	End
End

Begin Component Filter
	Begin Label
		Label = $Params.Filter
		EscapeType = JS
	End
End

Begin Component Sort
	Begin Label
		Label = $Params.Sort
		EscapeType = JS
	End
End



Begin Component LastTopRID
	Begin Label
		Label = $Params.LastTopRID
		EscapeType = JS
	End
End

Begin Component LastBottomRID
	Begin Label
		Label = $Params.LastBottomRID
		EscapeType = JS
	End
End

Begin Component Direction
	Begin Label
		Label = $Params.Direction
		EscapeType = JS
	End
End

Begin Component ReportListFields
	Begin Label
		Label = $Params.ReportListFields
		EscapeType = JS
	End
End

Begin Component ParamsString
	Begin Label
		Label = $Params.ParamsString
		EscapeType = JS
	End
End

Begin Component AvailableDirections
	Begin Label
		Label = String($Directions.AvailableTop) + "," + String($Directions.AvailablePrev) + "," + String($Directions.AvailableNext) + "," + String($Directions.AvailableBottom)
		EscapeType = JS
	End
End

Begin Component PositionTopRID
	Begin Label
		Label = $Position.TopRID
		EscapeType = JS
	End
End

Begin Component PositionBottomRID
	Begin Label
		Label = $Position.BottomRID
		EscapeType = JS
	End
End

Begin Component ShowCancelFilter
	Begin Label
		when(eq(%User.ApplicationFeatures.CancelFilterFeature.IsChecked, 1))
		{
			Label = "1"
		}
		else
		{
			Label = "0"
		}
	End
End

Begin Component CreateDocumentIsSupported
	Begin Label
		when (eq(%User.ApplicationFeatures.ReportManagementCreateFeature.IsChecked, 1) && ExistsAndEqual($Info.IsSupported.CreateDocument, true))
		{
			Label = "1"
		}
		else
		{
			Label = "0"
		}
	End
End

Begin Component FolderManagementIsSupported
	Begin Label
		when( ExistsAndEqual($Info.IsSupported.FolderManagement, true))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
	End
End


Begin Component SortDescription
	if (eq(%User.ApplicationFeatures.sortfeature.IsChecked, 1)  &&  ExistsAndEqual($Info.IsSupported.Sorting, true))
	{
		if(exists($SortDescriptionInfo) && exists($SortDescriptionInfo.SortFields))
		{
			Begin StrVariable SortDescription
				Value = "{!WA RLTitle.Sort}:"
			End

			Begin Counter SortFieldNumber
				Value = 0
			End

			foreach($SortDescriptionInfo.SortFields)
			{
				Begin Counter SortFieldNumber
					Inc = 1
				End

				Begin StrVariable SortDescription
					Append = NewLine() + "  " + Counter.SortFieldNumber() + ". "
				End

				Begin StrVariable SortDescription
					when(eq([], decollationdate) || eq([], decollationtime))
					{
						Append = "{!WA Sort.DDateTime}"
		 			}
					else
					{
						when(eq([], jobenddate) || eq([], jobendtime))
						{
							Append = "{!WA Sort.JEDateTime}"
			 			}
						else
						{
							when(eq([], jobstartdate) || eq([], jobstarttime))
							{
								Append = "{!WA Sort.JSDateTime}"
				 			}
							else
							{
								when(eq([], xferdate) || eq([], xfertime))
								{
									Append = "{!WA Sort.TDateTime}"
					 			}
								else
								{
									Append = [].Title
								}
							}
						}
					}
				End

				Begin StrVariable SortDescription
					when(eq([].Ascending, 0))
					{
						Append = " ({!WA Sort.Desc})"
					}
					else
					{
						Append = " ({!WA Sort.Asc})"
					}
				End
			}

			if (noteq(Counter.SortFieldNumber(), 0))
			{
				Begin Label
					Label = StrVariable.SortDescription()
					EscapeType = JS
				End
			}
		}
	}

End

Begin Component FixedRIDSupported
	Begin Label
		label = String(Counter.FixedRIDSupported())
	End
End

Begin Component HostName
	Begin Label
		label = GetHost()
	End
End

Begin Component ShowExportDefinitionIcons
	Begin Label
		when (eq(%User.GeneralSettings.ShowExportDefinitionIcons, 1))
		{
			label = "true"
		}
	End
End

	//-----------------------
	// IsStartFolder
	//-----------------------
Begin Component IsStartFolder
	Begin Label
		when (Empty ($Info.FolderName))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
		EscapeType = None
	End
End

Begin Component RootFID
	Begin Label
		Label = GetFolderIdWithoutSubfolders(String())
		EscapeType = JS
	End
End

if(ExistsAndNotEmpty($FilterInfo.Index))
{
	Begin Component Index
		Begin Label
			Label = $FilterInfo.Index
			EscapeType = JS
		End
	End
}

/////////////////////////////////////////
// Build Folder information if needed.
// BFI - means Build Folder Information
// if BFI exists in UserData, then we build an array of
// folder data, so the folder frames can use it to build themselves.
// this way, those frames doesn't need to generate new I_UserSession object.
// We use RequestData element, which share the I_UserSession with the calling request.
//
// BFI = 1 - build only folder path
// BFI = 2 - build hierarical array with all ancestors siblings
/////////////////////////////////////////
if(exists($UserData.BFI))
{
	Begin Component FoldersArray
		// get the folder data
		Begin RequestData FolderInfo
			Begin Request
				RequestType	= FolderRequest
				SID = $params.sid
				FID = $Params.FID

				when(eq($UserData.BFI, "1"))
				{
					Mode = FolderPath
				}
				else // BFI = 2
				{
					Mode = OpenParents
				}
			End
		End

		if(exists([FolderInfo].Info.Ancestors))
		{
			Begin StrVariable AncestorPrefix
				value = string() // after the first time, we set it to comma.
			End

			// loop through all ancestors
			ForEach(ancestor in [FolderInfo].Info.Ancestors)
			{
				// build ancestor data
				// the root folder doesn't have attributes, so we have to use WhenExists
				Begin Label
					Label = StrVariable.AncestorPrefix()
							+ "['" + Replace(Replace(WhenExists([ancestor].Name, "{!WA FolderPath.Root}"), "\", "\\"), "'", "\'")
							+ "','" + Replace (Replace(WhenExists([ancestor].ID), "\", "\\"), "'", "\'")
							+ "'," + WhenExists([ancestor].IsHostType, "0")
					EscapeType = None
				End

				// check for ancestor subfolder
				if(exists([ancestor].Folders."0"))
				{
					ForEach(subfolder in [ancestor].Folders)
					{
						if (noteq([SubFolder].Name, ".."))
						{
							// build ancestor subfolder data
							Begin Label
								Label = ",['" + Replace(Replace([subfolder].Name, "\", "\\"), "'", "\'")
										+ "','" + Replace (Replace([subfolder].ID, "\", "\\"), "'", "\'")
										+ "'," + String([subfolder].IsHostType)
										+ "]"
								EscapeType = None
							End
						}
					}
				}

				// close ancestor array
				Begin Label
					Label = "]"
					EscapeType = None
				End

				// set comma between folders
				if(empty(StrVariable.AncestorPrefix()))
				{
					Begin StrVariable AncestorPrefix
						value = ","
					End
				}
			}

			// in FolderPath, we add the current folder data to the path.
			// (In tree mode, it is not needed, as the current folder data is in its parent sub-folders list)
			if(eq($UserData.BFI, "1"))
			{
				Begin Label
					Label = StrVariable.AncestorPrefix()
							+ "['" + Replace(Replace($Info.FolderName, "\", "\\"), "'", "\'")
							+ "','" + Replace (Replace($Params.FID, "\", "\\"), "'", "\'")
							+ "'," + WhenExists([FolderInfo].Info.IsHostType, "0") + "]"
					EscapeType = None
				End
			}
		}
	End
}

Begin Component OpenReportMenu
	Begin Label
		Label = String(%User.ApplicationFeatures.ReportListOpenReportFeature.IsChecked)
		EscapeType = None
	End
End

//Print options in report menu
Begin Component RemotePrintMenu
	Begin Label
		Label = %User.ApplicationFeatures.ReportListRemotePrintFeature.IsChecked
		EscapeType = None
	End
End

Begin Component SubscriptionMenu
	Begin Label
		when ( ExistsAndEqual($Info.IsSupported.subscription, 1) && eq(%User.ApplicationFeatures.Approvals.IsChecked, 1) )
		{		
			Label = 1
		}
		else
		{
			Label = 0
		}
	End
End

Begin Component PreparePrintMenu
	Begin Label
		Label = %User.ApplicationFeatures.ReportListPreparePrintFeature.IsChecked
		EscapeType = None
	End
End

Begin Component LocalPrintMenu
	Begin Label
		Label = %User.ApplicationFeatures.ReportListLocalPrintFeature.IsChecked
		EscapeType = None
	End
End

Begin Component LocalPrintAsMenu
	Begin Label
		Label = %User.ApplicationFeatures.ReportListLocalPrintAsFeature.IsChecked
		EscapeType = None
	End
End

Begin Component LocalSaveMenu
	Begin Label
		Label = %User.ApplicationFeatures.ReportListSaveFeature.IsChecked
		EscapeType = None
	End
End

Begin Component LocalMailMenu
	Begin Label
		Label = %User.ApplicationFeatures.ReportListMailFeature.IsChecked
		EscapeType = None
	End
End

Begin Component PropertiesMenu
	Begin Label
		Label = %User.ApplicationFeatures.ReportListPropertiesFeature.IsChecked
		EscapeType = None
	End
End

Begin Component ShowPrintIcon
	Begin Label
		Label = String(%User.ReportList.Fields.print.show)
		EscapeType = None
	End
End

Begin Component ShowReportTypeIcon
	Begin Label
		Label = String(%User.ApplicationFeatures.ReportTypeIconFeature.IsChecked)
		EscapeType = None
	End
End

Begin Component ShowReportNoteIcon
	Begin Label
		Label = String(%User.ApplicationFeatures.ReportNoteIconFeature.IsChecked)
		EscapeType = None
	End
End

Begin Component ShowReportIndexIcon
	Begin Label
		Label = String(%User.ApplicationFeatures.ReportIndexIconFeature.IsChecked)
		EscapeType = None
	End
End

Begin Component IsAddNoteAvailable
	Begin Label
		Label = String(%User.ApplicationFeatures.NoteAddFeature.IsChecked)
		EscapeType = None
	End
End

Begin Component LoginInformation
	Begin Label
		Label = replace(replace(%User.ApplicationFeatures.ReportListLoginInfo{!WA Lang.DesktopName}.value
						, "%%user", "<span id=LoginUser>" + GetUser() + "</span>")
						, "%%host", "<span id=LoginHost>" + GetHost() + "</span>")
		EscapeType = JS
	End
End

Begin Component LoginInformationSubTitle
	Begin Label
		Label = replace(replace(%User.ApplicationFeatures.ReportListLoginInfo{!WA Lang.DesktopName}.value
						, "%%user", GetUser())
						, "%%host", GetHost())
		EscapeType = JS
	End
End

Begin Component PageHeaderTemplate
	Begin Label
		Label = %User.ApplicationFeatures.ReportPrintHeaderFooterHeaderFeatureLabel{!WA Lang.DesktopName}.value
		EscapeType = JS
	End
End

Begin Component PageFooterTemplate
	Begin Label
		Label = %User.ApplicationFeatures.ReportPrintHeaderFooterFooterFeatureLabel{!WA Lang.DesktopName}.value
		EscapeType = JS
	End
End

Begin Component DefaultOrientation
	Begin Label
		Label = %User.ApplicationFeatures.ReportPrintOrientationFeature.Value
		EscapeType = None
	End
End


if(eq(%User.ApplicationFeatures.MultiSelectByKeyboard.value, 1))
{
	Begin Component MultiSelectByKeyboard
		Begin Label
			Label = "1"
			EscapeType = None
		End
	End
}

if(eq(%User.ApplicationFeatures.MultiSelectByCheckboxes.value, 1))
{
	Begin Component MultiSelectByCheckboxes
		Begin Label
			Label = "1"
			EscapeType = None
		End
	End
}

if (eq(%User.ApplicationFeatures.ReportListComputeNumberOfReportsFeature.ischecked,1) && !(eq($Position.TopLine,0) && eq($Position.BottomLine,0)))
{
	Begin Component NumberOfReports
		Begin Label
			label = $TotalCount
		End 
	End
}

Begin Component NumberOfRequestedReports
	Begin Label
		label = $params.getTotalCount
	End 
End


Begin Component NumberOfReportsPerScreen
		Begin Label
			label = %User.ReportList.MaxSize
		End 
End

Begin Component CurrentPageInReportList
	Begin Label
		label = WhenExists($STD.cp,"1")
	End
End


Begin Component IsActiveXSaveMode
	Begin Label
		Label = %User.Applicationfeatures.reportsavedialogtype.value
	End
End



Begin Component ApprovalsIsSupported
	Begin Label
		when ( eq(Number(WhenExists ($Info.IsSupported.Approval, 0)), 1) && eq(%User.ApplicationFeatures.Approvals.IsChecked, 1) )
		{
			Label = "1"
		}
		else
		{
			Label = "0"
		}
	End
End
	
	
Begin Component IsApprovals
	Begin Label
		when(ExistsAndEqual($FilterInfo.Approvals, 1))
		{
			Label = "1"
		}
		else
		{
			Label = "0"
		}
	End
End

Begin Component ReportsTarget
	Begin Label
		Label = Number(%User.GeneralSettings.ReportsTarget)
	End
End

Begin Component ShowTransformers
	Begin Label
		Label = Number(%User.Applicationfeatures.ReportListTransformersFeature.ischecked)
	End
End

Begin Component ShowLogicalViews
	Begin Label
		Label = Number(%User.Applicationfeatures.ReportListLVFeature.ischecked)
	End
End

Begin Component HideUrl
	Begin Label
		Label = Number(%User.Applicationfeatures.HideWebAccessURL.ischecked)
	End
End

Begin Component FontSize
	Begin Label
			Label = WhenExists(%User.ApplicationFeatures.ReportListFontSize.value, "12")
			EscapeType = NONE
	End
End

Begin Component MultiRepositories
	Begin Label
		when(ExistsAndEqual($STD.mr, 1))
		{
			Label = "1"
		}
		else
		{
			Label = "0"
		}		
	End
End

Begin Component PrintAsActiveXPlugIn
	Begin Label
		Label = %User.Applicationfeatures.ReportPrintDialogType.value
	End
End

Begin Component RunSaveAsActiveXPlugIn
	Begin Label
		Label = %User.Applicationfeatures.ReportSaveDialogType.value
	End
End

Begin Component RunMailAsActiveXPlugIn
	Begin Label
		Label = %User.Applicationfeatures.ReportMailDialogType.value
	End
End

Begin Component ExpandInFilter
	Begin Label
		when (Exists($FilterInfo.expand) && ExistsAndEqual($FilterInfo.expand, "1"))
		{
			Label = "1"
		}
		else
		{
			Label = "0"
		}
	End
End

Begin Component ApprovalInReportList
	Begin Label
		when( ExistsAndEqual($Info.IsSupported.ApprovalsInReportList,1) )
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
	End
End


Begin Component Language
	Begin Label
		Label = $Params.Lang	{const}
	End
End