SAP Knowledge Base Article - Public

1335346 - 実行時に Crystal レポートの "書式設定ページ サイズと用紙サイズを別個に設定する" を変更する方法

Symptom

  • カスタムアプリケーションで、Crystal レポートのページオプションを変更する必要があります。
  • 当ノートでは、実行時に "書式設定ページ サイズと用紙サイズを別個に設定する" を有効化/無効化する方法について説明します。

Environment

  • Crystal Reports 2008
  • Crystal Reports .NET SDK

Resolution

  • Crystal Reports .NET SDK を使用して、機能 "書式設定ページ サイズと用紙サイズを別個に設定する" を有効化/無効化してください。
  • RAS .NET SDK では、PrintOptions.DissociatePageSizeAndPrinterPaperSize が正しく変更されません。
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.ReportDefModel;
using CrystalDecisions.ReportAppServer.Controllers;
public partial class _Default :System.Web.UI.Page
{
protected CrystalDecisions.CrystalReports.Engine.ReportDocument boReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
protected void Page_Load(object sender, EventArgs e)
{

boReportDocument.Load(Server.MapPath("CrystalReport.rpt"));
CrystalDecisions.CrystalReports.Engine.PrintOptions boPrintOptions = boReportDocument.PrintOptions;
boPrintOptions.DissociatePageSizeAndPrinterPaperSize = false;
boPrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperEnvelope11;
boPrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait;
CrystalReportViewer1.ReportSource = boReportDocument;
}
protected void Page_Unload(object sender, EventArgs e)
{
boReportDocument.Close();
boReportDocument.Dispose();
}


}

Keywords

KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To

Product

Crystal Reports 2008 V1