如何在C#类库中使用ReportViewer [英] How to use ReportViewer in c# class library

查看:89
本文介绍了如何在C#类库中使用ReportViewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#类库中使用ReportViewer.是否可以在C#类库中使用它?
我可以在.aspx.cs页面中使用它.但是我需要在.cs类文件中使用它.
我可以通过添加
来使用

How to use ReportViewer in c# class library. Is it possilbe to use it in C# Class library?
I can use it in .aspx.cs page. but i need to use it in .cs class file.
I can use by adding

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
ReportDocument cryRpt = new ReportDocument();


我想使用像


I want to use like

CrystalReportViewer RV=new CrystalReportViewer();



提前谢谢.



Thanks in advance.

推荐答案

基本上,不可以.它是一种控件,旨在在ASP .Net网页的上下文中使用.在任何其他类中使用它几乎没有意义.它根本无法按预期工作,并且对其进行调整最多只会是一个危险的骇客.实际上,如果您确实需要在用户界面之外使用用户界面的组件,则您的应用程序设计一定存在一些错误.也许您可以告诉我们更多有关您要完成的事情.
Basically, no. It is a control, designed to be used in the context of a ASP .Net webpage. Using it in any other class makes little sense. It would simply not work as expected and tweaking it to work would at best be a sinister hack. Actually there must be something very wrong with your application''s design if you really need to use a component of the user interface outside the user interface. Perhaps you can tell us a little more about what you are trying to accomplish.


自定义和本地化Microsoft ReportViewer .NET-精确的解决方案 [ ^ ] CP的文章可能会对您有所帮助.
Customizing and Localizing Microsoft ReportViewer .NET - An exact solution[^]article from CP might help you.


这篇关于如何在C#类库中使用ReportViewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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