cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports for Visual Studio 2010 の Active X での印刷について

Former Member
0 Kudos

Crystal Reports for Visual Studio 2010(以下CR2010) で

Active X モード(CrystalReportViewer.PrintMode を ActiveX に設定)で

うまく印刷することができずに困っています。

どなたか下記のような現象の解決策などを知っていましたらご教授ください。

よろしくお願いします。

<<現象>>

CrystalReportViewer でプレビューを表示して印刷ボタンをクリックしたときに

「通信エラーが発生しました。印刷は停止されます。」

のメッセージボックスが表示され、このメッセージボックスを閉じると

「Crystal Reports プリントコントロール をロードしています。しばらくお待ちください。」

のメッセージがずっと表示されたままになります。

web.config で指定した URL (http://localhost/PrintControl.cab) には

ちゃんと cab ファイルが置いてあります。

(直接ブラウザでこのURLを入力すれば cab をダウンロードできます。)

基本的に CR2008 のときと同じように記述しています。

(CR2010 と一緒にインストールされたヘルプにも同じようなコードサンプルが

 記載されていたので)

<<開発環境>>

Microsoft Visual Studio 2010 Premium - 日本語

SAP Crystal Reports, version for Visual Studio 2010

<<Web ページのソースコード>>

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

Dim objCRViewer As CrystalReportViewer = CRViewer

Dim wReportPath As String = Server.MapPath("CR01.rpt")

objRptDoc = New ReportDocument

objRptDoc.PrintOptions.PaperOrientation = PaperOrientation.Landscape

objRptDoc.Load(wReportPath)

objCRViewer.PrintMode = PrintMode.ActiveX

objCRViewer.ReportSource = objRptDoc

End Sub

Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

If Not IsNothing(objRptDoc) Then

objRptDoc.Close()

objRptDoc.Dispose()

objRptDoc = Nothing

End If

End Sub

<<web.config>>

<configuration>

<configSections>

<sectionGroup name="businessObjects">

<sectionGroup name="crystalReports">

<section name="printControl" type="System.Configuration.NameValueSectionHandler" />

</sectionGroup>

</sectionGroup>

</configSections>

<businessObjects>

<crystalReports>

<printControl>

<add key="url" value="http://localhost/PrintControl.cab" />

</printControl>

</crystalReports>

</businessObjects>

</configuration>

以上、よろしくお願いいたします。

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

こんにちは、私も同様の現象で困っています。

windowsXpSP3でVB2010+oracle11g+Crystal Reports for Visual Studio 2010を使用しています。

データベースの内容をviewerに表示することは出来ているのですが、印刷ボタンを押下すると同様のエラーが発生します。

なお、printtoprinterを使用すれば印刷することは出来るのですが、印刷前にプリンタを選択するダイアログを使用したいと考えています。

この現象の解決方法があればご教授ください。

Answers (0)