ReportExpress™ Online Tutorial

Home-> Tutorial-> ReportExpress Viewer preparation

ReportExpress has two components : ActiveReport Designer Studio and ActiveX Viewer(ReportExpress' Viewer).
ActiveReport Designer Studio (AR Designer) is the tool which design the layout with binding data.
ReportExpress' Viewer is client runtime module for web reporting which package as ActiveX. Using ReportExpress' Viewer, you can easily and cost effectivily make a webreporting.

1. Create new sub-folder named example under newhome. In this "newhome" folder, you already made "rpxFiles" folder for save the "myfirstreport.rpx".

2. Create new html page and edit following and save as "example01.html"

<html>
<head>
<title>Example01</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/javascript">
function reportView() {
var hostip = window.location.host ;

    Viewer1.Server = "http://" + hostip + "/newhome/"
    Viewer1.ReportLayout = "myfirstreport.rpx" ;
    Viewer1.FileUrl="http://" + hostip + "/newhome/xml/customer.asp" ;
    Viewer1.RunViewer() ;
}
</script>
</head>

<body>
<p>
<input name="button1" type="button" id="button1" onclick="reportView();" value="Click!" />
</p>
<object classid="CLSID:1CC26E3F-F20A-4074-8BB0-F34242591459"
codebase="../instRE/ReportExpress.cab#version=3,3,0,34"
id="Viewer1" style="display: none">
</object>
</body>
</html>

Click button to show the example01.html

In above example code, you'll find the ReportExpress' Viewer component and it's synopsis.

Viewer1.Server :
Server property is the location of rpx files. You have to ommit the “rpxFiles” directory. i.e, if your rpx file's real location is http://www.aaa.com/report/rpxFires/test.rpx, then Viewer.Server=”http://www.aaa.com/report/”. Note that server property end with “/” . At run time, Viewer's inet object request the rpx file for generating report.

Viewer1.ReportLayout :
Define the rpx file's name property. ReportLayout value(string) will be add to Server property(string). Server+ReportLayout string is complete URL which can get the rpx files.
Note: rpxFiles directory was hidden. i.e, “Server + rpxFiles + ReportLayout”.

Viewer1.FileUrl :
After design the report using XML data control(named dc), you can set the dc's URL and RecordSetPattern(XPath) using FileUrl and Xpath properties at runtime. Using FileUrl, you can pass the arguments to Viewer's XML datasource. If you specify the FileUrl, then Viewer will be reference the XML Data as FileUrl property. If not specify the FileUrl, then Viewer will be reference the dc's FileUrl at design time.

Viewer1.RunViewer() :
This method will be generate report on the client-side ReportExpress viewer. Also you can get the information of printing status using Successful() method.

<html>
<head>
<title>Example01</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/javascript">
<!--
function RunView_onclick() {
var PrintSuccessful;
var hostip = window.location.host ;
    Viewer1.Server = "http://" + hostip + "/newhome/" ;
    Viewer1.ReportLayout = "myfirstreport.rpx" ;
    Viewer1.ViewToolBar=0;
    Viewer1.Debugging=1;
    Viewer1.FileUrl="http://" + hostip + "/newhome/xml/customer.asp" ;
    Viewer1.XPath="//customers";
    Viewer1.RunViewer() ;
    PrintSuccessful=Viewer1.Successful();

    if (PrintSuccessful=1) {
        alert (“Printing success!\n”) ;
    } else {
        alert (“Printing fail!\n”);
    }
}
//-->
</script>
</head>

<body>
<p>
<input id=RunView type=button value="Print recieve" name="RunView" LANGUAGE=javascript onclick="RunView_onclick();">
</p>
<object classid="CLSID:1CC26E3F-F20A-4074-8BB0-F34242591459"
codebase="../instRE/ReportExpress.cab#version=3,3,0,34"
id="Viewer1" style="display: none">
</object>
</body>
</html>

You can find detail information of ReportExpress' Viewer in the ReportExpress Viewer online help.

Previouse  Next
Copyright 2003 Cabsoftware, Inc. and its licensors. All rights reserved. www.cabsoftware.com