Sunteți pe pagina 1din 160

Appendix .

Report Designer OCX Methods, Properties, Events

Appendix IV. Methods, Properties & Events of


Report Designer OCX

4.1. Methods of Report Designer OCX

The following table shows methods of Report Designer OCX by each category.

Category

Dialog Box

Data Set
Tool
Document List

Report Execution

Report Information

Print

The Names of Methods


FindDialog
OpenFileDialog
PrintDialog
SaveAsDialog
SetPartSaveDialog
SetSaveDialog
SetSaveDialogEx
SetRData
ExecuteFile
UploadDataFile
UploadDataFileEx
RprFileOpen
CancelReport
EnableThreadEngine
FileOpen
RefreshReport
SetAgentUserInfo
SetAppendReport
SetFocusToChart
SetHttpAccessType
SetKindOfParam
SetNodataObjFile
SetArgumentEncrypt
ShowMemoLine
GetLastErrorMsg
GetPageSize
GetReportInfo
GetTotalPageNo
IsError
CMPrint
ServerPrint
SetNoPrintNoData
SetPrint
SetPrint2
SetPrint3
SetPrint4
SetPrintInfo
SetRemakeReport

81

Appendix . Report Designer OCX Methods, Properties, Events

Save

Chart
Argument Value Setting
Field Data

Screen

Environment

82

SetSpoolPage
SaveAsEmfFile
SaveAsFaxFormat
SaveAsIEmfFile
SaveAsImagefile
SaveAsMrrFile
SaveAsMrrmlFile
SaveAsPdfFile
SaveAsPptFile
SaveAsTxtFile
SaveAsWordFile
SaveAsXlsFile
SaveAsXmlFile
SavePage
SendMail
SendMailEx
SetPrinttoFile
SetSaveExcelOption
SetSaveTiffOption
SetSessionInfo
SetTifCompressType
SetTifImageScale
ViewExcel
ViewExportFile
ViewPDF
ViewPpt
ViewWord
AddDiagonalSeries
ChangeSeries
SetChartPenAttr
SetParamValue
GetComboboxValue
GetTextboxValue
SetComboboxValue
SetTextboxValue
CloseBrowser
FirstPage
LastPage
NextDoc
NextPage
PrevDoc
PrevPage
RefreshWindow
ZoomDefault
ZoomIn
ZoomOut
ZoomPage
ApplyLicense
DisableToolbar
HideChartMenu
HidePopupMenu

Appendix . Report Designer OCX Methods, Properties, Events

HideScrollBar
HideStatusBar
HideToolBar
HideTreeMenu
SetBackgroundColor
SetCacheOption
SetDefaultPenAttr
SetDefaultPlaneAttr
SetMessageboxShow
SetMsgTitle
SetNoDataDialogInfo
SetPageColor
SetPageLineColor
SetPageScroll
SetReportDialogInfo
SetTrace
ShowChartMenu
ShowIndexTree
ShowPopupMenu
ShowScrollBar
ShowStatusBar
ShowToolBar
ShowTreeMenu
ViewShowMode

Report Designer OCX provides the method to save a document as various format files.
A document can be saved as MRR, XLS, TXT, MRRML, PDF, TIF, BMP, GIF, JPG, XML,
HWP, EMF, PPT, or DOC files. But Standard Version of Report Designer OCX supports
MRR, XLS, TXT, and MRRML file formats only.
A new file name is supposed to have a specific extension for the security reason, when it
calls a method to save the file. For example, in the case of calling the method of
SaveAsXlsFile to save a file as XLS format, the file name is returned as an Argument, there
by creating its extension as XLS.
The usage of methods are JavaScript samples which are used in linking with Report
Designer OCX on the Web.

83

Appendix . Report Designer OCX Methods, Properties, Events

4.1.1. AddDiagonalSeries
Definition
void AddDiagonalSeries(BSTR ChartVarName, BSTR bSquare);

Argument
ChartVarName : Variable names for chart objects
bSquare : 0 or 1

Description
It is a function to create a bubble chart, which shows the whole bubble shape because
various series of invisible crosshatching types are added. The default value of bSquare
Argument is 0. If 1 is given and the larger value between x and y axes is set on the other
axis, a square-type chart is created. Thus the use of bSquare Argument allows a bubble
chart to add a magnifying effect.

Example
A standard bubble chart type

AddDiagonalSeries ("MyChart","0") type

AddDiagonalSeries ("MyChart","1") type

84

Appendix . Report Designer OCX Methods, Properties, Events

4.1.2. ApplyLicense
Definition
void ApplyLicense(BSTR szRDServerUrl);

Argument
szRDServerUrl : RDAGENT server path for applying license

Description
This method is for Japanese version and used to apply product licenses by calling
RDAGENT server.
If product licenses are not applied, file save function can not be used. According to the
product licenses, the file types to be saved are determined.

Example
function ApplyLicense_clicked()
{
Rdviewer.ApplyLicense ("http://192.168.1.39:8282/RDServer/rdagent.jsp"); // RDAGENT
path
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [SEOUL] [salesman]");
}

85

Appendix . Report Designer OCX Methods, Properties, Events

4.1.3. CancelReport
Definition
void CancelReport();

Description
Cancel reporting.

Example
function CancelReport_clicked()
{
Rdviewer.CancelReport ();
}

86

Appendix . Report Designer OCX Methods, Properties, Events

4.1.4. ChangeSeries
Definition
void ChangeSeries (BSTR ChartVarName, long SeriesIndex, long SeriesType, long
Dimension);

Argument
ChartVarName : Chart object variable name. In case of NULL or 0, applied to all the chart
object in the report.
SeriesIndex : Series index starting from 0. If the value is -1, applied to all the series.
SeriesType : Chart type (0 ~ 47)
0-Line, 1-Bar, 2-HorizBar, 3-Area, 4-Point, 5-Pie, 6-FastLine, 7-Shape, 8-Gantt, 9-Bubble,
10-Arrow, 11-Candle, 12-Polar, 13-Surface, 14-Volume, 15-ErrorBar, 16-Bezier, 17-Contour,
18-Error, 19-Point3D, 20-Radar, 21-Clock, 22-WindRose, 23-Bar3D, 24-ImageBar, 25-Donut,
26-TriSurface, 27-Box, 28-HorizBox, 29-Histogram, 30-ColorGrid, 31-BarJoin, 32-HighLow,
33-Waterfall, 34-Smith, 35-Pyramid, 36-Map, 37-HorizLine, 38-Funnel, 39-Calendar, 40HorizArea, 41-PointFigure, 42-Gauge, 43-Vector3D, 44-Tower, 45-PolarBar, 46-Bubble3D,
47-HorizHistogram
Dimension : 0 or 1. 0 3D chart, 1 2D chart

Description
This method is to change chart type of selected chart object series. This method is used after
running the reports.

Example
function SetChartPenAttr_clicked()
{
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\inventory.mrd", "");
Rdviewer.ChangeSeries ("MyChart", 0, 2, 0); //MyChart Chart type of first chart series is
changed to 3D HorizBar.
}

87

Appendix . Report Designer OCX Methods, Properties, Events

4.1.5. CloseBrowser
Definition
void CloseBrowser();

Description
Close a Web browser including RD OCX.

Example
function CloseBrowser_clicked()
{
Rdviewer.CloseBrowser ();
}

88

Appendix . Report Designer OCX Methods, Properties, Events

4.1.6. CMPrint
Definition
void CMPrint();

Description
Print the current report.
A report is printed out through the default printer, which can be changed by using the
method of SetPrintInfo. Printing options also can be modified by using the methods of
SetPrint, SetPrint2, SetPrint3,SetPrint4, and SetPrintInfo.
The event of PrintFinishedoccurs, when printing, is done.
cf. Use a method of PrintDialog to print a report with the pop-up of Print dialog box.

Example
function CMPrint_clicked()
{
Rdviewer.SetPrintInfo ("HP LaserJet 8150 PCL 6", 2, 1, 4); // the name of printing drive: HP
LaserJet 8150 PCL 6, the number of copies:2, print by copy:1, hide all of the dialog boxes
when printing: 4
Rdviewer.CMPrint (); // Start printing
}

89

Appendix . Report Designer OCX Methods, Properties, Events

4.1.7. DisableToolbar
Definition
void DisableToolbar(short index);

Argument
index : Index of toolbar items to be disabled. 0-Save a file, 1-Print, 2-Find, 3-Creating a table
of contents, 4-Zoom-in the screen, 5-Zoom-out the screen, 12-Stop printing, 13-View in
Microsoft Excel, 14-View in Hangul, 15-View in pdf, 16-View in Microsoft PowerPoint, 17View in Microsoft Word.

Description
Disable specific items on RD OCX Toolbars.

Example
function rdOpen() {
Rdviewer.DisableToolbar (0); // Toolbar items for saving files Disable
Rdviewer.DisableToolbar (1); //Toolbar buttons for printing Disable
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

90

Appendix . Report Designer OCX Methods, Properties, Events

4.1.8. EnableThreadEngine
Definition
void EnableThreadEngine(short flag);

Argument
flag : 0 or 1. If the value is 1, a separate thread is created to generate a report.

Description
Specify whether a separate thread is used or not when generating a report. If it takes time to
generate a report, it is used in preventing the browsers hang-up situation.

Example
function rdOpen() {
Rdviewer.EnableThreadEngine (1); // Report by means of creating a Thread to generate a
report
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

91

Appendix . Report Designer OCX Methods, Properties, Events

4.1.9. ExecuteFile
Definition
void ExecuteFile(BSTR FileName);

Argument
FileName : file names to be executed

Description
Check a file extension delivered as an Argument, execute the application associated with it,
and open the file.
Support the execution of mrr, xls, csv, txt, mrrml, pdf, tif, bmp, gif, jpg, jpeg, xml, hwp, html,
htm, emf, ppt, ps, prn, and doc files.

Example
function ExecuteFile_clicked()
{
Rdviewer.ExecuteFile ("c:\\test.xls"); // Execute Microsoft Excel and open test.xls.
}

92

Appendix . Report Designer OCX Methods, Properties, Events

4.1.10. FileOpen
Definition
boolean FileOpen(BSTR MRDFileName, BSTR Argument);

Argument
MRDFileName : A file path for MRD report, which can be a local file path, a URL on the Web,
or a server path for document management. A relative path can be specified.
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\Client2.mrd", "/rp [Seoul] [Employees] /rdelnodatamsg"); // Execute a report by
using MRD in a local file path.
rdviewer.FileOpen(http://m2soft.co.kr/report/mrd/test.mrd, /rf
[http://123.123.1.6:8282/RDServer/rdagent.jsp] /rsn [myoracle] /rp [2006-01-12] [Seoul]
[Jong-ro Goo] /rv id[101] name[Gil-dong Hong]); // Execute a report by using MRD in the
Web URL.
rdviewer.FileOpen("$test$test.mrd", "/rf [http://myserver:8080/RDAgent.jsp] /rloginID
[tester]"); // Execute a report by using MRD in a server path for document management.
Argument : Refer to Appendix III. Report Designer Arguments.

Description
A method to execute a report
The first Argument is the file name of a form file and the second Argument is an Argument
used in generating a report.
Once the method of FileOpen is called, a report starts generating and the event of
ReportFinished occurs, when the reporting is done. After the report creates its first page, the
method of FileOpen returns the value. Lest the method of FileOpen returns the value until
the whole pages are created, use /rwait Arguments at the same time. To print out the report
instantly in line with its execution, use /rop Argument at the same time.
In the case of failing to find the form file, the method of FileOpen returns FALSE. To see if
errors occur in the process of reporting, make sure that the method of IsError returns TRUE.
And to get error messages, call the method of GetLastErrorMsg.
In calling the method of FileOpen for the Web reporting, it is recommended to protect data by
encrypting transferred Arguments. The character strings can be encrypted by encoding
encryption objects which is supplied with the server module. At this time, specify the
methods of encryption such as SetArgumentEncrypt and SetKindOfParam.

Example
<body leftmargin="0px" rightMargin="0px" topmargin="0px" marginwidth="0px"
marginheight="0px" onLoad="javascript:rdOpen()">

93

Appendix . Report Designer OCX Methods, Properties, Events

<SCRIPT LANGUAGE = "JavaScript">


function rdOpen() {
<!Automatically adjust the zoom ratio.(Default Value: TRUE) Specify FALSE in the case of
using the zoom ratio -->
Rdviewer.AutoAdjust = false;
<!-- Specify the zoom ratio -->
Rdviewer.ZoomRatio = 100;
<!-- Hide a toolbar -->
Rdviewer.HideToolbar();
<!-- Set the background color of the page -->
Rdviewer.SetBackgroundColor(255,255,255);
<!-- Set the line color of the page -->
Rdviewer.SetPageLineColor(255,255,255);
<!-- Execute a report -->
Rdviewer.FileOpen("<%=serverIp%>/report/mrd/test.mrd", "/rfn
[<%=serverIp%>/report/data/data.jsp] /rp[" + year + "] [" + dept + "]");
}
</SCRIPT>
<!CALLING RDOCX CONTROL-- >
<script src="embeded.js"> </script>
</body>
Reference) The followings are concerned with embedded.js to define the control of RDOCX.
document.write('<object id="Rdviewer"
classid="clsid: 5A7B56B3-603D-4953-99091247D41967F8 "
width=100% height=100%
codebase="http://www.m2soft.co.kr/Demo/cab/rdviewer50u.cab#version=5,0,0,100">
</object>');

94

Appendix . Report Designer OCX Methods, Properties, Events

4.1.11. FindDialog
Definition
void FindDialog();

Description
Open the dialog box for finding the character strings.

Example
function FindDialog_clicked()
{
Rdviewer.FindDialog ();
}

95

Appendix . Report Designer OCX Methods, Properties, Events

4.1.12. FirstPage
Definition
void FirstPage();

Description
Move to the first page of a report.

Example
function FirstPage_clicked()
{
Rdviewer.FirstPage ();
}

96

Appendix . Report Designer OCX Methods, Properties, Events

4.1.13. GetComboboxValue
Definition
BSTR GetComboboxValue(BSTR objname, BSTR delimiter);

Argument
objname : Specify variable names for combo box objects. In order to specify several variable
names for combo box objects, use & as separator. (Ex. gender&birthday) In this case, the
values of each variables are returned as & separator.
delimiter : Use delimiters to have the internal value and the displaying value be returned at
the same time. When "@" is given as delimiter, the return value is the internalvalue@displaying-value.

Description
A method to get the value selected from combo box objects.
The internal value selected from combo box is returned. Use delimiters to have the
displaying value to be returned as well.
cf. To assign variable names to combo box objects, specify field names by using the dialog
box for data set connection.

Example
function GetComboboxValue_clicked()
{
var objname;
// Fetch the selection value of a combo box.
objname = "gender";
var retvalue = Rdviewer.GetComboboxValue (objname, "");
alert(retvalue);
// Fetch the selection values of several combo boxes.
//objname = "gender&birthday";
//var retvalue = Rdviewer.GetComboboxValue (objname, "^"); By using delimiters, the
internal value and displaying value are fetched at the same time.
//var retvalue = Rdviewer.GetComboboxValue (objname, "");
//alert(retvalue);
}

97

Appendix . Report Designer OCX Methods, Properties, Events

4.1.14. GetLastErrorMsg
Definition
BSTR GetLastErrorMsg();

Description
A method to get error messages, when errors occur in the process of executing a report.
To see if errors occur in the process of reporting, make sure that the method of IsError
returns TRUE.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ReportFinished()">
<!-alert ("Error : " + Rdviewer.IsError() + "\nErrorMsg : \n" + Rdviewer.GetLastErrorMsg());
-->
</SCRIPT>

98

Appendix . Report Designer OCX Methods, Properties, Events

4.1.15. GetPageSize
Definition
BSTR GetPageSize();

Description
Return the page size in the string format.

Example
function GetPageSize_clicked()
{
var ret = Rdviewer.GetPageSize (); // As for the A4-sized paper,, 210 mm X 297 mm is
returned.
}

99

Appendix . Report Designer OCX Methods, Properties, Events

4.1.16. GetReportInfo
Definition
BSTR GetReportInfo(BSTR infokind);

Argument
infokind : Specify information to be returned.
- "reportname"

: A report name

- "reportlongname" : A report name including a path


- "reportparams"

: A report Argument

Description
Return the report information executed.

Example
function GetReportInfo_clicked()
{
var retvalue = Rdviewer.GetReportInfo ("reportname");
alert(retvalue);
var retvalue = Rdviewer.GetReportInfo ("reportlongname");
alert(retvalue);
var retvalue = Rdviewer.GetReportInfo ("reportparams");
alert(retvalue);
}

100

Appendix . Report Designer OCX Methods, Properties, Events

4.1.17. GetTextboxValue
Definition
BSTR GetTextboxValue(BSTR objname);

Argument
objname : Variable names for text box objects. To specify several variable names for text
box objects, use & as separator. (Ex.
name&jumin_no&id&password&company&title&address&telno) When several variable
names for text box objects are specified, the values of each variables are returned as &
separator.

Description
A method to return the character strings inserted in text box objects
cf. To assign variable names to text box objects, specify field names by using the dialog box
for data set connection.

Example
function GetTextboxValue_clicked()
{
var objname;
objname = "name";
//Fetch several text box values
//objname =
"gender&name&jumin_no&id&password&company&title&address&email&telno";
var retvalue = Rdviewer.GetTextboxValue (objname);
alert(retvalue);
}

101

Appendix . Report Designer OCX Methods, Properties, Events

4.1.18. GetTotalPageNo
Definition
long GetTotalPageNo();

Description
Return the total page number of a report.

Example
function GetTotalPageNo_clicked()
{
var ret = Rdviewer.GetTotalPageNo (); // Return the total page number of a report.
}

102

Appendix . Report Designer OCX Methods, Properties, Events

4.1.19. HideChartMenu
Definition
void HideChartMenu();

Description
Hide the Change chart menu on the pop-up menu.
Once a report including a chart object is executed, the following pop-up menu appears upon
clicking the right button on the chart object.
If the method of HideChartMenu is used, the pop up menu like the right figure appears.

Example
function HideChartMenu_clicked()
{
Rdviewer.HideChartMenu ();
Rdviewer.FileOpen("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

103

Appendix . Report Designer OCX Methods, Properties, Events

4.1.20. HidePopupMenu
Definition
void HidePopupMenu(short index);

Argument
index : Have the values from 0 to 9.
0 : The whole pop-up menu, 1 : Next/Previous) page, 2 : Zoom-in/Zoom-out, 3 : Print, 4 :
Save a file, 5 : Change a chart, 6 : Show the tree management window, 7 : Next/Previous
document, 8 : E-mail as an attachment, 9 : Save parts of pages

Description
Hide the whole RD OCX pop-up menu or selected items.

Example
function HidePopupMenu_clicked()
{
Rdviewer.HidePopupMenu (4); // Hide the Save a file menu
Rdviewer.HidePopupMenu (9); // Hide the Save a part of pages menu
Rdviewer.FileOpen("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

104

Appendix . Report Designer OCX Methods, Properties, Events

4.1.21. HideScrollBar
Definition
void HideScrollBar(short flag);

Argument
flag : Have the value of 0, 1, or 3.
0 : Hide the horizontal scroll bar, 1 : Hide the vertical scroll bar, 3 : Hide both of them

Description
Hide the horizontal/vertical scroll bar.
Use the method of ShowScrollBar to make the scroll bar visible.

Example
function HideScrollBar_clicked()
{
//Rdviewer.HideScrollBar (0); // Hide the horizontal scroll bar
//Rdviewer.HideScrollBar (1); // Hide the vertical scroll bar
Rdviewer.HideScrollBar (3); // Hide the horizontal/vertical scroll bar
Rdviewer.FileOpen("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

105

Appendix . Report Designer OCX Methods, Properties, Events

4.1.22. HideStatusBar
Definition
void HideStatusBar();

Description
Hide a status bar.

Example
function HideStatusBar_clicked()
{
Rdviewer.HideStatusBar (); // Hide the status bar.
Rdviewer.FileOpen("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

106

Appendix . Report Designer OCX Methods, Properties, Events

4.1.23. HideToolBar
Definition
void HideToolBar();

Description
Hide a toolbar.

Example
function HideTreeMenu_clicked()
{
Rdviewer. HideToolBar ();
Rdviewer.FileOpen("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

107

Appendix . Report Designer OCX Methods, Properties, Events

4.1.24. HideTreeMenu
Definition
void HideTreeMenu();

Description
Hide Show the tree management window in the pop-up menu.
It is equal to set 6 for an Argument value of a method of HidePopupMenu.

Example
function HideTreeMenu_clicked()
{
Rdviewer.HideTreeMenu ();
Rdviewer.FileOpen("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

108

Appendix . Report Designer OCX Methods, Properties, Events

4.1.25. IsError
Definition
boolean IsError();

Description
Return TRUE if errors occur in the process of reporting. Use a method of GetLastErrorMsg
to get the error messages.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ReportFinished()">
<!-alert ("Error : " + Rdviewer.IsError() + "\nErrorMsg : \n" + Rdviewer.GetLastErrorMsg());
-->
</SCRIPT>

109

Appendix . Report Designer OCX Methods, Properties, Events

4.1.26. LastPage
Definition
void LastPage();

Description
Move to the last page of a report.

Example
function LastPage_clicked()
{
Rdviewer.LastPage (); // Move to the last page
}

110

Appendix . Report Designer OCX Methods, Properties, Events

4.1.27. NextDoc
Definition
long NextDoc();

Description
Allow to move between documents on the report containing the hyperlink function, thereby
moving to the next document. To move to the last document, 1 is returned.

Example
function NextDoc_clicked()
{
var ret = Rdviewer.NextDoc (); // Move to the next document
if (ret == 1) alert ("Move to the last document.");
}

111

Appendix . Report Designer OCX Methods, Properties, Events

4.1.28. NextPage
Definition
long NextPage();

Description
Move to the next page. The return value is the page number after moving, and it starts from 0.

Example
function NextPage_clicked()
{ var ret = Rdviewer.NextPage (); //Move to the next page
ret = ret + 1;
alert ("page numbers after moving : " + ret);
}

112

Appendix . Report Designer OCX Methods, Properties, Events

4.1.29. OpenFileDialog
Definition
BSTR OpenFileDialog(BSTR DlgTitle, BOOL bSaveOpen);

Argument
DlgTitle : Titles for dialog boxes
bSaveOpen : 0 Save a file, 1 Open a file

Description
A method to pop up Save As or Open dialog box, and to return the file name with the path
selected from the corresponding dialog box.
To pop up the Save As dialog box is quite similar to using the method of SaveAsDialog.
Both of them, however, perform different functions. In other words, the method of
SaveAsDialog has the function to save the current report as a selected file name, whereas
the method of OpenFileDialog returns a selected file name only.

Example
function OpenFileDialog_clicked()
{
Rdviewer.SetSaveDialog ("c:\\MyFolder\\", "a.xls", 2); // initial value settings for the Save
As dialog box, location, file name, file format
var fname = Rdviewer.OpenFileDialog ("save", 0); // Display the Save As dialog box
alert ("a file name to be saved : " + fname);
if (fname != "")
Rdviewer.SaveAsXlsFile (fname); // Save as a XLS file
var ret = Rdviewer.OpenFileDialog ("open", 1); // Display the Open dialog box
alert ("File name to open : " + ret);
}

113

Appendix . Report Designer OCX Methods, Properties, Events

114

Appendix . Report Designer OCX Methods, Properties, Events

4.1.30. PrevDoc
Definition
long PrevDoc();

Description
Allow to move between documents on the report containing a hyperlink function, thereby
moving to the previous document. To move to the first document, 1 is returned.

Example
function PrevDoc_clicked()
{
var ret = Rdviewer.PrevDoc (); // Move to the previous document.
if (ret == 1) alert ("Move to the first document.");
}

115

Appendix . Report Designer OCX Methods, Properties, Events

4.1.31. PrevPage
Definition
long PrevPage();

Description
Move to the previous page. The return value is the page number after moving, and it starts
from 0.

Example
function PrevPage_clicked()
{
var ret = Rdviewer.PrevPage (); // Move to the previous page.
ret = ret + 1;
alert ("Page numbers after moving. : " + ret);
}

116

Appendix . Report Designer OCX Methods, Properties, Events

4.1.32. PrintDialog
Definition
void PrintDialog();

Description
Display Print dialog box.
The default value of the Print dialog box can be modified by using the methods of SetPrint,
SetPrint2, SetPrint3, SetPrint4, and SetPrintInfo.
Printing starts by clicking a confirmation button on the Print dialog box, and the event of
PrintFinished occurs when printing is done.

cf. Use the method of CMPrint to print without opening the Print dialog box.

Example
function PrintDialog_clicked()
{
Rdviewer.PrintDialog (); // Display the Print dialog box.
}

117

Appendix . Report Designer OCX Methods, Properties, Events

4.1.33. RefreshReport
Definition
void RefreshReport();

Description
Execute the current report again with maintaining the Argument value of a report.

Example
function RefreshReport_clicked()
{
Rdviewer.RefreshReport (); //Re-execute the report
}

118

Appendix . Report Designer OCX Methods, Properties, Events

4.1.34. RefreshWindow
Definition
void RefreshWindow();

Description
Refresh the current report.
RefreshReport is to re-execute a report, but RefreshWindow is to re-draw a report only on
the screen.

Example
function RefreshWindow_clicked()
{
Rdviewer.RefreshWindow (); // Refresh a report.
}

119

Appendix . Report Designer OCX Methods, Properties, Events

4.1.35. RprFileOpen
Definition
boolean RprFileOpen(BSTR FileName, BSTR Argument);

Argument
FileName : A path for a project file, which can be a local path or a URL on the Web
Argument : Specify Arguments for a report, which are used for executing the first report with
/rfirstmrd Arguments.

Description
Open project files (.rpr).
The list of documents appears on the left screen, when the method is executed. Use the
/rfirstmrd Arguments to execute the first report directly from the list of documents. Doubleclick the corresponding file from the list of documents to execute a specific report.

Example
function RprFileOpen_clicked()
{
//Rdviewer.RprFileOpen ("C:\\Program Files\\M2Soft\\Report Designer
5.0\\Examples\\RDExample50.rpr", "/rfirstmrd"); // Open project files on the local
Rdviewer.RprFileOpen ("http://localhost/Examples/RDExample50.rpr", "/rfirstmrd"); // Open
project files on the Web URL
}

120

Appendix . Report Designer OCX Methods, Properties, Events

4.1.36. SaveAsDialog
Definition
boolean SaveAsDialog();

Description
Display Save As dialog box and save the current report as the file name selected on the
dialog box.
If a report is saved, TRUE is returned. If not, FALSE is returned. The event of
SaveFileFinished occurs when saving is done.
Use the method of SetSaveDialog to specify the initial value of the dialog box. Use the
method of SetSaveExcelOption to skip saving options in saving Microsoft Excel files.

cf. The method of SaveAsDialog Method executes the function to save the current report as
a selected file name, where as the method of OpenFileDialog returns a selected file name
only.

Example
function SaveAsDialog_clicked()
{ Rdviewer.SetSaveExcelOption (1); // 1-Maintain formats when saving a file as Microsoft
Excel, 2-Allow to change formats
Rdviewer.SetSaveDialog ("c:\\MyFolder\\", "a.xls", 2); // Set the initial value of the Save As
dialog box location, file names, file formats
var ret = Rdviewer.SaveAsDialog (); // Save the current document with displaying the Save
As dialog box.
alert (ret);
}

121

Appendix . Report Designer OCX Methods, Properties, Events

4.1.37. SaveAsEmfFile
Definition
boolean SaveAsEmfFile(BSTR EmfFileName);

Argument
EmfFileName : EMF file names to be created

Description
Save the current report as an EMF image file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done. If the volume of the executed report is more
than 2 pages, each page is created as one image file, respectively.
The first page is saved as image file under the specified file name, and the remaining pages
from the second page are saved as image files having file name + _page order +
.extension formats. For example, if a report has 3 pages in total and is saved as a.emf
by using the method of SaveAsEmfFile, the file name of the first page is a.emf, the second
one is a_1.emf, and the third one is a_2.emf, respectively.

Example
function SaveAsEmfFile_clicked()
{
var ret = Rdviewer.SaveAsEmfFile ("C:\\mymy\\a.emf"); // Save as an EMF image file
alert (ret);
}

122

Appendix . Report Designer OCX Methods, Properties, Events

4.1.38. SaveAsIEmfFile
Definition
boolean SaveAsIEmfFile(BSTR EmfFileName);

Argument
EmfFileName : EMF file names to be created

Description
Save the current report as an EMF image file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinishedoccurs when saving is done.
If the volume of an executed report is more than 2 pages, each page is created as one
image file, respectively.
Save as a Emf file, which is editable in Adobe Illustrator.

Example
function SaveAsIEmfFile_clicked()
{
var ret = Rdviewer.SaveAsIEmfFile ("C:\\mymy\\a2.emf"); // Save as an EMP image file
alert (ret);
}

123

Appendix . Report Designer OCX Methods, Properties, Events

4.1.39. SaveAsFaxFormat
Definition
BOOL SaveAsFaxFormat(BSTRE FileName, short nFormat, short nFlag, short nBpp, short
nReserved1, long nReserved2);

Argument
FileName : file name
nFormat : 0-FILE_CCITT, 1-FILE_CCITT_GROUP3_1DIM, 2-FILE_CCITT_GROUP3_2DIM,
30FILE_CCITT_GROUP4
nFlag : 0-SAVEFILE_FIXEDPALETTE, 1-SAVEFILE_OPTIMIZEDPALETTE, 2SAVEFILE_MULTIPAGE
nBpp : Result file's pixel depth. 0-save as basic BPP of the format, 1/4/8/24/32 etc.
nReserved1/nReserved2 : reserved flags

Description
This method is to save a report into Fax Format document. Documents are saved through
Raster Image Library and only TIFF CCITT Format is supported.

Example
function SaveAsFaxFormat_clicked()
{
Rdviewer.SaveAsFaxFormat ("C:\test.tif", 0, 0, 0, 0, 0);
}

124

Appendix . Report Designer OCX Methods, Properties, Events

4.1.40. SaveAsImagefile
Definition
boolean SaveAsImagefile(BSTR FileName, short imageType);

Argument
FileName : Image file names to be created
imageType : Image file formats have the value of 0 , 1, 2, or 3 as follows.
0 : TIF , 1 : BMP, 2 : GIF, 3 : JPG

Description
Save the current report as an image file to have the file format transferred by an Argument.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.
If a report is saved as TIF file format, its whole pages become one file.
If it is saved as any other file formats, each page is created as one image file. For example,
a report has 4 pages in total and is saved as a.gif by using the method of SaveAsImagefile,
the file name of the first page is a.gif, the second one is a_1.gif, and the third one is a_2.gif,
respectively.

Example
function SaveAsImagefile_clicked()
{
var ret;
ret = Rdviewer.SaveAsImagefile ("C:\\mymy\\a.tif", 0); // Save as a TIF image file
ret = Rdviewer.SaveAsImagefile ("C:\\mymy\\a.bmp", 1); // Save as a BMP image file
ret = Rdviewer.SaveAsImagefile ("C:\\mymy\\a.gif", 2); // Save as a GIF image file
ret = Rdviewer.SaveAsImagefile ("C:\\mymy\\b.jpg", 4); // Save as a JPG image file}

125

Appendix . Report Designer OCX Methods, Properties, Events

4.1.41. SaveAsMrrFile
Definition
boolean SaveAsMrrFile(BSTR MrrFileName);

Argument
MrrFileName : MRR file names to be created

Description
Save the current report as an MRR file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.

Example
function SaveAsMrrFile_clicked()
{
var ret = Rdviewer.SaveAsMrrFile ("C:\\mymy\\a.mrr"); // Save as a MRR file
alert (ret);
}

126

Appendix . Report Designer OCX Methods, Properties, Events

4.1.42. SaveAsMrrmlFile
Definition
boolean SaveAsMrrmlFile(BSTR MrrmlFileName);

Argument
MrrmlFileName : MRRML file names to be created

Description
Save the current report as a MRRML(Miraero Markup language) file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.

Example
function SaveAsMrrmlFile_clicked()
{
var ret = Rdviewer.SaveAsMrrmlFile ("C:\\mymy\\a.mrrml"); // Save as a MRRML file
alert (ret);
}

127

Appendix . Report Designer OCX Methods, Properties, Events

4.1.43. SaveAsPdfFile
Definition
boolean SaveAsPdfFile(BSTR PdfFileName);

Argument
PdfFileName : PDF file names to be created

Description
Save the current report as a PDF file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.

Example
function SaveAsPdfFile_clicked()
{
var ret = Rdviewer.SaveAsPdfFile ("C:\\mymy\\a.pdf"); // Save as a PDF file
alert (ret);
}

128

Appendix . Report Designer OCX Methods, Properties, Events

4.1.44. SaveAsPptFile
Definition
boolean SaveAsPptFile(BSTR PPTFileName);

Argument
PPTFileName : PPT file names to be created

Description
Save the current report as a PPT file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.

Example
function SaveAsPptFile_clicked()
{
var ret = Rdviewer.SaveAsPptFile ("C:\\mymy\\a.ppt"); // Save as a PowerPoint file
alert (ret);
}

129

Appendix . Report Designer OCX Methods, Properties, Events

4.1.45. SaveAsTxtFile
Definition
boolean SaveAsTxtFile(BSTR TxtFileName);

Argument
TxtFileName : TXT file names to be created

Description
Save the current report as a TXT file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.

Example
function SaveAsTxtFile_clicked()
{
var ret = Rdviewer.SaveAsTxtFile ("C:\\mymy\\a.txt"); // Save as a TXT file
alert (ret);
}

130

Appendix . Report Designer OCX Methods, Properties, Events

4.1.46. SaveAsXlsFile
Definition
boolean SaveAsXlsFile(BSTR XlsFileName);

Description
Save the current report as an Excel file.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.
Save a report as an excel file that maintains a report format or only extract data in an Excel
file.

Use the method of SetSaveExcelOption to skip the dialog box for saving options in saving
Microsoft Excel files.

Example
function SaveAsXlsFile_clicked()
{
Rdviewer.SetSaveExcelOption (2); //1-Maintain a report format, 2- Allow to change a format
var ret = Rdviewer.SaveAsXlsFile ("C:\\mymy\\a.xls"); // Save as an XLS file
alert (ret);
}

131

Appendix . Report Designer OCX Methods, Properties, Events

4.1.47. SaveAsXmlFile
Definition
boolean SaveAsXmlFile(BSTR XmlFileName, BSTR tagFileName);

Argument
XmlFileName : XML file names to be created
tagFileName : A text file having an element name information to create XML. Each row of
the file defines file information such as field name, element name. Once this method is
executed, a XML node is created by extracting the character string from a text box of filed
name or table cells.
The followings are examples of tagFileName.
Name, EmployeeName
Employees.EmployeeID, EmployeeNo.
Employees.HomePhone, Telephone
Employees.City, Name of city
Employees.Address, Address

Description
Save the current document as an XML file by extracting data. To extract data, specify an
element name in the form file or use the /rtagname option.

Example
function SaveAsXmlFile_clicked()
{
var ret = Rdviewer.SaveAsXmlFile ("C:\\mymy\\a.xml", "D:\\test50\\taginfo.txt");
alert (ret);
}

132

Appendix . Report Designer OCX Methods, Properties, Events

4.1.48. SaveAsWordFile
Definition
boolean SaveAsWordFile(BSTR WordFileName);

Argument
WordFileName : MS Word file name

Description
Current reports are saved into MS Word file.
It returns TRUE/FALSE whether the file is saved successfully or not. When finished saving,
SaveFileFinished evet generated.

Example
function SaveAsWordFile_clicked()
{
var ret = Rdviewer.SaveAsWordFile ("C:\\mymy\\a.doc"); //Save as MS Word file
alert (ret);
}

133

Appendix . Report Designer OCX Methods, Properties, Events

4.1.49. SavePage
Definition
boolean SavePage(BSTR pFileName, short nFileType, short nOpt, BSTR pPageRange);

Argument
pFileName : File names to be saved
nFileType : File formats to be saved. 1 - MRR, 2 XLS, 3 - TXT, 4 - MRRML, 5 - PDF, 6 - TIF,
7 - BMP, 8 - GIF, 9 - JPG, 11 - HWP, 15 - PPT, 16 - DOC (Available in the Professional
Version only)
nOpt : 0 current page, 1 partial page
pPageRange : Specify the range of partial pages if the value of nOpt is 1.

Description
Save partial pages of the current report as a specific file format.
Return TRUE/FALSE whether the file is saved successfully or not. The event of
SaveFileFinished occurs when saving is done.

Example
function SavePage_clicked()
{
//var ret = Rdviewer.SavePage ("C:\\mymy\\a.xls", 2, 1, "2-3"); // Save pages from 2 to 3 as
a Microsoft Excel file
var ret = Rdviewer.SavePage ("C:\\mymy\\a.pdf", 5, 0, ""); // Save the current page as a
PDF file
alert (ret);
}

134

Appendix . Report Designer OCX Methods, Properties, Events

4.1.50. SendMail
Definition
void SendMail(short nFileType);

Argument
nFileType : File formats to be saved. 1 - MRR, 2 - XLS, 4 - JPG, 8 - PDF, 9 - HWP

Description
Save a report, in the temporary directory, as a specific file format and send it as an e-mail
attachment.
The event of SaveFileFinished occurs after saving the report as a specific file format, and
then the New Message window allows to send an e-mail.

Example
function SendMail_clicked()
{
Rdviewer.SendMail (2); // Save a file as a Excel format and send it as an attachment
}

135

Appendix . Report Designer OCX Methods, Properties, Events

4.1.51. SendMailEx
Definition
void SendMailEx(BSTR strAddress, BSTR strSubject, BSTR strNoteText, BSTR
strFilename);

Argument
strAddress : Recipients E-mail address
strSubject : E-mail subjects
strNoteText : E-mail contents
strFilename : An attached file name with its extension (except its path)

Description
Save a report, in the temporary directory, as a specific file format and send it as an e-mail
attachment.
A file is created in the name of strFilename, and its format is specified by the extension of the
file name. For example, if a file name is saved as a.pdf, it is saved as a temporary file with
pdf format.
The event of SaveFileFinished occurs after saving the report as a specific file format, and
sends an e-mail. This is used for sending an e-mail promptly without popping up the New
Message window.

Example
function SendMailEx_clicked()
{
Rdviewer.SendMailEx ("hkd@m2soft.co.kr", "actual record", "actual record for the first
quarter of a year.", "a.pdf"); // Save a file as a PDF format and send it as an attachment
}

136

Appendix . Report Designer OCX Methods, Properties, Events

4.1.52. ServerPrint
Definition
boolean ServerPrint(BSTR MrdPath, BSTR Argument);

Argument
MrdPath : A path of the form file for a report
Argument : Report Arguments

Description
It is the Method for Report Designer Server to execute a report and print it out through the
printer.
Refer to the server manuals for further details such as server settings etc.

Example
function ServerPrint_clicked()
{ //1. Call MRD server for connection
Rdviewer.FileOpen ("http://m2soft.co.kr/report/test.mrd", "/rf
[http://123.123.1.6:8282/RDServer/rdagent.jsp] /rdonotreport");
//2. Print server
bRet = Rdviewer.ServerPrint ("http://www.m2soft.co.kr/ReportDesigner/test/mrd/test.mrd",
"/rv Name[Gil-dong Hong] Department[Telecommunication]Major[Telecommunication
Engineering]Minor[ ] Resident registration No.[781107-1234567] Student No.[970501] A
course of study for the teaching[0.0] Essential cultural studies[9.0] Optional cultural
studies[23.0]Essential major [3.0] Optional major[0.0] Essential second major[0.0] Optional
Second major[0.0] Thesis[0.0] Foundation[6.0] P.S.D.[41] Passed[41] Total Passed.[106.5]
G.P.A[2.60] /rf [http://www.m2soft.co.kr/ReportDesigner/test/mrd/test.txt]");
if (bRet)
alert ("success");
else {
msg = Rdviewer.GetLastErrorMsg();
alert (msg);
}
}

137

Appendix . Report Designer OCX Methods, Properties, Events

4.1.53. SetAgentUserInfo
Definition
void SetAgentUserInfo(BSTR lpUserid, BSTR lpPassword, short nEnctype);

Argument
lpUserid : User ID
lpPassword : User Password
nEnctype : Encryption options can be assigned by any combination of numerals from 0 to 10.

Description
The RDAgent server connection allows only authorized users to create a report by obtaining
a permission through the user authorization window. Once a users information is verified,
the authorization process is not required to execute a report.
Authorization information should be verified through encryption process for the protection.
Refer to Argument Encryption in the server manual for the encryption of character strings.

Example
function rdOpen() {
Rdviewer.SetAgentUserInfo ("user1", "mypass", 0); //
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/test.mrd", "/rv StartDate[200601-01] EndDate[2006-01-31]");
}

138

Appendix . Report Designer OCX Methods, Properties, Events

4.1.54. SetAppendReport
Definition
void SetAppendReport(short flag);

Argument
flag : 0 Release the Append Mode, 1 Set to Append Mode

Description
This method makes to report the multiple report into continuous page.
If flag set to 1 and call FileOpen method, the report created by adding pages continuously
without deleting the previous report file.

Example
function rdOpen() {
Rdviewer.SetAppendReport(1)
Rdviewer.FileOpen("C:\test1.mrd", "")
Rdviewer.FileOpen("C:\test2.mrd", "")
Rdviewer.FileOpen("C:\test3.mrd", "")
}

139

Appendix . Report Designer OCX Methods, Properties, Events

4.1.55. SetBackgroundColor
Definition
void SetBackgroundColor(short r, short g, short b);

Argument
Specify the RGB value.

Description
Set the background color by the RGB value.
The default color is RGB(128,128,128)

Example
function rdOpen() {
Rdviewer.SetBackgroundColor(255,255,255); // Select white for the background color
Rdviewer.SetPageLineColor(255,255,255); // Select white for the page outline
Rdviewer.ViewShowMode (2); // Move the page to the left top + Ignore the left and top
margins
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

140

Appendix . Report Designer OCX Methods, Properties, Events

4.1.56. SetCacheOption
Definition
void SetCacheOption(short flag);

Argument
flag : 0 Do not MRD caching, 1 Do MRD caching(default)

Description
This method is used to set whether perform report form file (MRD) caching or not.
If do MRD caching, downloaded from the server only when MRD file has changed, so the
performance can be enhanced. Report Designer do MRD caching in default.
If users want to down load whenever running reports without MRD caching, flag has to be
set to 0. Or, set CacheOption=0 in [Environment] section of rdviewer.ini.

Example
function SetCacheOption_clicked()
{
Rdviewer.SetCacheOption (0); //Do not MRD caching
}

141

Appendix . Report Designer OCX Methods, Properties, Events

4.1.57. SetComboboxValue
Definition
short SetComboboxValue(BSTR objname, BSTR showvalue);

Argument
objname : Variable names for combo box objects. Use & as separator to specify several
variable names for combo box objects. (Ex. gender&birthday)
showvalue : Selected values to be specified. Use & as separator to specify several variable
names for combo box objects. (Ex. male&1971/08/09)

Description
Specify selected values for combo box objects, which should be more than 1. This returns
the specified number of selected values.
The /rv Argument can be used to specify initial selected values of combo boxes.

Example
function SetComboboxValue_clicked()
{
var objname;
//objname = "gender";
//var retvalue = Rdviewer.SetComboboxValue (objname, "male");
objname = "birthday";
var retvalue = Rdviewer.SetComboboxValue (objname, "2004-1-1");
alert(retvalue); // return 1
}

142

Appendix . Report Designer OCX Methods, Properties, Events

4.1.58. SetChartPenAttr
Definition
void SetChartPenAttr(BSTR ChartVarName, long SeriesIndex, short r, short g, short b, long
penwidth);

Argument
ChartVarName : Variable names for chart objects. If NULL or 0 is given, it is applied to all of
chart objects in a report.
SeriesIndex : Series index starting from 0. If -1 is given, it is applied to all series.
r, g, b : The RGB line color of BORDER
penwidth : The width of BORDER(WIDTH)

Description
This method is to specify the line color and width of a specified chart objects series
BORDER.

Example
function SetChartPenAttr_clicked()
{
Rdviewer.SetChartPenAttr ("MyChart", 0, 0, 255, 0, 3); //MyChart Specify the line color and
width of the first chart series BORDER
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

143

Appendix . Report Designer OCX Methods, Properties, Events

4.1.59. SetDefaultPenAttr
Definition
Void SetDefaultPenAttr(short penstyle, short penwidth, short r, short g, short b);

Argument
penstyle : Line style. 2(

), 3(

), 4(

), 5(HTML line)

penwidth : Line width 0(0.0), 1(0.5), 2(1.0), 3(1.5), 4(2.0), 5(2.5), 6(3.0), 7(3.5), 8(4.0), 9(5.0)
r, g, b : RGB line color

Description
Modify the initial value of line properties, which is used in drawing objects in the viewer edit
mode.
The default value of line properties: line style-none, line width-1.0, line color-black, RGB 0,0,0).

Example
function SetDefaultPenAttr_clicked()
{
Rdviewer.SetDefaultPenAttr (2, 4, 255, 0, 0); //2.0 of thickness with red dotted line is
standard.
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\client2.mrd", "/reditmode");
}

144

Appendix . Report Designer OCX Methods, Properties, Events

4.1.60. SetDefaultPlaneAttr
Definition
Void SetDefaultPlaneAttr(short planehatch, short planestyle, short r, short g, short b);

Argument
planehatch : Hatching style. 0(
4(

), 5(

), 1(
), 6(

), 2(

), 3(

),

planestyle : Tranparency : 0 - Transparent, 1 - Opaque


r, g, b : RGB hatching color

Description
Modify the initial value of area properties, which is used in drawing objects in the viewer edit
mode. The default value of area properties consists of area style (
transparency (opaque), and area color (white RGB - 255,255,255).

),

If an area style is not specified with the default value, the color of an area is not applied.

Example
function SetDefaultPlaneAttr_clicked()
{
Rdviewer.SetDefaultPlaneAttr (0, 0, 0, 0, 255); // standard
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\client2.mrd", "/reditmode");
}

145

Appendix . Report Designer OCX Methods, Properties, Events

4.1.61. SetFocusToChart
Definition
void SetFocusToChart(BOOL bFocus);

Argument
bFocus : 0 or 1

Description
To activate chart objects in a report, double-click the mouse, thereby having all of chart
objects keep activated.

Example
function rdOpen() {
Rdviewer.SetFocusToChart(1);
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\stock amount.mrd", "");
}

146

Appendix . Report Designer OCX Methods, Properties, Events

4.1.62. SetHttpAccessType
Definition
void SetHttpAccessType(short bAccess);

Argument
bAccess : 0 or 1

Description
In order to access a server through a user PC, it is to specify HTTP protocol options to be
used. If bAccess is 0, an Internet connection of the user PC is applied. If bAccess is 1, it is
to connect directly.
In some cases of configuring a proxy server on user PC, it is required to connect directly.

Example
function rdOpen() {
Rdviewer.SetHttpAccessType(1);
Rdviewer.FileOpen (http://myserver/reports/test.mrd, /rf
[http://200.100.1.1:8282/RDServer/rdagent.jsp] /rp [Seoul] [] /rop /rwait);
}

147

Appendix . Report Designer OCX Methods, Properties, Events

4.1.63. SetKindOfParam
Definition
void SetKindOfParam (short opt);

Argument
opt : Encryption options can be assigned by any combination of numerals from 0 to 10.

Description
This method is to specify the encryption type of Arguments.
To transfer the encrypted Arguments when the method of FileOpen is called, use the
methods of SetArgumentEncrypt and SetKindOfParam are used at the same time. The
method of SetArgumentEncrypt notifies that the Arguments are encrypted and the method of
SetKindOfParam shows the encryption type used.

Example
The followings are samples of calling the method of FileOpen to encrypt Arguments by
means of using enc.jar.
<%@ page import="java.io.*,java.util.*,enc.*" %>
<%
int type =2;
String mrd_filepath = "http://192.168.1.200/RDServer/reports/client2.mrd";
String mrd = new String(C.process(mrd_filepath,type));

String mrd_param = "/rp Seoul [Sales Reps]";


String param = new String(C.process(mrd_param,type));
%>
<html>
<head><title>receiving orders per employee</title>
<META name=VI60_defaultClientScript content=JavaScript>
</head>
<body leftmargin=1px rightMargin=1px topmargin=1 marginwidth=1 marginheight=1

148

Appendix . Report Designer OCX Methods, Properties, Events

onLoad="javascript:rdOpen()" style="overflow-x:hidden;overflow-y:hidden">

<SCRIPT LANGUAGE = JavaScript>


function rdOpen() {
Rdviewer.SetBackgroundColor(255,255,255);
Rdviewer.AutoAdjust=0;
Rdviewer.SetArgumentEncrypt(1);
Rdviewer.SetKindOfParam(<%=type%>);
Rdviewer.SetReportDialogInfo(1,"","",1,"","");
Rdviewer.FileOpen("<%=mrd%>","<%=param%>");
}
</SCRIPT>
<!CALLING RDOCX CONTROL -->
<script src="embeded.js"> </script>
</body>
</html>

149

Appendix . Report Designer OCX Methods, Properties, Events

4.1.64. SetMessageboxShow
Definition
void SetMessageboxShow(short nOpt);

Argument
nOpt : 0-Show None,1-Show Error,2-Show Error & Warning,3-Show All(Error & Warning &
Info)

Description
Control the message boxes that appear in the process of executing a report.
The default value of nOpt is 3.

Example
function rdOpen() {
Rdviewer.SetMessageboxShow(1); // Print out error messages only
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/test.mrd", "/rv StartDate[200601-01] EndDate[2006-01-31]");
}

150

Appendix . Report Designer OCX Methods, Properties, Events

4.1.65. SetMsgTitle
Definition
void SetMsgTitle(BSTR titlestring);

Argument
titlestring : Titles for message boxes

Description
Specify the title strings of message boxes that appear in the process of executing a report.

Example
function rdOpen() {
Rdviewer.SetMsgTitle("My Message Window");
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/test.mrd", "/rv StartDate[200601-01] EndDate[2006-01-31]");
}

151

Appendix . Report Designer OCX Methods, Properties, Events

4.1.66. SetNodataObjFile
Definition
boolean SetNodataObjFile(BSTR MrdFName);

Argument
MrdFName : A path for the form file of a report, if there is no inquired data.

Description
Show the form file of a report transferred by an Argument, if there is no inquired data after
executing the report.

Example
function rdOpen() {
Rdviewer.SetNodataObjFile("http://m2soft.co.kr/report/mrd/nodata.mrd");
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps]");
}

152

Appendix . Report Designer OCX Methods, Properties, Events

4.1.67. SetNoDataDialogInfo
Definition
void SetNoDataDialogInfo(short bDlgShow, BSTR szDlgMessage, BSTR szDlgTitle);

Argument
bDlgShow : 0-Hide the information window, 1-Display the information window
szDlgMessage : Character strings of the information window
szDlgTitle : Titles of the information window

Description
If the inquired data is not found, the information window of Cant find the data. appears. It is
the method either to hide such information window or to customize character strings of dialog
boxes.

Example
function SetNoDataDialogInfo_clicked()
{
//Rdviewer.SetNoDataDialogInfo (0, "", ""); // No data. Hide the message window of Data
not found.
Rdviewer.SetNoDataDialogInfo (1, "There is no inquired data.", "Alert"); // No data.
Customize the message window of Data not found Rdviewer.FileOpen
("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}
}

153

Appendix . Report Designer OCX Methods, Properties, Events

4.1.68. SetNoPrintNoData
Definition
void SetNoPrintNoData(short flag);

Argument
flag : 0 or 1

Description
If a report has no inquired data, there is no printing job even when the method of CMPrint is
called. 1 is transferred as an Argument value.

Example
function rdOpen() {
Rdviewer.SetNoPrintNoData(1); // Do not print if there is no inquired data
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
Rdviewer.CMPrint();
}

154

Appendix . Report Designer OCX Methods, Properties, Events

4.1.69. SetPageColor
Definition
void SetPageColor(short r, short g, short b);

Description
Define the color of a page by RGB value.
The default color of a page is white RGB(255,255,255).

Example
function rdOpen() {
Rdviewer.SetPageColor(240, 240, 240); //Specify page color
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

155

Appendix . Report Designer OCX Methods, Properties, Events

4.1.70. SetPageLineColor
Definition
void SetPageLineColor(short r, short g, short b);

Description
Define the color of a page frame by RGB value.
The default color of a page frame is white RGB(255,255,255).

Example
function rdOpen() {
Rdviewer.SetBackgroundColor(255,255,255); // Define the background color of pages as
white
Rdviewer.SetPageLineColor(255,255,255); //Defines the page frame as white
Rdviewer.ViewShowMode (2); // Move pages to the upper left + Ignore the left and upper
margins
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

156

Appendix . Report Designer OCX Methods, Properties, Events

4.1.71. SetPageScroll
Definition
void SetPageScroll(short flag);

Description
If the value of flag Argument is 0, it is unable to scroll or move around pages by using a
mouse wheel.
It is the method to suppress the functions of a mouse wheel which allows users to scroll or
move around pages.

Example
function rdOpen() {
Rdviewer.SetPageScroll(0); // Do not scroll pages by using a mouse wheel
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

157

Appendix . Report Designer OCX Methods, Properties, Events

4.1.72. SetArgumentEncrypt
Definition
void SetArgumentEncrypt(BOOL bEncrypt);

Argument
bEncrypt : 0 - Arguments without encryption, 1 Arguments with encryption

Description
Specify whether transferred Arguments are encrypted or not, when the method of FileOpen
is called.
To transfer encrypted Arguments when the method of FileOpen is called, use the methods of
SetArgumentEncrypt and SetKindOfParam at the same time. The method of
SetArgumentEncrypt notifies that Arguments are encrypted, and the method of
SetKindOfParam shows the encryption type used.

Example
The followings are samples of calling the method of FileOpen to encrypt Arguments by using
enc.jar
.<%@ page import="java.io.*,java.util.*,enc.*" %>
<%
int type =2;
String mrd_filepath = "http://192.168.1.200/RDServer/reports/client2.mrd";
String mrd = new String(C.process(mrd_filepath,type));

String mrd_param = "/rp Seoul [Sales Reps]";


String param = new String(C.process(mrd_param,type));
%>
<html>
<head><title>Receiving orders per employee</title>
<META name=VI60_defaultClientScript content=JavaScript>
</head>

158

Appendix . Report Designer OCX Methods, Properties, Events

<body leftmargin=1px rightMargin=1px topmargin=1 marginwidth=1 marginheight=1


onLoad="javascript:rdOpen()" style="overflow-x:hidden;overflow-y:hidden">
<SCRIPT LANGUAGE = JavaScript>
function rdOpen() {
Rdviewer.SetBackgroundColor(255,255,255);
Rdviewer.AutoAdjust=0;
Rdviewer.SetArgumentEncrypt(1);
Rdviewer.SetKindOfParam(<%=type%>);
Rdviewer.SetReportDialogInfo(1,"","",1,"","");
Rdviewer.FileOpen("<%=mrd%>","<%=param%>");
}
</SCRIPT>
<!CALLING RDOCX CONTROL -->
<script src="embeded.js"> </script>
</body>
</html>

159

Appendix . Report Designer OCX Methods, Properties, Events

4.1.73. SetParamValue
Definition
void SetParamValue(BSTR ParamName, BSTR ParamValue);

Argument
ParamName : /rp or /rv variable names
ParamValue : variable values

Description
This method is to specify variable values of /rp or /rv variable.
It can be used instead of using the /rp or /rv Argument, if variable values include [ and/or ]
character.

Example
function rdOpen() {
Rdviewer.SetParamValue ("$1", "Seoul");
Rdviewer.SetParamValue ("$2", "Sales Reps. [Team 1]");
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", ""); //"/rp [Seoul] [Sales
Reps. [Team 1]]" will cause error.
}

160

Appendix . Report Designer OCX Methods, Properties, Events

4.1.74. SetPartSaveDialog
Definition
void SetPartSaveDialog(short nOpt, BSTR szPart);

Argument
nOpt : 0-current page , 1-partial page
szPart - Specify the range of partial pages if the value of nOpt is 1.

Description
This method is to specify the default value of the dialog box for saving partial pages.

Example
function SetpartsaveDialog_clicked()
{
Rdviewer.SetpartsaveDialog (1, "1, 3-7"); // Parts of pages, 3-7
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

161

Appendix . Report Designer OCX Methods, Properties, Events

4.1.75. SetPrint
Definition
void SetPrint (short pageNum, short pageRange, short startPage, short endPage);

Argument
pageNum : Number of print copies
pageRange : Print range setting. 1(all), 2(current), 3(partial)
startPage : Set the starting page to print in parts,
endPage : Set the last page to print in parts

Description
Specify an initial value of the Print dialog box. Use the method of CMPrint() or /rop
Argument options without opening the Print dialog box.

Example
function rdOpen() {
Rdviewer.SetPrint(2, 3, 1, 2); // 2 pages, , pages in parts, pages from 1 to 2
Rdviewer.SetPrint2(9, 2, 0, 100); //A3 paper, 2-page group printing, printing zoom ratio
100%
Rdviewer.SetPrint3(2); // data only
Rdviewer.SetPrint4(0, 1, 0); // paper center-justified
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rop /rwait /rp
[Seoul] [Saes Reps.]");}

162

Appendix . Report Designer OCX Methods, Properties, Events

4.1.76. SetPrint2
Definition
void SetPrint2(short pageSize, short pageType, BOOL pageFit, short pageZoom);

Argument
pageSize : Page size. 0-A3, 1-A4, 2-B4, 3-B5, 4-LETTER, 5-136, 6-80, 7-A1, 8- A2, 9-A5
pageType : Page group printing. 1-1 page, 2-2 pages, 4-4 pages, 6-6 pages, 8-8 pages
pageFit : Adjustment to pages. 0-Set the printing zoom ratio, 1-Adjustto the pages
pageZoom : Specify the printing zoom ratio when 0 is set to the pageFit Argument.(Unit.%)

Description
Specify the initial value of Print dialog box. The specified printing option is applied in the
case of using the method of CMPrint() or /rop Argument options without opening the Print
dialog box.
Basically, a page is adjusted to fit the page size of a designed report. It is the method to print
a page with a different size of paper.

Example
function rdOpen() {
Rdviewer.SetPrint(2, 3, 1, 2); // 2 pages, pages in parts, pages from 1 to 2
Rdviewer.SetPrint2(9, 2, 0, 100); //A3 paper, 2-page group printing, printing zoom ratio
100%
Rdviewer.SetPrint3(2); // data only
Rdviewer.SetPrint4(0, 1, 0); // paper center-justified
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rop /rwait /rp
[Seoul] [Sales Reps.]");
}

163

Appendix . Report Designer OCX Methods, Properties, Events

4.1.77. SetPrint3
Definition
void SetPrint3(short printOption);

Argument
printOption : Printing options. 0-All, 1-Objectonly, 2-Data only

Description
Specify the initial value of Print dialog box. The specified printing option is applied in the
case of using the method of CMPrint() or /rop Argument options without opening the Print
dialog box.

Example
function rdOpen() {
Rdviewer.SetPrint(2, 3, 1, 2); // 2 pages, pages in parts, pages from 1 to 2
Rdviewer.SetPrint2(9, 2, 0, 100); //A3 paper, 2-page group printing, printing zoom ratio
100%
Rdviewer.SetPrint3(2); // data only
Rdviewer.SetPrint4(0, 1, 0); // paper center-justfied
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rop /rwait /rp
[Seoul] [Sales Reps.]");
}

164

Appendix . Report Designer OCX Methods, Properties, Events

4.1.78. SetPrint4
Definition
void SetPrint4(short BlackWhite, short Center, short BothPrint);

Argument
BlackWhite : Print in a black/white copy. 0 or 1
Center : Justify a page in the center. 0 or 1
BothPrint : Print both faces of paper. 0 or 1

Description
Specify the initial value of Print dialog box. The specified printing option is applied in the
case of using the method of CMPrint() or /rop Argument options without opening the Print
dialog box.

Example
function rdOpen() {
Rdviewer.SetPrint(2, 3, 1, 2); // 2 pages, pages in parts, pages from 1 to 2
Rdviewer.SetPrint2(9, 2, 0, 100); //A3 paper, 2-page group printing, printing zoom ratio 100%
Rdviewer.SetPrint3(2); // datat only
Rdviewer.SetPrint4(0, 1, 0); // paper center-justified
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rop /rwait /rp
[Seoul] [Sales Reps]");
}

165

Appendix . Report Designer OCX Methods, Properties, Events

4.1.79. SetPrintInfo
Definition
void SetPrintInfo(BSTR pPrnDrvName, short nNumCopy, short bOneBook, short
showdlglevel);

Argument
pPrnDrvName : The name of printer driver
nNumCopy

: The number of printing copies

bOneBook

: 1-Print by copy, 2-Print by page

showdlglevel : 1-Hide the DB access dialog only, 2-Hide the status dialog as well, 3-Hide
the Print dialog as well, 4-Hide the PrintCancel dialog as well

Description
Specify the initial value of Print dialog box. The specified printing option is applied in the
case of using the method of CMPrint() or /rop Argument options without opening the Print
dialog box.

Example
function CMPrint_clicked()
{
Rdviewer.SetPrintInfo ("HP LaserJet 8150 PCL 6", 2, 1, 4); // the name of printer drive: HP
LaserJet 8150 PCL 6, the number of copies:2, print by copy:1, Hide all dialog boxes popping
up during printing: 4
Rdviewer.CMPrint (); // Start printing}

166

Appendix . Report Designer OCX Methods, Properties, Events

4.1.80. SetPrinttoFile
Definition
boolean SetPrinttoFile(BSTR FName);

Argument
FName : PostScript file or PCL file name

Description
This method is to save a report as a local file as well as to print it out at the same time. The
report is saved as PostScript file or PCL file which is supported by the printer driver. It is
equivalent to the use of /rprnfile Argument.

Example
function SetPrinttoFile_clicked()
{
Rdviewer.SetPrinttoFile ("c:\\test.prn");
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales
Reps.]");}

167

Appendix . Report Designer OCX Methods, Properties, Events

4.1.81. SetRData
Definition
void SetRData(BSTR dataset);

Argument
dataset : Data set which is required for executing a report

Description
It is used in the reports of both FILE and XMLFILE access methods to specify the data set
which is required to execute a report.
Its functions are as same as /rdata Arguments and even [, ] characters which is unavailable
in /rdata Arguments can be used as data.
cf. There are two kinds of Arguments such as /rf and /rdata to specify the data source in the
reports of FILE and XMLFILE access methods.

Example
function rdOpen() {
var xmldata = "<?xml version=\"1.0\" encoding=\"euc-kr\"?><books><book
isbn=\"1861004370\"><author>Sakhr Youness et al [No.1] </author><title>Beginning Java
Databases</title><publisher>Wrox Press Inc.</publisher></book></books>";
Rdviewer.SetRData (xmldata);
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/books.mrd", "/rv fromdate[200601-01] todate[2006-01-31]");
}

168

Appendix . Report Designer OCX Methods, Properties, Events

4.1.82. SetRemakeReport
Definition
void SetRemakeReport(short flag);

Argument
flag : 0 or 1

Description
It is used in printing a report generated with the option of One Page Report(/ronepgrpt), and
specifying the printing options of whether to print the contents to scale to the paper size, or
to print it in separate pages. It should be used after the method of FileOpen is called
If the Argument value of a report is 1, it is printed out in separated pages. It is equivalent to
the use of /rremakerpt Arguments.

Example
function SetRemakeReport_clicked()
{
Rdviewer.SetRemakeReport (1); // /ronepgrpt In case of a report having Arguments, print in
separate pages.
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\sales per client.mrd", "/ronepgrpt");
}

169

Appendix . Report Designer OCX Methods, Properties, Events

4.1.83. SetReportDialogInfo
Definition
void SetReportDialogInfo(short bDBConDlgShow, BSTR pDBConMsg, BSTR pDBConTitle,
short bStatusDlgShow, BSTR pStatusDlgMsg, BSTR pStatusDlgTitle);

Argument
bDBConDlgShow : 0- Hide the database access dialog box, 1-Display the database access
dialog box (Default)
pDBConMsg : Display contents on the database access dialog box
pDBConTitle : Titles of the database access dialog box
bStatusDlgShow : 0-Hide the status dialog box, 1-Display the status dialog box (Default)
pStatusDlgMsg :Display contents on the status dialog box
pStatusDlgTitle : Titles of the status dialog box

Description
This method is to control the status dialog box which displays a dialog of Accessing
database or shows the current page.

Example
function SetReportDialogInfo_clicked()
{
Rdviewer.SetReportDialogInfo (1,"make a connection to server", "connecting to server", 1,
"creating a report", "creating a report");
Rdviewer.FileOpen ("C:\\Program Files\\M2Soft\\Report Designer 5.0\\Examples\\Basic
report\\Table\\sales per client.mrd", "/ronepgrpt /rremakerpt");
}

170

Appendix . Report Designer OCX Methods, Properties, Events

4.1.84. SetSaveDialog
Definition
void SetSaveDialog(BSTR szPath, BSTR szName, short filetype);

Argument
szPath : Saving locations
szName : File names
filetype : File formats. 1 - MRR, 2 XLS, 3 - TXT, 4 - MRRML, 5 - PDF, 6 - TIF, 7 - BMP, 8 GIF, 9 - JPG, 11 - HWP, 15 - PPT, 16 - DOC, 20 - All Files(*.*) (Only available in the
Professional Version)

Description
Set the initial value of Save As dialog box.

Example
function SaveAsDialog_clicked()
{
Rdviewer.SetSaveExcelOption (1); //1- Maintain formats when saving as Microsoft Excel
files, 2- Allow to change formats.
Rdviewer.SetSaveDialog ("c:\\MyFolder\\", "a.xls", 2); // Set the initial value of the Save As
dialog box location, file names, file formats
var ret = Rdviewer.SaveAsDialog (); // Save the current document with displaying the Save
As dialog box.
alert (ret);
}

171

Appendix . Report Designer OCX Methods, Properties, Events

4.1.85. SetSaveDialogEx
Definition
void SetSaveDialogEx(BSTR szPath, BSTR szName, BSTR szExtList, BSTR szDefaultExt);

Argument
szPath : Saving location
szName: A file name (excluding its extension)
szExtList : The list of file formats to be added in combo box items for file formats. @ is used
as separator.(Ex.mrr@xls@bmp@tif). If the value is , all available file format are listed, and
if not, they are ignored.
szDefaultExt : The default value of file formats to be displayed in combo boxes for file
formats. (Ex. tif) If the value is "", the first file format in the list is specified as the default
value.

Description
Set the initial value of Save As dialog box.
Expand the method of SetSaveDialog that can even specify the list of combo boxes for file
formats.

Example
function SetSaveDialogEx_clicked()
{
Rdviewer.SetSaveDialogEx ("c:\\MyFolder\\", "report1",
"xls@pdf@bmp@tif@txt@mrrml@gif@jpg@ppt@doc", "pdf");
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
}

172

Appendix . Report Designer OCX Methods, Properties, Events

173

Appendix . Report Designer OCX Methods, Properties, Events

4.1.86. SetSaveExcelOption
Definition
void SetSaveExcelOption(short flag);

Argument
flag : 0 Display the dialog box of saving options for Excel files when saving, 1 Maintain a
report format without displaying the dialog box, 2 Allow to change a report format without
displaying dialog box.

Description
Specify whether a format is maintained or not when saving as an excel file.
It is equivalent to the use of /rxlsopt Arguments.

Example
function SetSaveExcelOption_clicked()
{
Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/sample.mrd", "/rp [Seoul] [Sales Reps.]");
Rdviewer.SetSaveExcelOption (1); //1-Keep a report format, 2- Allow to change a format.
var ret = Rdviewer.SaveAsXlsFile ("C:\\mymy\\a.xls"); // Save as an XLS file.
}

174

Appendix . Report Designer OCX Methods, Properties, Events

4.1.87. SetSaveTiffOption
Definition
void SetSaveTiffOption(short nWidth, short nHeight, short nXDPI, short nYDPI, BOOL
fLsb2Msb);

Argument
nWidth : Horizontal width
nHeight : Vertical height
nXDPI : Horizontal Resolution
nYDPI : Vertical Resolution
fLsb2Msb : Fill order. 0 - msb2lsb, 1 - lsb2msb // This part is not applied.

Description
This method is to set the option to save a file as a Tiff file.

175

Appendix . Report Designer OCX Methods, Properties, Events

4.1.88. SetSessionInfo
Definition
void SetSessionInfo(BSTR SessionInfo);

Description
This method is to execute a report for RDAgent server connection, which is required to use
several RDAgent servers. Refer to the server manual for further details.

176

Appendix . Report Designer OCX Methods, Properties, Events

4.1.89. SetSpoolPage
Definition
BOOL SetSpoolPage(short spoolpage);

Argument
spoolpage : The number of pages to be sent to spool files.

Description
When printing, create spool files as many as specified files.

177

Appendix . Report Designer OCX Methods, Properties, Events

4.1.90. SetTextboxValue
Definition
short SetTextboxValue(BSTR objname, BSTR value);

Argument
Objname : Variable names for text box objects. To specify variable names for several text
box objects, use & as separator.
(ex.name&jumin_no&id&password&company&title&address&telno)
szValue : Specify character strings for text boxes. To specify character strings to several text
box objects, use & as separator.(Ex. HONG GIL DONG &710809-2642123&2223333&1&***&m2soft&manager& Yangjae-dong &222-3333)

Description
This method is to write the values of character strings in text box objects or table cells.
The values of character strings can be written in several objects, and it returns the number of
character strings to be written.

Example
function SetTextboxValue_clicked()
{
//Rdviewer.SetTextboxValue ("name", "HONG GIL DONG");
//Rdviewer.SetTextboxValue ("jumin_no", "710809-2642123");
//Several text box value applied at the same time
var ret = Rdviewer.SetTextboxValue
("name&jumin_no&id&password&company&title&address&telno", "HONG GIL
DONG&710809-2642123&1&***&m2soft&manager&Yangjae-dong&222-3333");
alert(ret);
}

178

Appendix . Report Designer OCX Methods, Properties, Events

4.1.91. SetTifCompressType
Definition
void SetTifCompressType(short flag);

Argument
flag : 0 - CCITT Group 3 fax encoding method used(Default), 1 - CCITT Group 4 fax
encoding method used

Description
This method is to specify the encoding(Compression) method in the case of saving a file as
a Tif file format.

Example
function SetTifCompressType_clicked()
{
Rdviewer.SetTifCompressType (1);
var ret = Rdviewer.SaveAsImagefile ("C:\\mymy\\a.tif", 0); // Save as a TIF image file.}

179

Appendix . Report Designer OCX Methods, Properties, Events

4.1.92. SetTifImageScale
Definition
void SetTifimageScale(short gray);

Argument
gray : 0 Black and white(Default), 1 - GrayScale, 2 - Color

Description
Specify saving options of Tif file formats.

Example
function SetTifimageScale_clicked()
{
Rdviewer.SetTifimageScale (1);
var ret = Rdviewer.SaveAsImagefile ("C:\\mymy\\a.tif", 0); // Save as a TIF imege files
}

180

Appendix . Report Designer OCX Methods, Properties, Events

4.1.93. SetTrace
Definition
void SetTrace(short nTraceOpt, BSTR szTraceLogFileName);

Argument
nTraceOpt : 0-Off,1-Error,2-Error & Warning,3-Error & Warning & Info (Default)
szTraceLogFileName : A log file name including a path.(Excluding its extension) If is given,
the default value of c:\\ rdvlog is applied.

Description
Save various messages as log files, which are displayed in process of executing a report.
When trace=true is set to the file for environment setting (rdviewer50.ini), a log file including
the name of szTraceLogFileName is created. A log file name is created as
TraceLogFileName + date + ".log".

Example
function rdOpen() {
Rdviewer.SetTrace(2, "c:\\rdlogs\\rdlog"); //rdlog_date.log file is formats, trace=true is set on
Environment setup file(rdviewer50.ini).
var xmldata = "<?xml version=\"1.0\" encoding=\"euc-kr\"?><books><book
isbn=\"1861004370\"><author>Sakhr Youness et al [No.1] </author><title>Beginning Java
Databases</title><publisher>Wrox Press Inc.</publisher></book></books>";
Rdviewer.SetRData (xmldata); //return dataset
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/books.mrd", "/rv fromdate[200601-01] todate[2006-01-31]");
}

181

Appendix . Report Designer OCX Methods, Properties, Events

4.1.94. ShowChartMenu
Definition
void ShowChartMenu();

Description
Display the menu item of Change a chart on the pop-up menu.
When executing a report including chart objects, click the right button of a mouse to see the
menu item of Change a chart. The method of HideChartMenu hides the menu item of
Change a chart and the method of ShowChartMenu shows the menu item.

Example
function ShowChartMenu_clicked()
{
Rdviewer.ShowChartMenu ();
}

182

Appendix . Report Designer OCX Methods, Properties, Events

4.1.95. ShowIndexTree
Definition
void ShowIndexTree(short flag);

Argument
flag : 0 Hide the project window, 1 Display the project window, create a table of contents,
2 Display the project window

Description
This method is to hide/display the project window or to create the contents tree.

Example
function ShowIndexTree_clicked()
{ Rdviewer.ShowIndexTree (1); }

183

Appendix . Report Designer OCX Methods, Properties, Events

4.1.96. ShowMemoLine
Definition
void ShowMemoLine(short flag);

Description
It is used in hiding a dotted line, which represents a memo object is connected with the
previous page in case that the mapped data is too large to fit in the specified cell for the
memo object and it continues to the next page.

Example
function ShowMemoLine_clicked()
{
Rdviewer.ShowMemoLine (0);
var ret = Rdviewer.FileOpen("http://m2soft.co.kr/report/mrd/books.mrd", "/rv fromdate[200601-01] todate[2006-01-31]");
}

184

Appendix . Report Designer OCX Methods, Properties, Events

4.1.97. ShowPopupMenu
Definition
void ShowPopupMenu(short index);

Argument
Index : 0 All of the pop-up menu, 1 Next/Previous page, 2 Zoom-in/Zoom-out, 3 - Print,
4 Save a file, 5 Change a chart, 6 Show the tree management window, 7
Previous/Next document, 8 Attach to E-mail, 9 Save parts of pages

Description
Show all of the pop-up menus or specified items.

Example
Rdviewer.ShowPopupMenu (0);

185

Appendix . Report Designer OCX Methods, Properties, Events

4.1.98. ShowScrollBar
Definition
void ShowScrollBar(short flag);

Argument
flag : 0 View the horizontal scroll bar, 1 View the vertical scroll bar, 3 View both
toolbars.

Description
This method is to show the horizontal/vertical scroll bar.
It is used in hiding the scroll bar in the first page but showing it from the second page. To
hide the scroll bar, use the method of HideScrollBar.

Example
function ShowScrollBar_clicked()
{ Rdviewer.ShowScrollBar (3); }

186

Appendix . Report Designer OCX Methods, Properties, Events

4.1.99. ShowStatusBar
Definition
void ShowStatusBar();

Description
Use a method of HideStatusBar to see the hidden status bar.

Example
function ShowStatusBar_clicked()
{
Rdviewer.ShowStatusBar (); // Show the status bar.
}

187

Appendix . Report Designer OCX Methods, Properties, Events

4.1.100. ShowToolBar
Definition
void ShowToolBar();

Description
Display the hidden toolbars by using a method of HideToolBar.

4.1.101. ShowTreeMenu

188

Appendix . Report Designer OCX Methods, Properties, Events

Definition
void ShowTreeMenu();

Description
Show the Tree of Contents/Documents List Window in the pop-up menu.
This method is to show the menu items hidden by a method of HideTreeMenu and it is
equivalent to setting 6 for an Argument value to a method of ShowPopupMenu.

189

Appendix . Report Designer OCX Methods, Properties, Events

4.1.102. UploadDataFile
Definition
boolean UploadDataFile(BSTR SrcFileName, BSTR DstFileName);

Argument
SrcFileName : A path for local files to upload
DstFileName : A path for server files to be uploaded

Description
This method is to upload local files to a server by executing server script.
A file created by Report Designer OCX only can be uploaded for the security reason. In other
words, a file saved by the OCX methods of Report Designer can be uploaded only.
This method can be used after executing the method of FileOpen. If the method of FileOpen
is called, /ruploadurl Arguments should be used to specify a URL of jsp server script for
uploading a file.
If a local file is deleted after uploading a file or errors occur during uploading, error messages
can be displayed in the information window. Refer to the server manual for further details.

Example
UploadDataFile("c:\\temp\\test.pdf", "/pdf/test.pdf"); //"/pdf/test.pdf" is not a physical path of
a server, and it is located under the upload directory specified by jsp or asp.

190

Appendix . Report Designer OCX Methods, Properties, Events

4.1.103. UploadDataFileEx
Definition
BOOL UploadDataFileEx(BSTR SrcFileName, BSTR DstFileName, BSTR szuploadURL);

Argument
SrcFileName : A path of local files to upload
DstFileName : A path of servers to be uploaded
szUploadURL : a URL of jsp server script to upload a file

Description
This method is to upload a local file to a server by executing server script. It is different from
the method of UploadDataFile in transferring a URL of jsp server script for uploading a file
as the third Argument.
A file created by Report Designer OCX only can be uploaded for the security reason. In other
words, a file saved by the OCX Methods of Report Designer can be uploaded only.
If a local file is deleted after uploading a file or errors occur during uploading, error messages
can be displayed in the information window. Refer to the server manual for further details.

Example
function savetif_and_upload_clicked()
{ var success = Rdviewer.SaveAsImagefile ("c:/mymy.tif", 0);
if (success==true)
{ alert("SaveAsImagefile success !");
success = Rdviewer.UploadDataFileEx ("c:/mymy.tif", "/mydir/my.tif",
"http://myserver:8080/RDServer/uploadf.jsp");
if (success==true) {
else {

alert("UploadDataFileEx success !");

alert("UploadDataFileEx fail !");

}
else
{

alert("SaveAsImagefile fail !"); }

191

Appendix . Report Designer OCX Methods, Properties, Events

4.1.104. ViewExcel
Definition
void ViewExcel();

Description
View the current report in Microsoft Excel.

Example
function ViewExcel_clicked()
{
Rdviewer.ViewExcel ();
}

192

Appendix . Report Designer OCX Methods, Properties, Events

4.1.105. ViewExportFile
Definition
boolean ViewExportFile(short filetype);

Argument
filetype : File formats for view. 1 - MRR, 2 - XLS, 3 - TXT, 4 - MRRML, 5 - PDF, 6 - TIF, 10 XML, 15 - PPT, 16 - DOC

Description
Save the current report as a file format specified by an Argument and execute the saved file
by linking the corresponding program.

Example
function ViewExportFile_clicked()
{
Rdviewer.ViewExportFile (5); // View the current report as a PDF file.
}

193

Appendix . Report Designer OCX Methods, Properties, Events

4.1.106. ViewPDF
Definition
void ViewPDF();

Description
Save the current report as a temporary file with a PDF format and then execute it in Adobe
Reader.

Example
function ViewPdf_clicked()
{
Rdviewer.ViewPdf ();
}

194

Appendix . Report Designer OCX Methods, Properties, Events

4.1.107. ViewPpt
Definition
void ViewPpt ();

Description
Save the current report as a temporary file with a PowerPoint format and then execute it in
Microsoft PowerPoint.

Example
function ViewPpt_clicked()
{
Rdviewer.ViewPpt ();
}

195

Appendix . Report Designer OCX Methods, Properties, Events

4.1.108. ViewShowMode
Definition
void ViewShowMode(short flag);

Argument
flag : 0 The default value, 1 Move to the upper left, 2 Move to the upper left + Ignore
the left and upper margins, 3 Move upward + ignore the upper margin, 4 Move to the left
+ ignore the left margin.

Description
When executing a report, the page of a report is fitted in the RD OCX control area. The
method of ViewShowMode allows the page location and margins of the report to be adjusted
in the RD OCX control area. The margins are adjusted for the screen view only, so the report
is printed out as it is. To preview a page before printing, click the menu item of Print Preview
in the pop-up menu. Basically, a report is center-justified.

If 1 is set to the value of the method, the page moves to the upper left.

If 2 is set to the value of the method, the page moves to the upper left, and then the left and
upper margins of the page are disappeared.

If 3 is set to the value of the method, the page moves upward, and then the upper margin of
the page is disappeared.

If 4 is set to the value of the method, the page moves to the left, and then the left margin of
the page is disappeared.

196

Appendix . Report Designer OCX Methods, Properties, Events

The option of Display page margins can be specified by the document properties of the form
file for a report. In this case, the setting value specified by the method of ViewShowMode is
ignored.

Example
function ViewShowMode_clicked()
{
//Rdviewer.ViewShowMode (1); // Move to the upper left.
//Rdviewer.ViewShowMode (2); // Move to the upper left. + Ignore the left and upper margins.
//Rdviewer.ViewShowMode (3); // Move upward. + Ignore the upper margin.
Rdviewer.ViewShowMode (4); // Move to the left. + Ignore the left margin.
}

197

Appendix . Report Designer OCX Methods, Properties, Events

4.1.109. ViewWord
Definition
void ViewWord();

Description
This method makes to save the current report in MS Word file format as a temporary file and
run the saved report in MS Word program.

Example
function ViewWord_clicked()
{
Rdviewer.ViewWord ();
}

198

Appendix . Report Designer OCX Methods, Properties, Events

4.1.110. ZoomDefault
Definition
void ZoomDefault();

Description
The zoom ratio of a report is retrieved to the initial zoom ratio.

Example
function ZoomDefault_clicked()
{
Rdviewer.ZoomDefault ();
}

199

Appendix . Report Designer OCX Methods, Properties, Events

4.1.111. ZoomIn
Definition
void ZoomIn();

Description
Zoom in the screen.

Example
function ZoomIn_clicked()
{
Rdviewer.ZoomIn ();
}

200

Appendix . Report Designer OCX Methods, Properties, Events

4.1.112. ZoomOut
Definition
void ZoomOut();

Description
Zoom out the screen.

Example
function ZoomOut_clicked()
{
Rdviewer.ZoomOut ();
}

201

Appendix . Report Designer OCX Methods, Properties, Events

4.1.113. ZoomPage
Definition
void ZoomPage();

Description
Re-adjust the screen zoom ratio to fit the page size.(size adjustment)

Example
function ZoomPage_clicked()
{
Rdviewer.ZoomPage ();
}

202

Appendix . Report Designer OCX Methods, Properties, Events

4.2. Properties of Report Designer OCX

The following table shows the properties of Report Designer OCX by each category.

Category
Dialog Box

Report Information

Screen
Environment

Names of OCX Properties


MrrFilter
CurrentPageNo
IsNoData
IsSero
LastPageNo
ReportDone
AutoAdjust
ZoomRatio
IsShowDlg
ShowFirstMrd
ShowTreeWindow

The usages of properties are JavaScript samples which are used in linking with Report
Designer OCX on the Web.

203

Appendix . Report Designer OCX Methods, Properties, Events

4.2.1.

AutoAdjust Property

Definition
short AutoAdjust;

Description
It is a function to adjust the zoom ratio automatically by setting the value of 0, 1(default), or 2
If 1 is given, the zoom ratio is automatically adjusted for the whole report to be seen. If 0 is
given and the Property of the ZoomRatio is used at the same time, the zoom ratio can be
customized. If 2 is given, the zoom ratio is automatically adjusted to scale to the horizontal
page.(automatic width adjustment)

Example
Rdviewer.AutoAdjust = 0;
Rdviewer.ZoomRatio = 100;

204

Appendix . Report Designer OCX Methods, Properties, Events

4.2.2.

CurrentPageNo Property

Definition
long CurrentPageNo;

Description
Show the current page number. If any value is assigned to this Property, move to the
corresponding page.

Example
Rdviewer.CurrentPageNo = 2;
alert(Rdviewer.CurrentPageNo);

205

Appendix . Report Designer OCX Methods, Properties, Events

4.2.3.

IsNoData Property

Definition
boolean IsNoData;

Description
If there is no inquired data after executing a report, the setting value is 1.
This Property value is significant only when report-executing is completed. It is the case that
a report is executed by using /rwait Arguments which make the method of FileOpen not to
return the value until the report is done or after the event of ReportFinished occurs.
The event of NoDataReturnedFromQuery occurs if there is no inquired data.

Example
alert(Rdviewer.IsNoData);

206

Appendix . Report Designer OCX Methods, Properties, Events

4.2.4.

IsSero Property

Definition
boolean IsSero;

Description
If page direction is vertical, the setting value is 1.

Example
alert(Rdviewer.IsSero);

207

Appendix . Report Designer OCX Methods, Properties, Events

4.2.5.

IsShowDlg Property

Definition
boolean IsShowDlg;

Description
Set 1 to see the information dialog box that appears in executing a report, or set 0 to hide it.
The default value is 1.

Example
Rdviewer.IsShowDlg = 0;

208

Appendix . Report Designer OCX Methods, Properties, Events

4.2.6.

LastPageNo Property

Definition
long LastPageNo;

Description
The last page number

Example
alert(Rdviewer.LastPageNo);

209

Appendix . Report Designer OCX Methods, Properties, Events

4.2.7.

MrrFilter Property

Definition
boolean MrrFilter;

Description
If 0 is given, MRR is excluded from the list of file formats in the Save As dialog box.

Example
Rdviewer. MrrFilter = 0;

210

Appendix . Report Designer OCX Methods, Properties, Events

4.2.8.

ReportDone Property

Definition
boolean ReportDone;

Description
After report-executing is completed, the setting value becomes 1.
The event of ReportFinished occurs when report-executing is completed. Refer to the
Descriptions of Events.

Example
alert(Rdviewer.ReportDone);

211

Appendix . Report Designer OCX Methods, Properties, Events

4.2.9.

ShowFirstMrd Property

Definition
boolean ShowFirstMrd;

Description
Set 1 to execute the first report in the document list when the method of RprFileOpen is
called.

Example
Rdviewer.ShowFirstMrd = 1;

212

Appendix . Report Designer OCX Methods, Properties, Events

4.2.10.

ShowTreeWindow Property

Definition
boolean ShowTreeWindow;

Description
Set 1 to display the management window of the document list.

Example
Rdviewer. ShowTreeWindow = 1;

213

Appendix . Report Designer OCX Methods, Properties, Events

4.2.11.

ZoomRatio Property

Definition
short ZoomRatio;

Description
Customize the zoom ratio in % unit. To customize the zoom ratio, the Property value of
AutoAdjust should be 0.

Example
Rdviewer.AutoAdjust = 0;
Rdviewer.ZoomRatio = 100;

214

Appendix . Report Designer OCX Methods, Properties, Events

4.3. Events of Report Designer OCX


The following table shows events of Report Designer OCX by each category.

Type
Executing report
Report Information
Print

Save

Toolbar button

Hyperlink

Screean

OCX Event Name


DownloadFinished
FileOpenFinished
ReportFinished
NoDataReturnedFromQuery
PrintFinished
ServerPrintFinished
FileSaveAs
FileSaveAsFinished
SaveFileFinished
ViewExcelFinished
ViewPDFFinished
ViewWordFinished
FirstPageButtonClicked
FirstPageButtonFinished
LastPageButtonClicked
LastPageButtonFinished
NextDocButtonClicked
NextDocButtonFinished
NextPageButtonClicked
NextPageButtonFinished
PrevDocButtonClicked
PrevDocButtonFinished
PrevPageButtonClicked
PrevPageButtonFinished
PrintButtonClicked
PrintButtonFinished
HlinkClicked
ZoomDefault
ZoomDefaultFinished
ZoomIn
ZoomInFinished
ZoomOut
ZoomOutFinished
ZoomPage
ZoomPageFinished

The usages of Properties are JavaScript samples which are used in linking with Report
Designer OCX on Web.

215

Appendix . Report Designer OCX Methods, Properties, Events

4.3.1. DownloadFinished Event


Description
This event occurs after downloading the main query data to execute a report.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="DownloadFinished()">
<!-alert("DownloadFinished");
-->
</SCRIPT>

216

Appendix . Report Designer OCX Methods, Properties, Events

4.3.2. FileOpenFinished Event


Description
This event occurs after completing the method of FileOpen to generate a report.
Completing the method of FileOpen does not mean the completion of a report, since Report
Designer performs Idle Time & Background Processing. The event of ReportFinished
occurs when a report is completed.
If a report is generated by using /rwait Arguments, the methods of FileOpenFinished and
ReportFinished occur at the same time.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="FileOpenFinished()">
<!-alert("FileOpenFinished");
-->
</SCRIPT>

217

Appendix . Report Designer OCX Methods, Properties, Events

4.3.3. FileSaveAs Event


Description
This event occurs before opening Save As dialog box.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="FileSaveAs()">
<!-alert("FileSaveAs");
-->
</SCRIPT>

218

Appendix . Report Designer OCX Methods, Properties, Events

4.3.4. FileSaveAsFinished Event


Description
This event occurs after closing Save As dialog box.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="FileSaveAsFinished()">
<!-alert("FileSaveAsFinished");
-->
</SCRIPT>

219

Appendix . Report Designer OCX Methods, Properties, Events

4.3.5. FirstPageButtonClicked / FirstPageButtonFinished Event


Description
This event occurs before/after moving to the first page.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="FirstPageButtonClicked()">
<!-alert("FirstPageButtonClicked");
-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="FirstPageButtonFinished()">
<!-alert("FirstPageButtonFinished");
-->
</SCRIPT>

220

Appendix . Report Designer OCX Methods, Properties, Events

4.3.6. HlinkClicked Event


Description
This event occurs when clicking hyperlink objects in a report.

Argument
szTarget : String value given in the text box next to the Fire Event on Click check box in
Hyperlink Properties dialog. The value is valid only when the check box is checked.
szURL

: Objects to be linked

szParams : Arguments to be used for connection (In case of RD documents)

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="HlinkClicked(Target , URL ,
Params)">
<!-alert("Target : " + Target + "\nURL : " + URL + "\nParams : " + Params);
window.open("http://rdeng/myasp40.asp?mrdpath=" + URL + "&params=" + Params,
"_self","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes,
resizable=no, copyhistory=yes, width=800, height=600");
//window.showModalDialog("http://rdeng/myasp40.asp?mrdpath=" + URL + "&params=" +
Params, "pop","toolbar=no, location=no, directories=no, status=no, menubar=no,
scrollbars=yes, resizable=no, copyhistory=yes, width=800, height=600");
-->
</SCRIPT>

221

Appendix . Report Designer OCX Methods, Properties, Events

4.3.7. LastPageButtonClicked / LastPageButtonFinished Event


Description
This event occurs before/after moving to the last page.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="LastPageButtonClicked()">
<!--alert("LastPageButtonClicked");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="LastPageButtonFinished()">
<!--alert("LastPageButtonFinished");-->
</SCRIPT>

222

Appendix . Report Designer OCX Methods, Properties, Events

4.3.8. NextDocButtonClicked / NextDocButtonFinished Event


Description
This event occurs before/after moving to the next document.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="NextDocButtonClicked()">
<!--alert("NextDocButtonClicked");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="NextDocButtonFinished()">
<!--alert("NextDocButtonFinished");-->
</SCRIPT>

223

Appendix . Report Designer OCX Methods, Properties, Events

4.3.9. NextPageButtonClicked / NextPageButtonFinished Event


Description
This event occurs before/after moving to the next page.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="NextPageButtonClicked()">
<!--alert("NextPageButtonClicked");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="NextPageButtonFinished()">
<!--alert("NextPageButtonFinished");-->
</SCRIPT>

224

Appendix . Report Designer OCX Methods, Properties, Events

4.3.10. NoDataReturnedFromQuery Event


Description
This event occurs if there is no inquired data after generating a report.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer
EVENT="NoDataReturnedFromQuery()">
<!-alert("NoDataReturnedFromQuery");
-->
</SCRIPT>

225

Appendix . Report Designer OCX Methods, Properties, Events

4.3.11. PrevDocButtonClicked / PrevDocButtonFinished Event


Description
This event occurs before/after moving to the previous document

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="PrevDocButtonClicked()">
<!--alert("PrevDocButtonClicked");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="PrevDocButtonFinished()">
<!--alert("PrevDocButtonFinished");-->
</SCRIPT>

226

Appendix . Report Designer OCX Methods, Properties, Events

4.3.12. PrevPageButtonClicked / PrevPageButtonFinished Event


Description
This event occurs before/after moving to the previous page.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="PrevPageButtonClicked()">
<!--alert("PrevPageButtonClicked");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="PrevPageButtonFinished()">
<!--alert("PrevPageButtonFinished");-->
</SCRIPT>

227

Appendix . Report Designer OCX Methods, Properties, Events

4.3.13. PrintButtonClicked Event


Description
This event occurs before Print dialog box pops up.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="PrintButtonClicked()">
<!
alert("PrintButtonClicked");
-->
</SCRIPT>

228

Appendix . Report Designer OCX Methods, Properties, Events

4.3.14. PrintButtonFinished Event


Description
This event occurs after closing Print dialog box.

Argument
flag : 1 If clicked the confirmation button in the Print dialog box, 2 - If clicked the cancel
button in the Print dialog box.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer
EVENT="PrintButtonFinished(okcancel)">
<!-alert("PrintButtonFinished - okcancel: " + okcancel);
-->
</SCRIPT>

229

Appendix . Report Designer OCX Methods, Properties, Events

4.3.15. PrintFinished Event


Description
This event occurs after the completion of printing.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="PrintFinished()">
<!-alert("PrintFinished");
-->
</SCRIPT>

230

Appendix . Report Designer OCX Methods, Properties, Events

4.3.16. ReportFinished Event


Description
This event occurs after the completion of generating a report.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ReportFinished()">
<!-alert("creat report finished!" + "\n\n error on executing report : " + Rdviewer.IsError() + "\n
error message: \n" + Rdviewer.GetLastErrorMsg());
-->
</SCRIPT>

231

Appendix . Report Designer OCX Methods, Properties, Events

4.3.17. SaveFileFinished Event


Description
This event occurs after saving files in various file formats.

Argument
szFileName : File names created
FileType : File formats. 1 - MRR, 2 - XLS, 3 - TXT, 4 - MRRML, 5 - PDF, 6 - TIF, 7 - BMP, 8 GIF, 9 - JPG, 10 - XML, 13 - EMF, 15 - PPT, 16 - DOC

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="SaveFileFinished(szFileName,
FileType)">
<!--alert(Saved File Name : " + szFileName + " , File Format : " + type);-->
</SCRIPT>

232

Appendix . Report Designer OCX Methods, Properties, Events

4.3.18. ServerPrintFinished Event


Description
This event occurs after executing a method of ServerPrint.

Argument
successOrfail : Success or Fail. 0 Errors occur during printing ServerSide, 1 - Successfully
print ServerSide

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer
EVENT="ServerPrintFinished(successOrfail)">
<!-alert("ServerPrintFinished - successOrfail : " + successOrfail);
-->
</SCRIPT>

233

Appendix . Report Designer OCX Methods, Properties, Events

4.3.19. ViewExcelFinished Event


Description
This event occurs after viewing a file in Microsoft Excel is finished.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ViewExcelFinished()">
<!-alert("ViewExcelFinished");
-->

234

Appendix . Report Designer OCX Methods, Properties, Events

4.3.20. ViewPDFFinished Event


Description
This event occurs after viewing in PDF is finished.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ViewPDFFinished()">
<!-alert("ViewPDFFinished");
-->
</SCRIPT>

235

Appendix . Report Designer OCX Methods, Properties, Events

4.3.21. ViewWordFinished Event


Description
This event occurs after viewing completed in MS Word.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ViewWordFinished ()">
<!-alert("ViewWordFinished");
-->
</SCRIPT>

236

Appendix . Report Designer OCX Methods, Properties, Events

4.3.22. ZoomDefault / ZoomDefaultFinished Event


Description
This event occurs before/after executing a method of ZoomDefault.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomDefault()">
<!--alert("ZoomDefault");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomDefaultFinished()">
<!--alert("ZoomDefaultFinished");-->
</SCRIPT>

237

Appendix . Report Designer OCX Methods, Properties, Events

4.3.23. ZoomIn / ZoomInFinished Event


Description
This event occurs before/after zooming in the screen.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomIn()">
<!--alert("ZoomIn");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomInFinished()">
<!--alert("ZoomInFinished");-->
</SCRIPT>

238

Appendix . Report Designer OCX Methods, Properties, Events

4.3.24. ZoomOut / ZoomOutFinished Event


Description
This event occurs before/after zooming out the screen.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomOut()">
<!--alert("ZoomOut");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomOutFinished()">
<!--alert("ZoomOutFinished");-->
</SCRIPT>

239

Appendix . Report Designer OCX Methods, Properties, Events

4.3.25. ZoomPage / ZoomPageFinished Event


Description
This event occurs before/after executing a method of ZoomPage.

Example
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomPage()">
<!--alert("ZoomPage");-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=Rdviewer EVENT="ZoomPageFinished()">
<!--alert("ZoomPageFinished");-->
</SCRIPT>

240

S-ar putea să vă placă și