PrintEcho.SDK
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package PrintEcho.SDK --version 1.0.0
NuGet\Install-Package PrintEcho.SDK -Version 1.0.0
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="PrintEcho.SDK" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PrintEcho.SDK" Version="1.0.0" />
<PackageReference Include="PrintEcho.SDK" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PrintEcho.SDK --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PrintEcho.SDK, 1.0.0"
#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.
#:package PrintEcho.SDK@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PrintEcho.SDK&version=1.0.0
#tool nuget:?package=PrintEcho.SDK&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PrintEcho.SDK -- 印刻SDK
这是一个PrintEcho(印刻)打印客户端的SDK。
可以让你开发自定义函数,和安装进印刻打印客户端。
入门
1、创建一个.net8.0类库
2、执行以下命令安装PrintEcho.SDK
dotnet add package PrintEcho.SDK
或
Install-Package PrintEcho.SDK
3、创建一个类,用于编写自定义函数,如下所示:
using PrintEcho.SDK;
using System;
using Stimulsoft.Report;
namespace Examle
{
/// <summary>
/// 包含自定义函数的类
/// </summary>
public class MyCustomFunctions
{
/// <summary>
/// 定义您的自定义函数
/// </summary>
[CustomFunction("示例")]
public static string SomeFunction(string name)
{
// 自定义函数内可以获取当前报表对象
var report = PrintContext<StiReport>.Current;
report.XXXX? // write your code
}
}
}
4、将类库发布为release
模式,获得example.dll
文件
5、将文件读取为二进制后,转为BASE64
字符串,调用API
(/api/funcs/install
)安装自定义函数
6、安装后,可以调用API
(/api/funcs
)获取已安装的自定义函数信息进行验证
标注自定义函数
// 引用命名空间
using PrintEcho.SDK;
/// <summary>
/// 按名称获取一段文本
/// </summary>
[CustomFunction("函数分类", // <-- 标注属性
Description = "按名称获取一段文本",
ReturnDescription = "返回一段XX文本",
ArgumentNames = ["name"], ArgumentDescriptions = ["名称"])
public static string GetText(string name)
{
return $"Hi {name}, this message is generated by your custom function '{nameof(GetText)}'..";
}
自定义函数内获取当前正在渲染的报表对象
using PrintEcho.SDK;
using Stimulsoft.Report;
[CustomFunction("获取报表实例示例")]
public static string SomeFunction()
{
var report = PrintContext<StiReport>.Current;
report.XXXX? // write your code
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
支持自定义函数和获取当前正在渲染的报表对象