意见箱
恒创运营部门将仔细参阅您的意见和建议,必要时将通过预留邮箱与您保持联络。感谢您的支持!
意见/建议
提交建议

FastReport允许在.NET应用程序中显示带有切片的数据多维数据集

来源:恒创科技 编辑:恒创科技编辑部
2024-01-11 06:15:59


FastReport.Mono 是一种为Mono Framework设计的功能全面的报表生成工具。FastReport.Mono是一个多平台的报表解决方法。它可以用于Windows,Linux,Mac OS X,以及任何支持Xamarin Mono的操作系统。

在FastReport Mono 2021.1的新版本中,添加了新版本-Deutsche Post Leitcode。将RTF转换为报告对象的算法已获得显着改进。并且还添加了使用转换数字的新功能。欢迎下载体验。


如今,对OLAP多维数据集等分析工具的需求极为迫切。快速报告拥有这样的系统,并允许在.NET应用程序(例如,NET 5.0)中显示带有切片的数据多维数据集。我们将讨论如何在您的报告中使用它。

要使用FastCube.Core库,必须先从源代码中汇编它们。要为.NET 5.0组装FastCube.Core,请使用FastCube.Core.sln解决方案。

启动此解决方案后,更改.NET 5.0的目标操作环境。然后组装项目;您将在我们的工作目录中看到FastCube.Core.2020.2.1.nupkg。将此软件包放置在您将用作本地软件包源的文件夹中。

现在,我们可以开始创建.NET Core项目。

首先,将FastCube.Core库添加到创建的项目中。为此,请使用NuGet程序包管理器。由于库包放在本地光盘上,因此我们必须添加包的本地源。单击程序包管理器右上角的齿轮图标,然后添加一个新的源,它将指向包含您的nupkg程序包的本地文件夹:

FastReport允许在.NET应用程序中显示带有切片的数据多维数据集_.net

在此阶段,您可以在下拉列表中选择添加的源并设置软件包:

FastReport允许在.NET应用程序中显示带有切片的数据多维数据集_应用程序_02

我们已经在项目中添加了一个库,现在应该通过写入文件.cs来连接它:
using FastReport.Olap
要检查其工作方式,请使用以下代码:
c

lass Program
{
private static string FindDataFolder()
{
string dataFolder = "";
string thisFolder = Config.ApplicationFolder;

for (int i = 0; i < 6; i++)
{
string dir = Path.Combine(thisFolder, "Data");
if (Directory.Exists(dir))
{
string data_dir = Path.GetFullPath(dir);
if (File.Exists(Path.Combine(data_dir, "config.xml")))
{
dataFolder = data_dir;
break;
}
}
thisFolder += ".." + Path.DirectorySeparatorChar;
}

if (dataFolder == "")
{
thisFolder = Config.ApplicationFolder;
for (int i = 0; i < 6; i++)
{
string dir = Path.Combine(thisFolder, "Demos", "Data");
if (Directory.Exists(dir))
{
string data_dir = Path.GetFullPath(dir);
if (File.Exists(Path.Combine(data_dir, "config.xml")))
{
dataFolder = data_dir;
break;
}
}
thisFolder += ".." + Path.DirectorySeparatorChar;
}
}

if (dataFolder == "")
throw new Exception("Could not locate the Data folder.");
return dataFolder;
}

static void Main(string[])
{
string dataFolder = FindDataFolder();
// create cube and slice
Cube cube = new Cube();
Slice cubeSlice = new Slice();
cubeSlice.Cube = cube;
// load cube
cube.Load(Path.Combine(dataFolder, "Cubes", "2_0_sample_en1.mdc"));
// open cube
cube.Active = true;
// export slice
HTMLExport export = new HTMLExport();
export.Slice = cubeSlice;
export.Export(Path.Combine(Config.ApplicationFolder, "export.html"));
}
}
}

之后,在我们应用程序的目录中,我们将看到一个.html格式的文件。在任何编辑器中将其打开,并获得以下信息:

因此,我们已经在控制台应用程序中使用FastCube.Core库进行了查看。可以看到,该库与NET 5.0完美配合。现在,您可以在应用程序中使用数据多维数据集。
如果您对FastReport感兴趣,欢迎加入FastReport QQ交流群:801349317

上一篇: 巡检利器 -- Oracle详细巡检报告支持11g、10g、12c及以上版本 下一篇: 手机怎么远程登录云服务器?