クライアントPCのWebブラウザから,Webサーバにアクセスして印刷データ(EPF形式ファイル)をダウンロードすると,クライアントPCのEUR Web Plug-Inによって帳票をプレビューできます。帳票はWebブラウザ上に埋め込まれて表示されます。
EUR Web Plug-Inを使用して,帳票をWebブラウザからダウンロードして出力する場合と同じです。詳細については,「3.2.5 EUR Web Plug-Inを使用して出力する」を参照してください。
印刷データ(EPF形式ファイル)のダウンロードが完了すると,EUR Web Plug-Inによって帳票がプレビューされます。
帳票のプレビュー後に帳票を出力する場合は,EUR Web Plug-InのPrintEPFメソッドを呼び出して実行します。
「3.2.5(2) Webページの設定」を参照してください。
「3.2.5(3) 起動部品の設定」を参照してください。
クライアントPCにユーザ単位インストール用とマシン単位インストール用のどちらかのダウンロードパッケージを配置して,最新のEUR Web Plug-Inを自動でインストールして帳票をプレビューします。
|
コーディング例を次に示します。
<%@ LANGUAGE="VBScript" %>
<HTML>
<HEAD>
<META http-equiv="Content-Type"
content="text/html;charset=Shift_JIS">
<TITLE>
EUR-CLP-PVX ASP Sample
</TITLE>
<%
'Webサーバの処理
Dim objEURPM
'EURPMオブジェクトの生成
Set objEURPM=Server.CreateObject("EURPM.Exec")
Dim strVersion
'EUR-CLP-PVXのバージョン取得
strVersion = objEURPM.GetPreviewAXVersion()
Dim strClassID
'EUR-CLP-PVXのクラスID取得
strClassID = objEURPM.GetPreviewAXClassID()
%>
</HEAD>
<BODY>
<Script LANGUAGE="vbScript">
<!--
'ダウンロードパッケージの格納場所の設定
Dim CabPath
CabPath = " http://xxx.xxx.xxx.xxx/cab/EURPMPreViewAX.cab"
'OBJECTタグの記述
document.Write("<object")
'Webサーバで取得したクラスIDを指定
document.Write(" classid=clsid:<%=strClassID%>")
'CAB形式ファイルのパスおよびWebサーバで取得したバージョンを指定
document.Write(" codebase=" & CabPath & "#version=<%=strVersion%>")
document.Write(" ID=EURPMPREVIEWAX")
document.Write(" width=500")
document.Write(" height=500")
document.Write(" type=application/x-oleobject>")
document.Write("<BR>")
document.Write("<param name=EPFFileURL value=http://xxx.xxx.xxx/File/EPF/sample.epf>")
document.Write("<BR>")
document.Write("<param name=LogLevel value=16>")
document.Write("<BR>")
document.Write("</object>")
document.Write("<BR>")
-->
</Script>
</BODY>
</HTML>
<%@ page import="JP.co.Hitachi.soft.EURPM.*" %>
<%@ page contentType="text/html; charset=Shift_JIS" %>
<jsp:useBean id="adapter" class="JP.co.Hitachi.soft.EURPM.EURPMAdapterForJava" scope="session" />
<HTML>
<HEAD>
<TITLE>
EUR-CLP-AX JSP Sample
</TITLE>
<%
//EUR-CLP-PVXのバージョン取得
String strVersion = adapter. getPreviewAXVersion();
//EUR-CLP-PVXのクラスID取得
String strClassID = adapter. getPreviewAXClassID();
%>
</HEAD>
<BODY>
<Script LANGUAGE="javascript">
<!--
//ダウンロードパッケージの格納場所の設定
var CABPath; // CAB形式ファイルの格納場所
CabPath = "http://xxx.xxx.xxx.xxx/cab/EURPMPreViewAX.cab";
//OBJECTタグの記述
document.write("<object");
//Webサーバで取得したクラスIDを指定
document.write(" classid=clsid:<%=strClassID%>");
//CAB形式ファイルのパスおよびWebサーバで取得したバージョンを指定
document.write(" codebase=" + CabPath + "#version=<%=strVersion%>");
document.write(" ID=EURPMPREVIEWAX");
document.write(" width=500");
document.write(" height=500");
document.write(" type=application/x-oleobject>");
document.write("<BR>");
document.write("<param name=EPFFileURL value=http://xxx.xxx.xxx/File/EPF/sample.epf>");
document.write("<BR>");
document.write("<param name=LogLevel value=16>");
document.write("<BR>");
document.write("</object>");
document.write("<BR>");
-->
</Script>
</BODY>
</HTML>
同一システム内のクライアント環境が,ユーザ単位インストールが可能な環境と,それ以外の環境(マシン単位インストールが可能な環境)が混在している場合に,クライアントPCにユーザ単位インストール用とマシン単位インストール用の両方のダウンロードパッケージを配置して,最新のEUR Web Plug-In自動でインストールして帳票をプレビューします。
|
コーディング例を次に示します。
<%@ page import="JP.co.Hitachi.soft.EURPM.*" %>
<%@ page contentType="text/html; charset=Shift_JIS" %>
<jsp:useBean id="adapter" class="JP.co.Hitachi.soft.EURPM.EURPMAdapterForJava" scope="session" />
<HTML>
<HEAD>
<TITLE>
EUR Web Plug-In Preview JSP Sample
</TITLE>
<%
//EUR Web Plug-In Previewのバージョン取得
String strVersion = adapter.getPreviewAXVersion();
%>
</HEAD>
<BODY>
<Script LANGUAGE="javascript">
<!--
var CABType; // フラグ
var CABPath; // CAB形式ファイルの格納場所
var ClassID; // EUR Web Plug-In PreviewのクラスID
var appVersion = window.navigator.appVersion.toLowerCase();
// OSの判定
// Windows XPの場合
if ( (window.navigator.userAgent).indexOf( "NT 5.1" ) != -1 ) {
CABType = 0; // マシン単位インストール
} else { // 上記以外の場合
CABType = 1; // ユーザ単位インストール
}
// フラグから使用するCAB形式ファイルおよびクラスIDを決定する
if (CABType == 0) {
// マシン単位インストールの格納場所の設定
CabPath = "http://xxx.xxx.xxx.xxx/machine/EURPMPreViewAX.cab";
// マシン単位のクラスIDの設定
ClassID = "D07DA8D2-3459-488E-860E-DD47A71C39D2";
} else {
// ユーザ単位インストールの格納場所の設定
CabPath = "http://xxx.xxx.xxx.xxx/user/EURPMPreViewAX.cab";
// ユーザ単位のクラスIDの設定
ClassID = "51B88D4D-8FE2-4E68-8035-3482C44F1E29";
}
//OBJECTタグの記述
document.write("<object");
//Webサーバで取得したクラスIDを指定
document.write(" classid=clsid:"+ClassID);
//CAB形式ファイルのパスおよびWebサーバで取得したバージョンを指定
document.write(" codebase=" + CabPath + "#version=<%=strVersion%>");
document.write(" ID=EURPMPREVIEWAX");
document.write(" width=500");
document.write(" height=500");
document.write(" type=application/x-oleobject>");
document.write("<BR>");
document.write("<param name=EPFFileURL value=http://xxx.xxx.xxx/File/EPF/1.epf>");
document.write("<BR>");
document.write("<param name=LogLevel value=16>");
document.write("<BR>");
document.write("</object>");
document.write("<BR>");
-->
</Script>
</BODY>
</HTML>