Quantcast
Channel: SCN : Popular Discussions - SAP Crystal Reports & BI Dashboards (日本語) [Read-only]
Viewing all articles
Browse latest Browse all 2234

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

$
0
0

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>

 

 

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


Viewing all articles
Browse latest Browse all 2234

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>