on 11-10-2008 12:29 AM
以下の環境にて開発を行っています。
【環境】
Windows Server 2003
IIS6.0
Crystal Report9
Oracle9i
【質問事項】
今回、Window NT Server4.0(IIS4)、Crystal Report8、Oracle8.0.6の環境で動作しているASPのシステムを上記の環境で動かそうとしています。
CRViewerを使用したプレビュー表示はできましたが直接印刷を行うとPrintout実行時に"507:例外が発生しました"が発生します。
ソースは下記の通りです(エラー発生箇所は「Session("oRpt").PrintOut False, 1, False, 1, 999」実行時です)。
原因、回避方法等どなたかご教授願います。
【ソース】(印刷ボタン押下時に呼ばれるサブルーチン)
On Error Resume Next
Set Session("oApp") = Server.CreateObject("CrystalRuntime.Application.9")
Set Session("oRpt") = Session("oApp").OpenReport("D:\RPT\DUMMY.RPT", 1)
If Err.Number <> 0 Then
Response.WRite "ERR1:" & Err.Description
Response.End
End If
Session("oRpt").MorePrintEngineErrorMessages = False
Session("oRpt").EnableParameterPrompting = False
Session("oRpt").ReadRecords
If Err.Number <> 0 Then
Response.WRite "ERR2:" & Err.Description
Response.End
Else
If IsObject(Session("oPageEngine")) Then
Set Session("oPageEngine") = Nothing
End If
Set Session("oPageEngine") = Session("oRpt").PageEngine
End If
Session("oRpt").PrintOut False, 1, False, 1, 999
If Err.Number <> 0 Then
Response.WRite "ERR3:" & Err.Description
Response.End
End If
ありがとうございます。
COM+アプリケーションに設定することで無事直接印刷できました。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ASP (IIS) 実行アカウントにプリンタは存在していることは確認されましたか?
設定方法等が不明な場合は Microsoft のサイトで iis asp プリンタ アカウント などをキーワードにして検索をすると関連情報が見つかります。
この設定を行っても駄目な場合、他の環境でも同様か、イベントログにエラーは記録されていないか、Crystal Reports を利用しない ASP プログラムからサーバー側のプリンタに出力したときの挙動を確認してください。
SCN フォーラムモデレーター
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
回答ありがとうございます。
説明が足りなかったかもしれませんが、Window NT Server4.0(IIS4),Crystal Report8で動いている環境をWindows Server2003,Crystal Report9の環境に移行しようとしているということです。
環境変更に伴いCreateObjectの部分等は掲載した例のように変更しています(CRViewerを使用したプレビュー表示は成功しています)。
また、Crystal Reportのモジュール自身も9の環境で保存し直しています。
Default Userに対するプリンタ設定(Devices,Printerportsのレジストリ設定)は実施済みです。
またIIS側の設定として「WEBサービス拡張」の「インターネット印刷」の許可等も行っています。
Crystal Reportを使用しないASPでの印刷についてはまだ試していませんのでサンプルを探して試してみます。
何か他にお気づきの点があれば指摘願います。
回答ありがとうございます。
レスが遅くなり申し訳ありません。
「自分の作成したアプリケーション」というのはどのように指定すればよいでしょうか?
コンポーネントサービスを起動すると左側のツリーで
コンソールルートu21D2コンポーネントサービスu21D2コンピュータu21D2マイコンピュータu21D2COM+アプリケーション
と進むことができますが、例えば、IIS Out-Of-Process Pooled Applicationsのプロパティを指定するということですか?
セキュリティタブを開くと「アクセス権限」がありますが、「コンポーネントレベルでのアクセス確認を行う」など使用不可状態です。
SAP ノートが参照できるようであれば 1218837 で検索してください。
以下は、該当ノートのコピーです。
-
Symptom
When a Report Designer Component (RDC) web application prints a report using the 'PrintOut' method, the following error message appears:
"507 exception occurred on the PrintOut method"
If the RDC application is running in a COM+ application, the following error message appears when using the 'PrintOut' method to print a report:
"The call to server.createobject failed while checking permissions. Access is denied to this object."
Why do these error messages appear and how do you resolve them?
Resolution
Windows 2003 COM+ security, by default, verifies user and program access, thus preventing the COM+ component from running. In Windows 2000, this check is disabled by default.
To resolve the error messages, complete these steps:
1. Create a COM+ package as follows:
i. Go to Control Panel > Administrative Tools > Component Services.
ii. Expand the Component Services folder and then navigate to Computers > My Computer > COM+ Applications.
iii. Right-click the COM+ Applications folder and then go to New > Application. The COM Application Install Wizard launches.
iv. Click 'Next' and then click 'Create an empty application'.
v. After typing a name for the application, click 'Server application', and then click 'Next'.
vi. Click 'This user' and then type a username and password for an account that has sufficient priviledges to access all the resources that your application accesses.
vii. Complete the remaining steps to finish creating the COM+ package.
2. Search for the file Craxdrt.dll on your computer.
3. In the Component Services window, expand the COM+ Applications folder and then expand the new package.
4. Expand the Components folder and then drag the Craxdrt.dll file to the right pane.
5. Right-click your COM+ application and then click 'Properties'.
6. Click the 'Security' tab.
7. Clear the 'Enforce access checks for this application' check box.
サービスパックやパッチを適用してみたらどうでしょうか。まだ、ダウンロードできるか不明ですけど。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.