Consultor Eletrônico



Kbase 21707: How to manipulate strings with Actuate ReportCast scripting language
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to manipulate strings with Actuate ReportCast scripting language given that the Actuate ReportCast scripting language does not have any specific methods or functions for handling strings.

FACT(s) (Environment):

Actuate 5.x

CAUSE:

The following is a senario in which having such possibilities may be of use.

For example

Using Actuate ReportCast and a Web Browser to execute a ROX (report executable file) with  the "contentrequest.achtml"

Encyclopedia Structure
----------------------

          |Folder A - which is the main work Folder|
         /                                          \
        /                                            \
     |Folder B - ROX files|        | Folder C - ROI files |

All ROI (Report Instance - Output) files should be produced in Folder C.

When clicking on the rox to generate a ROI. The "output name" value (which is actually the URL address to the ROI file) in the Requester page will be displayed incorrectly.

Expected value = "Folder A/Folder C/Actuate-Report.ROI"
 Actual value = "Folder A/Actuate-Report.ROI"

Therefore the ROI will always end up in the wrong subfolder.

Sometime the REPORTOUTPUTPATH is not dynamic enough to handle subfolders within a "Working" folder in the Encyclopedia..

It will work fine when a report is scheduled and run since the ROV file used has the proper path for the ROI.

Executing a report via the Web causes "Output Name" of  "contentrequest.achtml" not to show or use the Correct and full URL for a subfolder.

So in the example above the customer would have to use his own created URL string.

FIX:

One option is to capture the ReportCast variable in a JavaScript function, then use it accordingly.

Comment out the line that contains REPOROUTPUTPATH in CONTENTREQUEST.ACHTML and put in all this code before.

<Script Language="JavaScript">
<!--
       var wurl;
       var wroot;
       var pos;
       var wlangd1;
       var wlangd2;
       var str;

// get the full URL to this item or folder

       wurl = "$(URL)";

// get the url to the server

       wroot = "$(RootFolderURL)";

// find out how long the url to the server is

       wlangd1 = wroot.length;

// get rid of the ? request and everything after that.

       wurl = ( ( pos = wurl.lastIndexOf ( "?" ) ) > -1 ) ? wurl.substring ( 0, pos ) : wurl;

// get rid of the . and the file extension.

       wurl = ( ( pos = wurl.lastIndexOf ( "." ) ) > -1 ) ? wurl.substring (0, pos ) : wurl;

// get the length of what is left of the full URL

       wlangd2 = wurl.length;

// get rid of the RootFolderURL that is to the left in the full URL

       wurl = wurl.substring ( wlangd1, wlangd2 );

// add a slash before and .roi after the URL

       wurl = ("/" + wurl + ".roi");

// make a string that replaces the original string inside contentrequest.achtml

str = ("<td valign='center'><input type='text' size='32' name='__outputname'
value=" + wurl + "></td>");


// write this inside the HTML document

document.write(str);

-->
</Script>