ModifyRepositoryFileBQY (Method)

Applies To:

EmbeddedBrowser object, HyperLink object

Description:

Enables you to modify an Interactive Reporting document file repository object for an embedded browser object or hyperlink object. When this method executed, the corresponding Smartcut is regenerated and the embedded browser or hyperlink is refreshed.

Note:

A forward slash (/, or also known as a solidus or virgule) is not recognized as a valid character in an Interactive Reporting document file name argument for this method.

Syntax:

Expression. ModifyRepositoryFileBQY(StringDocumentName,[BQYSectionName], [optional] BqRepositoryToolbarType as RepositoryToolbarType, [optional] String SmartcutParameters)

Expression Required:

Parameters:

DocumentName—Required; String; Maps to the name of the object selected from the repository.

BQYSectionName – Optional; String; Maps to the Interactive Reporting document file section name set for the repository object (corresponds to the Toolbar field on the Document Options dialog).

ToolbarType—Optional; RepositoryToolbarType; Maps to the toolbar type set for the Interactive Reporting document file repository object (corresponds to the Toolbar field on the Document Options dialog). Uses the bqRepositoryToolbarType constant.

Expression Required:

Parameters:

SmartcutParams—Optional; String; Maps to the Other Parameters control used for any additional parameters appended to the URL.

Constants:

The bqReposiotryToolbarType consists of these values:

Example:

The following example shows how to change a repository Interactive Reporting document file section and toolbar. This script presumes that the existences of TextBox1 through TextBox4. The Console.Writeln statements are written to the log file in the EPM Workspace:

var ActionName = "ModifyRepositoryFileBQY"
Console.Writeln("Start " + ActionName)

//Set document argument value
Console.Writeln("Step 1")

//If the textbox is empty, use the default value, otherwise use the value in the textbox if (TextBox1.Text == "") { 

try
{
//This is the default name of the folder and document as they appear when published var sDocumentName = "\MyDocuments\MyDocumentName.bqy" }
catch(e)
{
Console.Writeln("Caught 1a: " + e.toString())
}

}
else
{ 
try
{
var sDocumentName = TextBox1.Text
}
catch(e)
{
Console.Writeln("Caught 1b: " + e.toString())
}

}

//Set section name argument value
Console.Writeln("Step 2")

//If the textbox is empty, use the default value, otherwise use the value in the textbox if (TextBox2.Text == "") { 

try
{
//This is the default name of the section to which the document will open var sBQYSectionName = "Dashboard" }
catch(e)
{
Console.Writeln("Caught 2a: " + e.toString())
}

}
else
{ 
try
{
var sBQYSectionName = TextBox2.Text
}
catch(e)
{
Console.Writeln("Caught 2b: " + e.toString())
}

}

//Set Toolbar argument value
Console.Writeln("Step 3")

//If the textbox is empty, use the default value, otherwise use the value in the textbox if (TextBox3.Text == "") { 

try
{
//This sets the document to a standard toolbar
var cToolbarType = bqRepositoryBQYToolbarStandard
}
catch(e)
{
Console.Writeln("Caught 3a: " + e.toString())
}

}
else
{ 
try
{
//Use an eval statement here to treat the TextBox contents like a constant var cToolbarType = eval(TextBox3.Text) }
catch(e)
{
Console.Writeln("Caught 3b: " + e.toString())
}

}
//Set parameter argument value
Console.Writeln("Step 4")

//If the textbox is empty, use the default value, otherwise use the value in the textbox if (TextBox4.Text == "") { 

try
{
//This sets no document parameters
var sDocParams = ""
}
catch(e)
{
Console.Writeln("Caught 4a: " + e.toString())
}

}
else
{ 
try
{
var sDocParams = TextBox5.Text
}
catch(e)
{
Console.Writeln("Caught 4b: " + e.toString())
}

}

//Use the argument values in the method
Console.Writeln("Step 5")

try
{ActiveSection.Shapes["EmbeddedBrowser1"].ModifyRepositoryFileBQY(sDocumentName, sBQYSectionName, cToolbarType, sDocParams) }
catch(e)
{
Console.Writeln("Caught 5: " + e.toString())
}

}
 Console.Writeln("End " + ActionName