如何在没有数据库中创建报告(RDLC)? [英] How to create report (RDLC) without database?

查看:125
本文介绍了如何在没有数据库中创建报告(RDLC)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您创建报告(RDLC)数据源似乎只有这样或那样的数据库。有什么办法说服VS建立一个链接到内存中的数据源?类似的东西到WPF数据绑定。

When you create a report (RDLC) the datasource seems to be only this or that database. Is there any way to convince VS to establish a link to memory data source? Something similar to WPF databinding.

问题是,我想创建只有几个数据的报告(由用户输入),整点的布局,我没有数据的巨量。所以在安装数据库,将数据写入到数据库,然后取他们只是为了显示该报告是巨大的矫枉过正。

The issue is, I would like to create a report with just a few data (entered by user), the whole point is layout, I don't have massive amount of data. So installing DB, writing data to DB, and then fetching them just to show the report is huge overkill.

所以,我在找创建从内存中报告的能力数据。

So, I am looking for ability to create a report from memory data.

我想设计一个布局,添加图片,设置样式,字体颜色,等等,并添加不仅仅是名,姓氏(用户)和文本几个参数没有更多的。用户可以输入这些3个值,拿传单并打印X倍。
中的布局必须确切 - 从纸张尺寸,图像的位置,字体大小等出发

I would like to design a layout, add images, set styles, font colors, etc. and add no more than few parameters like "first name", "last name" (of user) and "text". User would enter those 3 values, get a flyer and print it X times. The layout has to be exact -- starting from paper size, the placement of images, size of fonts, etc.

也许有比RDLC更好的解决方案但它是内置的引擎,无论我如何寻找它总是在搜索结果中弹出。

Maybe there are better solutions than RDLC but it is built-in engine, and no matter how I search it always pops out in search results.

推荐答案

有关数据源一个RDLC报告可以是任何一个实现的IEnumerable 。如果是对象的枚举,那么对象的属性成为报告域。

The datasource for an RDLC report can be anything that implements IEnumerable. If it is an enumeration of objects, then the properties on the object become fields in the report.

有关报告的事情是他们的数据是自己内部的概念。在设计时,您需要提供报表设计与数据一起工作。报告摄取该数据集内部和它被用来设计报告。现实情况是本身不关心实际的数据集的报告。它只关心它的模式。但是,在运行时您提供的对象,以满足该数据集可以来自任何地方,只要它们满足相同的架构。

The thing about reports is they have their own internal notion of what the dataset is. At design time you need to provide the report designer with a dataset to work with. The report ingests that dataset internally and it is used to design the report. The reality is the report itself doesn't care about the actual dataset. It only cares about its schema. However, at runtime the objects you provide to satisfy that dataset can come from anywhere, as long as they satisfy that same schema.

我有回到我的MS日子一点点的博客文章,显示如何获得良好的设计时支持,然后在运行时提供的任何数据的报告一招你想要的:

I have a little blog post from back in my MS days that shows a trick on how to get good design time support, and then at runtime provide the report with any data you want:

http://blogs.msdn.com/b/magreer/archive/2008/10/16/setting-the-datasource-for-a-report-at- runtime.aspx

这篇关于如何在没有数据库中创建报告(RDLC)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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