Jak przeprowadzić migrację z SAP Crystal Reports do IronPDF w języku C#
Przejście zSAP Crystal ReportsnaIronPDFzmienia proces tworzenia raportów z ciężkiej, przestarzałej platformy o złożonych wymaganiach wdrożeniowych w nowoczesny, lekki pakiet NuGet. Niniejszy przewodnik zawiera kompletną, szczegółową ścieżkę migracji, która eliminuje konieczność instalacji ogromnego środowiska uruchomieniowego o rozmiarze ponad 500 MB, usuwa uzależnienie od ekosystemu SAP i zapewnia pełną obsługę platform .NET Core/5/6/7/8+.
Dlaczego warto przejść zSAP Crystal Reportsna IronPDF
Zrozumienie SAP Crystal Reports
SAP Crystal Reports wyróżnia się w środowisku Enterprise jako narzędzie do generowania dynamicznych i "pixel-perfect" raportów. SAP Crystal Reports, znany ze swojej zdolności do łączenia się z wieloma źródłami danych, jest najczęściej wybieranym rozwiązaniem przez wiele Enterprise poszukujących kompleksowych funkcji raportowania. Platforma oferuje niezrównaną moc dzięki Crystal Reports Designer, narzędziu, które upraszcza tworzenie złożonych układów raportów.
Jednak wraz z rozwojem technologii nie można pominąć faktu, żeSAP Crystal Reportsjest w dużym stopniu uzależniony od środowiska SAP, a jego instalacja i wdrożenie wiążą się z wysokimi wymaganiami. Ze względu na złożony charakter tych rozwiązań Enterprise często potrzebuje znacznych zasobów i czasu, aby w pełni wdrożyć i utrzymać system.
Główne powody migracji
- Rozległa instalacja: Crystal Reports Runtime zajmuje ponad 500 MB i wymaga skomplikowanej instalacji
- Uzależnienie od ekosystemu SAP: powiązanie z cennikiem SAP, cyklami wsparcia i planem rozwoju produktów
- Złożone licencjonowanie: licencjonowanie na procesor/użytkownika w ramach procesu sprzedaży korporacyjnej SAP
- Starsza architektura: 32-bitowe zależności COM, które komplikują nowoczesne wdrożenia 64-bitowe
- Wycofana obsługa .NET Core: Ograniczona obsługa nowoczesnych platform .NET
- Zależność od projektanta raportów: Wymaga rozszerzeń Visual Studio lub samodzielnego projektanta
- Niska wydajność: Rozbudowana inicjalizacja środowiska uruchomieniowego i duże zużycie pamięci
Ukryte koszty SAP Crystal Reports
| Czynnik kosztowy | SAP Crystal Reports | IronPDF |
|---|---|---|
| Rozmiar w czasie wykonywania | 500 MB+ | ~20 MB |
| Instalacja | Złożony plik MSI/Setup | PakietNuGet |
| Wdrożenie | Specjalne instalatory | xcopy |
| Obsługa 64-bitowa | Problematyczne | Język ojczysty |
| .NET Core/5/6/7/8 | Ograniczone | Obsługiwane |
| Wdrożenie w chmurze | Trudne | Proste |
| Linux/Docker | Nie | Tak |
PorównanieSAP Crystal Reportsi IronPDF
| Funkcja | SAP Crystal Reports | IronPDF |
|---|---|---|
| Podstawowa funkcjonalność | Platforma raportowania dla Enterprise | Silnik konwersji HTML do PDF i obróbka plików PDF |
| Integracja | Najlepsze w ekosystemie SAP | Nowoczesna integracja z platformą .NET, lekki pakietNuGet |
| Łatwość użytkowania | Złożona konfiguracja i wdrożenie | Uproszczona integracja, obsługa programistów .NET |
| Projektant raportów | Wymagane | Opcjonalnie (HTML/CSS) |
| Format szablonu | .rpt (binarny) | HTML/CSS |
| HTML do PDF | Nie | Pełny Chromium |
| URL do pliku PDF | Nie | Tak |
| Obsługa CSS | Nie | Pełny CSS3 |
| JavaScript | Nie | Pełna wersja ES2024 |
| Manipulacja plikami PDF | Nie | Pełne (scal, podziel, edytuj) |
| Podpisy cyfrowe | Nie | Tak |
| Zgodność z PDF/A | Nie | Tak |
| Współczesne znaczenie | Wychodzące z użycia, zastąpione przez nowoczesne alternatywy | Nowoczesne, dobrze zintegrowane z aktualnymi technologiami |
Dla zespołów planujących wdrożenie .NET 10 i C# 14 w latach 2025 i 2026,IronPDFzapewnia natywną obsługę wielu platform, której nie oferuje SAP Crystal Reports.
Zanim zaczniesz
Wymagania wstępne
- Środowisko .NET:.NET Framework4.6.2+ lub .NET Core 3.1+ / .NET 5/6/7/8/9+
- Dostęp do NuGet: Możliwość instalowania pakietów NuGet
- Licencja IronPDF: Uzyskaj klucz licencyjny na stronie ironpdf.com
Zmiany w pakiecie 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
Konfiguracja licencji
// 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"
Kompletna dokumentacija API
Zmiany w przestrzeni nazw
// 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
Mapowania podstawowych interfejsów API
| SAP Crystal Reports | IronPDF | Uwagi |
|---|---|---|
ReportDocument |
ChromePdfRenderer |
Renderowanie rdzenia |
ReportDocument.Load() |
RenderHtmlAsPdf() |
Załaduj treść |
.rpt files |
SzablonyHTML/CSS | Format szablonu |
SetDataSource() |
HTML z danymi | Powiązanie danych |
SetParameterValue() |
Interpolacja ciągów znaków | Parametry |
ExportToDisk() |
pdf.SaveAs() |
Zapisz plik |
ExportToStream() |
pdf.BinaryData |
Pobierz bajty |
PrintToPrinter() |
pdf.Print() |
Drukowanie |
Database.Tables |
Dostęp do danych w języku C# | Źródło danych |
FormulaFieldDefinitions |
Logika C# | Obliczenia |
SummaryInfo |
pdf.MetaData |
Metadane pliku PDF |
ExportFormatType.PortableDocFormat |
Domyślny wynik | PDF natywny |
Przykłady migracji kodu
Przykład 1: Konwersja HTML do PDF
Przed (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
Po (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
Ten przykład ilustruje fundamentalną różnicę paradygmatyczną.SAP Crystal Reportsrequires a pre-designed .rpt file template created in the Crystal Reports Designer, then you must configure ExportOptions, ExportDestinationType, ExportFormatType, and DiskFileDestinationOptions. Biblioteka nie obsługuje bezpośrednio treści HTML — dane należy powiązać z szablonem raportu.
IronPDF accepts HTML strings directly: create a ChromePdfRenderer, call RenderHtmlAsPdf() with any HTML content, and SaveAs(). Nie jest wymagany projektant, nie ma szablonów binarnych ani skomplikowanej konfiguracji eksportu. Kompleksowe przykłady można znaleźć w dokumentacji dotyczącej konwersji HTML do PDF.
Przykład 2: Konwersja adresów URL do formatu PDF
Przed (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
Po (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
SAP Crystal Reports nie może bezpośrednio konwertować adresów URL do formatu PDF. You would need to download the HTML content manually with WebClient, then somehow extract and bind that data to a pre-designed .rpt template—a process that's not straightforward and requires significant manual work.
IronPDF's RenderUrlAsPdf() method captures the fully rendered webpage with all CSS, JavaScript, and images in a single call. Dowiedz się więcej z naszych samouczków.
Przykład 3: Nagłówki i stopki z numerami stron
Przed (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
Po (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
SAP Crystal Reports wymaga konfiguracji nagłówków i stopek w czasie projektowania. You must design them in the .rpt file using the Crystal Reports Designer, then pass parameter values like "HeaderText" and "FooterText" at runtime. Page numbers must be configured through formula fields in the designer.
IronPDF provides programmatic header/footer configuration with TextHeader and TextFooter properties. Set CenterText, LeftText, RightText, and FontSize directly in code. Page numbers use the {page} and {total-pages} placeholders—no designer required.
Typowe problemy związane z migracją
Problem 1: Konwersja plików .rpt
SAP Crystal Reports: Pliki binarne .rpt z osadzonym układem, danymi i formułami.
Rozwiązanie: Nie można dokonać bezpośredniej konwersji — należy odtworzyć jako HTML:
- Otwórz plik .rpt w programie Crystal Reports Designer
- Układ dokumentu, czcionki, kolory
- Zwróć uwagę na wszystkie pola formuł
- Recreate in HTML/CSS
- Convert formulas to C# code
Issue 2: Database Connections
SAP Crystal Reports: Embedded connection strings and ODBC.
Solution: Use your application's data layer:
// 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)
Issue 3: Runtime Dependencies
SAP Crystal Reports: Requires Crystal Reports Runtime installation (500MB+).
Solution:IronPDFis self-contained:
# 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
Issue 4: 32-bit/64-bit Issues
SAP Crystal Reports: COM dependencies often require 32-bit mode.
Solution:IronPDFis native 64-bit—no special configuration needed.
Nowe możliwości po migracji
After migrating to IronPDF, you gain capabilities thatSAP Crystal Reportscannot provide:
Łączenie plików 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")
Zabezpieczenia plików 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")
Podpisy cyfrowe
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)
Znaki wodne
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
Podsumowanie porównania funkcji
| Funkcja | SAP Crystal Reports | IronPDF | |||
|---|---|---|---|---|---|
| :Installation: | Rozmiar w czasie wykonywania | 500 MB+ | ~20 MB | ||
| Metoda instalacji | MSI/Setup.exe | NuGet | |||
| Wdrożenie | Złożone | xcopy | |||
| :Platform Support: | .NET Framework | Tak | Tak | ||
| .NET Core/5/6/7/8 | Ograniczone | Pełna | |||
| 64-bitowe natywne | Problematyczne | Tak | |||
| Linux/Docker | Nie | Tak | |||
| Azure/AWS | Trudne | Proste | |||
| :Development: | Projektant raportów | Wymagane | Opcjonalnie (HTML) | ||
| Format szablonu | .rpt (binarny) | HTML/CSS | |||
| Krzywa uczenia się | Składnia Crystal | Standardy internetowe | |||
| IntelliSense | Nie | Pełny C# | |||
| :Rendering: | HTML do PDF | Nie | Pełny Chromium | ||
| URL do pliku PDF | Nie | Tak | |||
| Obsługa CSS | Nie | Pełny CSS3 | |||
| JavaScript | Nie | Pełna wersja ES2024 | |||
| :PDF Features: | Łączenie plików PDF | Nie | Tak | ||
| Podział plików PDF | Nie | Tak | |||
| Znaki wodne | Ograniczone | Pełny kod HTML | |||
| Podpisy cyfrowe | Nie | Tak | |||
| PDF/A | Nie | Tak |
Lista kontrolna migracji
Przed migracją
- Inventory all
.rptfiles - Screenshot each report layout for reference
- Document formula fields and calculations
- List all data sources and parameters
- Identify printing requirements
- Uzyskaj klucz licencyjnyIronPDFze strony ironpdf.com
Code Updates
- Remove Crystal Reports packages (
CrystalDecisions.CrystalReports.Engine, etc.) - Remove runtime installation from deployment
- Install
IronPdfNuGetpackage - Convert
.rptlayouts toHTML/CSStemplates - Convert Crystal formulas to C# code
- Update data binding from
SetDataSource()to HTML string interpolation - Update printing code from
PrintToPrinter()topdf.Print() - Dodaj inicjalizację licencji podczas uruchamiania aplikacji
Infrastructure
- Remove Crystal Runtime from servers
- Aktualizacja skryptów wdrażania
- Remove 32-bit compatibility mode
- Update Docker images (if applicable)
Testowanie
- Compare PDF output to original reports
- Verify all calculations
- Test all parameters
- Funkcja drukowania testowego
- Testy wydajności
- 64-bit testing

