Majorsilence.CrystalCmd.Client 1.0.40

dotnet add package Majorsilence.CrystalCmd.Client --version 1.0.40                
NuGet\Install-Package Majorsilence.CrystalCmd.Client -Version 1.0.40                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Majorsilence.CrystalCmd.Client" Version="1.0.40" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Majorsilence.CrystalCmd.Client --version 1.0.40                
#r "nuget: Majorsilence.CrystalCmd.Client, 1.0.40"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Majorsilence.CrystalCmd.Client as a Cake Addin
#addin nuget:?package=Majorsilence.CrystalCmd.Client&version=1.0.40

// Install Majorsilence.CrystalCmd.Client as a Cake Tool
#tool nuget:?package=Majorsilence.CrystalCmd.Client&version=1.0.40                

CrystalCMD is a C#/dotnet program that loads JSON files into Crystal Reports to produce PDFs. Initially an experimental proof of concept, it demonstrates generating Crystal Reports on Linux using the .NET framework (wine).

Key Features:

  • PDF Generation: Converts JSON (and embedded csv) data into PDF reports with Crystal Reports templates.
  • Command Line & Server Modes: Supports both modes; server mode is recommended for better performance.
  • Cross-Platform: Works on Linux and can run .NET implementations using Wine.

Client

Nuget package

dotnet add package Majorsilence.CrystalCmd.Client

Curl example

curl -u "username:password" -F "reportdata=@test.json" -F "reporttemplate=@the_dataset_report.rpt" http://127.0.0.1:4321/export --output testout.pdf

C# code example

DataTable dt = new DataTable();

// init reprt data
var reportData = new Majorsilence.CrystalCmd.Common.Data()
{
    DataTables = new Dictionary<string, string>(),
    MoveObjectPosition = new List<Majorsilence.CrystalCmd.Common.MoveObjects>(),
    Parameters = new Dictionary<string, object>(),
    SubReportDataTables = new List<Majorsilence.CrystalCmd.Common.SubReports>()
};

// add as many data tables as needed.  The client library will do the necessary conversions to json/csv.
reportData.AddData("report name goes here", "table name goes here", dt);

// export to pdf
var crystalReport = System.IO.File.ReadAllBytes("The rpt template file path goes here");
using (var instream = new MemoryStream(crystalReport))
using (var outstream = new MemoryStream())
{
    var rpt = new Majorsilence.CrystalCmd.Client.Report(serverUrl, username: "The server username goes here", password: "The server password goes here");
    using (var stream = await rpt.GenerateAsync(reportData, instream, _httpClient))
    {
        stream.CopyTo(outstream);
        return outstream.ToArray();
    }
}

Postman Collection

Majorsilence.CrystalCMD.postman_collection.json

Server requirements

See Crystal Reports, Developer for Visual Studio Downloads

  • Download the Crystal Reports .net runtime from: https://origin.softwaredownloads.sap.com/public/site/index.html

    • CR for Visual Studio SP35 CR Runtime 64-bit
    • CR for Visual Studio SP35 CR Runtime 32-bit
  • Majorsilence.CrystalCmd.NetFrameworkServer

    • net4.8 webapi project
  • Majorsilence.CrystalCmd.NetframeworkConsoleServer

    • an embedio based console app/webserver
    • can be run on Linux using wine

Server

Docker run

docker run -p 44355:44355 -e OVERRIDE_WINEARCH_AS_X64='yes' majorsilence/dotnet_framework_wine_crystalcmd:1.0.25-alpine

Windows Service Run

Use nssm or powershell to register the Majorsilence.CrystalCmd.NetframeworkConsoleServer.exe.

$serviceName = "CrystalCmdService"
$exePath = "C:\Path\To\Majorsilence.CrystalCmd.NetframeworkConsoleServer.exe"
$displayName = "Crystal Command Service"
$description = "A service for Majorsilence Crystal Command"

New-Service -Name $serviceName -BinaryPathName $exePath -DisplayName $displayName -Description $description -StartupType Automatic

# Set the service to restart on failure
sc.exe failure $serviceName reset= 0 actions= restart/60000/restart/60000/restart/60000

# Verify service configuration
Get-Service -Name $serviceName
sc.exe qc $serviceName
sc.exe qfailure $serviceName

Build docker images

See Dockerfile.wine, Dockerfile.crystalcmd, and build.sh.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.40 91 12/13/2024
1.0.39 1,015 10/23/2024
1.0.38 85 10/22/2024
1.0.36 1,054 10/9/2024
1.0.29 1,235 8/21/2024
1.0.28 136 8/21/2024
1.0.25 105 6/20/2024
1.0.24 106 6/13/2024
1.0.23 131 4/22/2024
1.0.22 1,056 4/3/2024
1.0.21 171 3/22/2024
1.0.20 116 3/22/2024
1.0.19 184 2/29/2024
1.0.18 110 2/29/2024
1.0.17 111 2/28/2024
1.0.16 128 2/26/2024
1.0.14 180 8/23/2023
1.0.10 7,866 6/22/2022
1.0.9 10,632 3/2/2021
1.0.8 9,667 1/5/2021
1.0.7 1,547 12/30/2020
1.0.6 354 12/30/2020
1.0.5 341 12/30/2020
1.0.4 328 12/29/2020
1.0.3 414 12/27/2020
1.0.2 993 12/4/2020
1.0.1 423 12/3/2020
1.0.0 556 11/29/2020