如何在wpf c#VS2010中不使用数据库生成报告 [英] how to generate report without using database in wpf c# VS2010

查看:75
本文介绍了如何在wpf c#VS2010中不使用数据库生成报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,它在运行时分析一些信息,并将分析结果保存在某些变量中。我有15个这样的变量,其中13个是字符串类型,1个整数和1个位图图像。我想让用户根据分析数据生成报告。我一直试图在论坛上寻求帮助,但还没找到合适的解决方案。首先,我不想将这些分析结果保存在数据库(SQL等)中。我想做的只是根据分析结果向用户显示报告,让他保存或打印。



这是我到目前为止所做的我从论坛得到的许多提示。我添加了一个report.rdlc文件,并为报告创建了一个模板。



我还创建了一个dataset.xsd文件,并将分析参数添加到数据集中。所有数据集值都会添加到报告模板中。



现在这就是我被困住的地方。我不知道如何从这里开始并生成报告。现在我的程序所做的是,点击按钮后,分析的参数将保存在我在主程序中指定的各自变量中。我想要实现的是使用这些结果并生成模板中的报告。



任何有关如何实现这一目标的指导都非常感谢。



谢谢!

I have a program which analyses some information in runtime and save the analysis results in certain variables. I have 15 of these variables, of which, 13 are string type, 1 integer and 1 bitmap image. I want to let the user to generate a report based on the analysis data. I have been trying to search the forums for help, but couldn't find a proper solution yet. First of all, I don't want to save these analysed results in a database (SQL etc). All i want to do is just to display the report to the user based on analysis results and let him save or print it.

This is what I did so far based on numerous hints that I get from forums. I added a report.rdlc file and created a template for the report.

I also created a dataset.xsd file and added the analysis parameters to the dataset. All the dataset values are added to the report template.

Now this is where I am stuck. I don't have an idea how to proceed from here and generate a report. Right now what my program does is, upon button click, the analysed parameters will be saved in their respective variables that I specified in the main program. What I want to achieve is to use these results and generate a report as in the template.

Any guidance on how to achieve this is much appreciated.

Thank you!

推荐答案

我会使用DocumentViewer。

你可以放弃一切在FixedDocument。

所以您的图像,文本块,用户控件等..





这很容易编写代码,以便用户可以在页面上移动它们,从而创建自己的布局。



非常容易打印或保存文档。



我用它来报告大量数据,我唯一要做的就是把我现有的UIcontrols放在Document上。
I would use DocumentViewer.
You can drop everything right in FixedDocument.
So your image, textblocks, usercontrols, etc..


It's very easy to write code so that the user can move them around on the page en thus creating his own layout.

Very easy to print or save the document.

I use it for reporting a large amount of data, and the only thing I do is put my already existing UIcontrols on the Document.


这篇关于如何在wpf c#VS2010中不使用数据库生成报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆