フッターコンテンツにスキップ
移行ガイド

C#でSAP Crystal ReportsからIronPDFに移行する方法

SAP Crystal ReportsからIronPdfに移行することで、複雑なデプロイ要件を持つヘビー級のレガシープラットフォームから、最新の軽量なNuGetパッケージへとレポートワークフローが変わります。 このガイドでは、500MBを超える巨大なランタイムのインストールを排除し、SAPエコシステムのロックインを排除し、.NET Core/5/6/7/8+の完全サポートを可能にする、完全で段階的な移行パスを提供します。

なぜSAP Crystal ReportsからIronPDFへ移行するのか

SAPクリスタルレポートを理解する

SAP Crystal Reports は、ダイナミックで"ピクセルパーフェクト"なレポートを作成するツールとして、エンタープライズ分野で際立っています。SAP Crystal Reportsは、さまざまなデータソースに接続できることが評価され、包括的なレポート機能を求める多くの企業で採用されてきました。 Crystal Reports Designer は、複雑なレポートレイアウトの作成を簡素化するツールです。

しかし、テクノロジーの進化に伴い、SAP Crystal Reports の SAP フレームワークへの依存度が高く、インストールやデプロイの要件が厳しいことも見逃せなくなっています。 重量級であるため、企業がシステムを完全に実装し、維持するには、多くのリソースと時間が必要になります。

移行する主な理由

1.大規模なインストール: Crystal Reports ランタイムは 500MB 以上あり、複雑なインストールが必要です。

  1. SAPエコシステムのロックイン: SAPの価格、サポートサイクル、製品ロードマップに縛られる 3.複雑なライセンス: SAPのエンタープライズ販売プロセスによるプロセッサごと/ユーザーごとのライセンス 4.レガシーアーキテクチャ:現代の64ビット展開を複雑にする32ビットCOMの依存関係
  2. .NET Coreのサポート終了:最新 for .NETプラットフォームに対する限定的なサポート 6.レポートデザイナーの依存関係: Visual Studio 拡張機能またはスタンドアロンデザイナーが必要 7.パフォーマンスの低下:実行時の初期化とメモリ使用量の増加

SAP Crystal Reportsの隠れたコスト

コスト要因 SAP Crystal Reports IronPDF
ランタイムサイズ 500MB以上 約20MB
インストール 複雑なMSI/セットアップ NuGetパッケージ
デプロイメント 特別なインストーラ コピー
64ビット対応 問題点 ネイティブ
.NET Core/5/6/7/8 制限的 サポート対象
クラウドデプロイメント 難易度 単純
Linux/Docker なし はい

SAP Crystal ReportsとIronPDFの比較

フィーチャー SAP Crystal Reports IronPDF
主な機能 エンタープライズレポートプラットフォーム HTMLからPDFへの変換エンジンとPDF操作
統合 SAPエコシステム内で最適 最新 for .NET統合、軽量NuGetパッケージ
使いやすさ 複雑なセットアップとデプロイメント 統合を簡素化し、.NET開発者をサポート
レポートデザイナー 必須 オプション(HTML/CSS)
テンプレート形式 .rpt (バイナリ) HTML/CSS
HTMLからPDFへ なし 完全なChromium
URLからPDFへ なし はい
CSSサポート なし 完全なCSS3
JavaScript(JavaScript なし フルES2024
PDF操作 なし フル(マージ、分割、編集)
デジタル署名 なし はい
PDF/Aコンプライアンス なし はい
現代的妥当性 衰退し、最新の代替言語に取って代わられる 現代的で、現代の技術にうまく統合されていること。

2025年、2026年まで.NET 10とC# 14の導入を計画しているチームにとって、IronPDFはSAP Crystal Reportsでは提供できないネイティブのクロスプラットフォームサポートを提供します。


始める前に

前提条件

  1. .NET環境:.NET Framework4.6.2+ または.NET Core 3.1+ / .NET 5/6/7/8/9+
  2. NuGetアクセス: NuGetパッケージをインストールする機能
  3. IronPDFライセンス: IronPDFからライセンスキーを取得します。

NuGetパッケージの変更

# Remove Crystal Reports packages
dotnet remove package CrystalDecisions.CrystalReports.Engine
dotnet remove package CrystalDecisions.Shared
dotnet remove package CrystalDecisions.ReportAppServer
dotnet remove package CrystalDecisions.Web

# Remove legacy assemblies from project references
# Install IronPDF
dotnet add package IronPdf
# Remove Crystal Reports packages
dotnet remove package CrystalDecisions.CrystalReports.Engine
dotnet remove package CrystalDecisions.Shared
dotnet remove package CrystalDecisions.ReportAppServer
dotnet remove package CrystalDecisions.Web

# Remove legacy assemblies from project references
# Install IronPDF
dotnet add package IronPdf
SHELL

ライセンス構成

// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
' Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
$vbLabelText   $csharpLabel

完全な API リファレンス

名前空間の変更

// Before: SAP Crystal Reports
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportAppServer;

// After: IronPDF
using IronPdf;
// Before: SAP Crystal Reports
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportAppServer;

// After: IronPDF
using IronPdf;
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportAppServer

Imports IronPdf
$vbLabelText   $csharpLabel

コア API マッピング

SAP Crystal Reports IronPDF ノート
ReportDocument ChromePdfRenderer コアレンダリング
ReportDocument.Load() RenderHtmlAsPdf() コンテンツを読み込む
.rpt ファイル HTML/CSSテンプレート テンプレート形式
SetDataSource() データ付きHTML データバインディング
SetParameterValue() 文字列の補間 パラメータ
ExportToDisk() pdf.SaveAs() ファイルを保存
ExportToStream() pdf.BinaryData バイト
PrintToPrinter() pdf.Print() 印刷
Database.Tables C#データアクセス データソース
FormulaFieldDefinitions C#ロジック 計算
SummaryInfo pdf.MetaData PDFメタデータ
ExportFormatType.PortableDocFormat デフォルト出力 PDFネイティブ

コード移行の例

例1: HTMLからPDFへの変換

翻訳前(SAP Crystal Reports):

// NuGet: Install-Package CrystalReports.Engine
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;

class Program
{
    static void Main()
    {
        // Crystal Reports requires a .rpt file template
        ReportDocument reportDocument = new ReportDocument();
        reportDocument.Load("Report.rpt");

        // Crystal Reports doesn't directly support HTML
        // You need to bind data to the report template
        // reportDocument.SetDataSource(dataSet);

        ExportOptions exportOptions = reportDocument.ExportOptions;
        exportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
        exportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

        DiskFileDestinationOptions diskOptions = new DiskFileDestinationOptions();
        diskOptions.DiskFileName = "output.pdf";
        exportOptions.DestinationOptions = diskOptions;

        reportDocument.Export();
        reportDocument.Close();
        reportDocument.Dispose();
    }
}
// NuGet: Install-Package CrystalReports.Engine
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;

class Program
{
    static void Main()
    {
        // Crystal Reports requires a .rpt file template
        ReportDocument reportDocument = new ReportDocument();
        reportDocument.Load("Report.rpt");

        // Crystal Reports doesn't directly support HTML
        // You need to bind data to the report template
        // reportDocument.SetDataSource(dataSet);

        ExportOptions exportOptions = reportDocument.ExportOptions;
        exportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
        exportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

        DiskFileDestinationOptions diskOptions = new DiskFileDestinationOptions();
        diskOptions.DiskFileName = "output.pdf";
        exportOptions.DestinationOptions = diskOptions;

        reportDocument.Export();
        reportDocument.Close();
        reportDocument.Dispose();
    }
}
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System

Class Program
    Shared Sub Main()
        ' Crystal Reports requires a .rpt file template
        Dim reportDocument As New ReportDocument()
        reportDocument.Load("Report.rpt")

        ' Crystal Reports doesn't directly support HTML
        ' You need to bind data to the report template
        ' reportDocument.SetDataSource(dataSet)

        Dim exportOptions As ExportOptions = reportDocument.ExportOptions
        exportOptions.ExportDestinationType = ExportDestinationType.DiskFile
        exportOptions.ExportFormatType = ExportFormatType.PortableDocFormat

        Dim diskOptions As New DiskFileDestinationOptions()
        diskOptions.DiskFileName = "output.pdf"
        exportOptions.DestinationOptions = diskOptions

        reportDocument.Export()
        reportDocument.Close()
        reportDocument.Dispose()
    End Sub
End Class
$vbLabelText   $csharpLabel

翻訳後(IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF from HTML string
        var renderer = new ChromePdfRenderer();

        string htmlContent = "<h1>Hello World</h1><p>This is a PDF generated from HTML.</p>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created successfully!");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF from HTML string
        var renderer = new ChromePdfRenderer();

        string htmlContent = "<h1>Hello World</h1><p>This is a PDF generated from HTML.</p>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created successfully!");
    }
}
Imports IronPdf
Imports System

Class Program
    Shared Sub Main()
        ' Create a PDF from HTML string
        Dim renderer As New ChromePdfRenderer()

        Dim htmlContent As String = "<h1>Hello World</h1><p>This is a PDF generated from HTML.</p>"

        Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
        pdf.SaveAs("output.pdf")

        Console.WriteLine("PDF created successfully!")
    End Sub
End Class
$vbLabelText   $csharpLabel

この例は、基本的なパラダイムの違いを示しています。SAP Crystal Reportsでは、Crystal Reports Designer で作成された、事前に設計された .rpt ファイル テンプレートが必要です。その後、ExportFormatType、および DiskFileDestinationOptions を構成する必要があります。 ライブラリはHTMLコンテンツを直接サポートしていません。

IronPDF はHTML 文字列を直接受け入れます。ChromePdfRenderer を作成し、任意の HTML コンテンツで RenderHtmlAsPdf() を呼び出し、SaveAs() を呼び出します。 デザイナー不要、バイナリテンプレート不要、複雑なエクスポート設定不要。 包括的な例については、HTML to PDF documentationを参照してください。

例2: URLからPDFへの変換

翻訳前(SAP Crystal Reports):

// NuGet: Install-Package CrystalReports.Engine
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;
using System.Net;

class Program
{
    static void Main()
    {
        // Crystal Reports cannot directly convert URLs to PDF
        // You need to create a report template first

        // Download HTML content
        WebClient client = new WebClient();
        string htmlContent = client.DownloadString("https://example.com");

        // Crystal Reports requires .rpt template and data binding
        // This approach is not straightforward for URL conversion
        ReportDocument reportDocument = new ReportDocument();
        reportDocument.Load("WebReport.rpt");

        // Manual data extraction and binding required
        // reportDocument.SetDataSource(extractedData);

        reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "output.pdf");
        reportDocument.Close();
        reportDocument.Dispose();
    }
}
// NuGet: Install-Package CrystalReports.Engine
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;
using System.Net;

class Program
{
    static void Main()
    {
        // Crystal Reports cannot directly convert URLs to PDF
        // You need to create a report template first

        // Download HTML content
        WebClient client = new WebClient();
        string htmlContent = client.DownloadString("https://example.com");

        // Crystal Reports requires .rpt template and data binding
        // This approach is not straightforward for URL conversion
        ReportDocument reportDocument = new ReportDocument();
        reportDocument.Load("WebReport.rpt");

        // Manual data extraction and binding required
        // reportDocument.SetDataSource(extractedData);

        reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "output.pdf");
        reportDocument.Close();
        reportDocument.Dispose();
    }
}
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System
Imports System.Net

Module Program
    Sub Main()
        ' Crystal Reports cannot directly convert URLs to PDF
        ' You need to create a report template first

        ' Download HTML content
        Dim client As New WebClient()
        Dim htmlContent As String = client.DownloadString("https://example.com")

        ' Crystal Reports requires .rpt template and data binding
        ' This approach is not straightforward for URL conversion
        Dim reportDocument As New ReportDocument()
        reportDocument.Load("WebReport.rpt")

        ' Manual data extraction and binding required
        ' reportDocument.SetDataSource(extractedData)

        reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "output.pdf")
        reportDocument.Close()
        reportDocument.Dispose()
    End Sub
End Module
$vbLabelText   $csharpLabel

翻訳後(IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF from a URL
        var renderer = new ChromePdfRenderer();

        var pdf = renderer.RenderUrlAsPdf("https://example.com");
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created from URL successfully!");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF from a URL
        var renderer = new ChromePdfRenderer();

        var pdf = renderer.RenderUrlAsPdf("https://example.com");
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created from URL successfully!");
    }
}
Imports IronPdf
Imports System

Class Program
    Shared Sub Main()
        ' Create a PDF from a URL
        Dim renderer As New ChromePdfRenderer()

        Dim pdf = renderer.RenderUrlAsPdf("https://example.com")
        pdf.SaveAs("output.pdf")

        Console.WriteLine("PDF created from URL successfully!")
    End Sub
End Class
$vbLabelText   $csharpLabel

SAP Crystal Reports では、URLを直接 PDF に変換することはできません。 HTML コンテンツを WebClient を使用して手動でダウンロードし、その後何らかの方法でそのデータを抽出して、事前に設計された .rpt テンプレートにバインドする必要があります。これは簡単なプロセスではなく、かなりの手作業が必要です。

IronPDF の RenderUrlAsPdf() メソッドは、すべての CSS、 JavaScript、および画像を含む完全にレンダリングされた Web ページを 1 回の呼び出しでキャプチャします。 詳しくは、チュートリアルをご覧ください。

例3:ページ番号を含むヘッダーとフッター

翻訳前(SAP Crystal Reports):

// NuGet: Install-Package CrystalReports.Engine
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;

class Program
{
    static void Main()
    {
        // Crystal Reports requires design-time configuration
        ReportDocument reportDocument = new ReportDocument();
        reportDocument.Load("Report.rpt");

        // Headers and footers must be designed in the .rpt file
        // using Crystal Reports designer
        // You can set parameter values programmatically
        reportDocument.SetParameterValue("HeaderText", "Company Name");
        reportDocument.SetParameterValue("FooterText", "Page ");

        // Crystal Reports handles page numbers through formula fields
        // configured in the designer

        reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "output.pdf");
        reportDocument.Close();
        reportDocument.Dispose();
    }
}
// NuGet: Install-Package CrystalReports.Engine
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;

class Program
{
    static void Main()
    {
        // Crystal Reports requires design-time configuration
        ReportDocument reportDocument = new ReportDocument();
        reportDocument.Load("Report.rpt");

        // Headers and footers must be designed in the .rpt file
        // using Crystal Reports designer
        // You can set parameter values programmatically
        reportDocument.SetParameterValue("HeaderText", "Company Name");
        reportDocument.SetParameterValue("FooterText", "Page ");

        // Crystal Reports handles page numbers through formula fields
        // configured in the designer

        reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "output.pdf");
        reportDocument.Close();
        reportDocument.Dispose();
    }
}
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System

Class Program
    Shared Sub Main()
        ' Crystal Reports requires design-time configuration
        Dim reportDocument As New ReportDocument()
        reportDocument.Load("Report.rpt")

        ' Headers and footers must be designed in the .rpt file
        ' using Crystal Reports designer
        ' You can set parameter values programmatically
        reportDocument.SetParameterValue("HeaderText", "Company Name")
        reportDocument.SetParameterValue("FooterText", "Page ")

        ' Crystal Reports handles page numbers through formula fields
        ' configured in the designer

        reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "output.pdf")
        reportDocument.Close()
        reportDocument.Dispose()
    End Sub
End Class
$vbLabelText   $csharpLabel

翻訳後(IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();

        // Configure headers and footers
        renderer.RenderingOptions.TextHeader.CenterText = "Company Name";
        renderer.RenderingOptions.TextHeader.FontSize = 12;

        renderer.RenderingOptions.TextFooter.LeftText = "Confidential";
        renderer.RenderingOptions.TextFooter.RightText = "Page {page} of {total-pages}";
        renderer.RenderingOptions.TextFooter.FontSize = 10;

        string htmlContent = "<h1>Document Title</h1><p>Document content goes here.</p>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF with headers and footers created!");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();

        // Configure headers and footers
        renderer.RenderingOptions.TextHeader.CenterText = "Company Name";
        renderer.RenderingOptions.TextHeader.FontSize = 12;

        renderer.RenderingOptions.TextFooter.LeftText = "Confidential";
        renderer.RenderingOptions.TextFooter.RightText = "Page {page} of {total-pages}";
        renderer.RenderingOptions.TextFooter.FontSize = 10;

        string htmlContent = "<h1>Document Title</h1><p>Document content goes here.</p>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF with headers and footers created!");
    }
}
Imports IronPdf
Imports System

Module Program
    Sub Main()
        Dim renderer As New ChromePdfRenderer()

        ' Configure headers and footers
        renderer.RenderingOptions.TextHeader.CenterText = "Company Name"
        renderer.RenderingOptions.TextHeader.FontSize = 12

        renderer.RenderingOptions.TextFooter.LeftText = "Confidential"
        renderer.RenderingOptions.TextFooter.RightText = "Page {page} of {total-pages}"
        renderer.RenderingOptions.TextFooter.FontSize = 10

        Dim htmlContent As String = "<h1>Document Title</h1><p>Document content goes here.</p>"

        Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
        pdf.SaveAs("output.pdf")

        Console.WriteLine("PDF with headers and footers created!")
    End Sub
End Module
$vbLabelText   $csharpLabel

SAP Crystal Reports では、ヘッダーとフッターをデザイン時に設定する必要があります。 Crystal Reports Designer を使用して、.rpt ファイルでこれらのパラメータを設計し、実行時に "HeaderText""FooterText" などのパラメータ値を渡す必要があります。ページ番号は、Designer の式フィールドで設定する必要があります。

IronPDF は、TextHeader および TextFooter プロパティを使用してプログラムによるヘッダー/フッター構成を提供します。 コード内に RightText、および FontSize を直接設定します。 ページ番号には {page} および {total-pages} プレースホルダーが使用されます。デザイナーは必要ありません。


よくある移行の問題

課題1:.rptファイルの変換

SAP Crystal Reports: レイアウト、データ、数式が埋め込まれたバイナリ.rptファイル。

解決策:直接変換することはできません-HTMLとして再作成する必要があります: 1.Crystal Reports デザイナーで .rpt を開く 2.文書のレイアウト、フォント、色 3.すべての数式フィールドに注意 4.HTML/CSSで再作成 5.数式をC#コードに変換する

課題2: データベース接続

SAP Crystal Reports: 組み込み接続文字列とODBC。

ソリューション: アプリケーションのデータレイヤーを使用してください:

// Instead of Crystal's database integration
var data = await _dbContext.Orders
    .Where(o => o.Date >= startDate && o.Date <= endDate)
    .ToListAsync();

// Bind to HTML template
var html = GenerateReportHtml(data);
// Instead of Crystal's database integration
var data = await _dbContext.Orders
    .Where(o => o.Date >= startDate && o.Date <= endDate)
    .ToListAsync();

// Bind to HTML template
var html = GenerateReportHtml(data);
Option Strict On



' Instead of Crystal's database integration
Dim data = Await _dbContext.Orders _
    .Where(Function(o) o.Date >= startDate AndAlso o.Date <= endDate) _
    .ToListAsync()

' Bind to HTML template
Dim html = GenerateReportHtml(data)
$vbLabelText   $csharpLabel

課題 3:ランタイム依存性

SAP Crystal Reports: Crystal Reports Runtimeのインストール(500MB以上)が必要です。

ソリューション: IronPDFは自己完結しています:

# Just add theNuGetpackage
dotnet add package IronPdf
# That's it - no additional installs needed
# Just add theNuGetpackage
dotnet add package IronPdf
# That's it - no additional installs needed
SHELL

第4号:32ビット/64ビットの問題

SAP Crystal Reports: COM の依存関係には 32 ビットモードが必要なことがよくあります。

ソリューション: IronPDFはネイティブの64ビットで、特別な設定は必要ありません。


移行後の新機能

IronPDFに移行することで、SAP Crystal Reportsが提供できない機能を得ることができます:

PDFマージ

var pdf1 = PdfDocument.FromFile("report1.pdf");
var pdf2 = PdfDocument.FromFile("report2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("complete_report.pdf");
var pdf1 = PdfDocument.FromFile("report1.pdf");
var pdf2 = PdfDocument.FromFile("report2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("complete_report.pdf");
Dim pdf1 = PdfDocument.FromFile("report1.pdf")
Dim pdf2 = PdfDocument.FromFile("report2.pdf")
Dim merged = PdfDocument.Merge(pdf1, pdf2)
merged.SaveAs("complete_report.pdf")
$vbLabelText   $csharpLabel

PDFのセキュリティ

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(reportHtml);

pdf.MetaData.Title = "Quarterly Sales Report";
pdf.MetaData.Author = "Finance Department";

pdf.SecuritySettings.OwnerPassword = "admin123";
pdf.SecuritySettings.UserPassword = "view123";
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;

pdf.SaveAs("secure_report.pdf");
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(reportHtml);

pdf.MetaData.Title = "Quarterly Sales Report";
pdf.MetaData.Author = "Finance Department";

pdf.SecuritySettings.OwnerPassword = "admin123";
pdf.SecuritySettings.UserPassword = "view123";
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;

pdf.SaveAs("secure_report.pdf");
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf(reportHtml)

pdf.MetaData.Title = "Quarterly Sales Report"
pdf.MetaData.Author = "Finance Department"

pdf.SecuritySettings.OwnerPassword = "admin123"
pdf.SecuritySettings.UserPassword = "view123"
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights
pdf.SecuritySettings.AllowUserCopyPasteContent = False

pdf.SaveAs("secure_report.pdf")
$vbLabelText   $csharpLabel

デジタル署名

var signature = new PdfSignature("certificate.pfx", "password");
pdf.Sign(signature);
var signature = new PdfSignature("certificate.pfx", "password");
pdf.Sign(signature);
Dim signature = New PdfSignature("certificate.pfx", "password")
pdf.Sign(signature)
$vbLabelText   $csharpLabel

ウォーターマーク

pdf.ApplyWatermark("<h1 style='color:red; opacity:0.3;'>DRAFT</h1>");
pdf.ApplyWatermark("<h1 style='color:red; opacity:0.3;'>DRAFT</h1>");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

機能比較の概要

フィーチャー SAP Crystal Reports IronPDF
:インストール: ランタイムサイズ 500MB以上 約20MB
インストール方法 MSI/Setup.exe NuGet
デプロイメント 複雑 コピー
:プラットフォームサポート: .NET Framework はい はい
.NET Core/5/6/7/8 制限的 フル
64ビットネイティブ 問題点 はい
Linux/Docker なし はい
Azure/AWS 難易度 単純
発達 レポートデザイナー 必須 オプション(HTML)
テンプレート形式 .rpt (バイナリ) HTML/CSS
学習曲線 クリスタルの構文 ウェブ標準
インテリセンス なし 完全なC#言語
:レンダリング: HTMLからPDFへ なし 完全なChromium
URLからPDFへ なし はい
CSSサポート なし 完全なCSS3
JavaScript なし フルES2024
: PDF の機能: PDFのマージ なし はい
PDFの分割 なし はい
透かし 制限的 フルHTML
デジタル署名 なし はい
PDF/A なし はい

移行チェックリスト

移行前

  • すべての .rpt ファイルをインベントリします
  • 参考のために各レポートレイアウトのスクリーンショットを撮る
  • 数式フィールドと計算を文書化する
  • すべてのデータソースとパラメータを一覧表示する
  • 印刷要件を特定する
  • IronPDFからIronPDFライセンスキーを取得します

コードの更新

  • Crystal Reports パッケージを削除します (CrystalDecisions.CrystalReports.Engine など)
  • デプロイメントからランタイムインストールを削除する
  • IronPdf NuGetパッケージをインストールします
  • .rpt レイアウトをHTML/CSSテンプレートに変換します
  • Crystal の式を C# コードに変換する
  • データバインディングをSetDataSource()からHTML文字列補間に更新します
  • 印刷コードを PrintToPrinter() から pdf.Print() に更新します
  • アプリケーションの起動時にライセンスの初期化を追加

インフラ

  • サーバーからCrystal Runtimeを削除する
  • デプロイメントスクリプトを更新する
  • 32ビット互換モードを削除
  • Dockerイメージを更新する(該当する場合)

テスティング

  • PDF出力を元のレポートと比較する
  • すべての計算を検証する
  • すべてのパラメータをテストする
  • 印刷機能のテスト
  • パフォーマンステスト
  • 64ビットテスト

カーティス・チャウ
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

アイアンサポートチーム

私たちは週5日、24時間オンラインで対応しています。
チャット
メール
電話してね