网站Datasources Bug? [英] Website Datasources Bug?

查看:59
本文介绍了网站Datasources Bug?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS2005,C#,ASP.NET 2.0。我正在尝试使用SQL创建报告

Reporting Services(在本地模式下使用,所以我不必处理

SQL Server)。当我在我的网站上创建新报告时,网站数据源窗口中没有任何内容显示在

中。我在我的网站上添加了一些不同的强类型

数据集,但它们都没有显示出来。我可以获得的唯一方法就是创建一个新类,它来自我在单独的程序集中创建的强类型数据集。一旦我这样做了,

这个父数据集(来自外部程序集)被列为网站

数据源(但不是派生类?)。而且,我在网站上创建的所有突然出现的所有

强类型数据集也出现了。来自我的外部程序集中定义的数据集的

DataTables似乎也没有正确导入网站数据源。所有DataTable都列出了一次,除了第一个DataTable,它再次列出了
,其中DataSet的名称前面加上了DataTable的名字。如果我

删除我从数据集派生的类(在我的网站中)(在

外部程序集中),那么我在中定义的所有强类型数据集我的

网站项目从网站数据源中消失,外部程序集中定义的数据集

也是如此。我必须遗漏一些东西,或者某种类型的b $ b bug。


这就是我想要做的:构建基于数据集的报告

我已经在我网站的一个单独的程序集中定义了(即我的业务逻辑

层)。我会在不使用任何数据库的情况下手动填充此数据集。

我认为我不应该在我的网站上派出一个班级(我会从
)实际上使用)来自我单独程序集中定义的数据集,只需

即可使用该单独程序集中定义的数据集作为报告

我网站的数据源。

I''m using VS2005, C#, ASP.NET 2.0. I''m trying to create a report using SQL
Reporting Services (to be used in local mode so I don''t have to deal with
SQL Server). When I create a new report in my website, nothing shows up in
the Website Data Sources window. I added a few different strongly-typed
Datasets to my website, and they don''t show up. The only way I could get
anything to show up was to create a new class that''s derived from a
strongly-typed Dataset I created in a separate assembly. Once I did that,
this parent Dataset (from the external assembly) was listed as a Website
Data Source (but not the derived class?). And, all of the sudden all of the
strongly-typed Datasets I created in my website also showed up. The
DataTables from the Dataset defined in my external assembly do not seem to
import into the Website Data Sources properly either. All DataTables are
listed once, with the exception of the first DataTable, which is listed
again with the name of the DataSet prepended to the DataTable''s name. If I
delete the class (in my website) that I derived from the Dataset (in the
external assembly), then all of the strongly-typed Datasets I defined in my
Website project disappear from the Website Data Sources, as does the dataset
defined in the external assembly. I must be missing something, or there''s a
bug of some sort.

Here''s what I want to be able to do: Build a report based on a Dataset that
I''ve defined in a separate assembly from my website (i.e. my business logic
layer). I will populate this Dataset manually without using any database.
I don''t think I should have to derive a class in my website (which I''ll
never actually use) from the dataset defined in my separate assembly, just
to be able to use the Dataset defined in that separate assembly as a report
data source for my website.

推荐答案

我确实感到你对Data Sources的痛苦非常苛刻。 Im

使用业务对象,可能有20%的时间显示。更多

我经常需要关闭解决方案,重新打开它,提出报告并希望
希望对象在那里。一个强类型数据集测试

报告使用正常显示。这些对象作为通用列表公开,

这是MS在他们的样本中在msdn网站上显示的内容

Arrggghhhhh。从来没有对水晶报告观察者说过这个废话。


cpnet写道:
I sure feel your pain about Data Sources being extremely flakey. Im
using business objects, and maybe 20% of the time they show. Much more
often I have to close the solution, re-open it, bring up a report and
hope the objects are there. The one strongly typed dataset a test
report uses normally shows. The objects are exposed as a generic list,
which is what MS shows on the msdn site in their samples
Arrggghhhhh. Never had this nonsense with the crystal reportviewer.

cpnet wrote:

我正在使用VS2005,C#,ASP .NET 2.0。我正在尝试使用SQL创建报告

Reporting Services(在本地模式下使用,所以我不必处理

SQL Server)。当我在我的网站上创建新报告时,网站数据源窗口中没有任何内容显示在

中。我在我的网站上添加了一些不同的强类型

数据集,但它们都没有显示出来。我可以获得的唯一方法就是创建一个新类,它来自我在单独的程序集中创建的强类型数据集。一旦我这样做了,

这个父数据集(来自外部程序集)被列为网站

数据源(但不是派生类?)。而且,我在网站上创建的所有突然出现的所有

强类型数据集也出现了。来自我的外部程序集中定义的数据集的

DataTables似乎也没有正确导入网站数据源。所有DataTable都列出了一次,除了第一个DataTable,它再次列出了
,其中DataSet的名称前面加上了DataTable的名字。如果我

删除我从数据集派生的类(在我的网站中)(在

外部程序集中),那么我在中定义的所有强类型数据集我的

网站项目从网站数据源中消失,外部程序集中定义的数据集

也是如此。我必须遗漏一些东西,或者某种类型的b $ b bug。


这就是我想要做的:构建基于数据集的报告

我已经在我网站的一个单独的程序集中定义了(即我的业务逻辑

层)。我会在不使用任何数据库的情况下手动填充此数据集。

我认为我不应该在我的网站上派出一个班级(我会从
)实际上使用)来自我单独程序集中定义的数据集,只需

即可使用该单独程序集中定义的数据集作为报告

我网站的数据源。

I''m using VS2005, C#, ASP.NET 2.0. I''m trying to create a report using SQL
Reporting Services (to be used in local mode so I don''t have to deal with
SQL Server). When I create a new report in my website, nothing shows up in
the Website Data Sources window. I added a few different strongly-typed
Datasets to my website, and they don''t show up. The only way I could get
anything to show up was to create a new class that''s derived from a
strongly-typed Dataset I created in a separate assembly. Once I did that,
this parent Dataset (from the external assembly) was listed as a Website
Data Source (but not the derived class?). And, all of the sudden all of the
strongly-typed Datasets I created in my website also showed up. The
DataTables from the Dataset defined in my external assembly do not seem to
import into the Website Data Sources properly either. All DataTables are
listed once, with the exception of the first DataTable, which is listed
again with the name of the DataSet prepended to the DataTable''s name. If I
delete the class (in my website) that I derived from the Dataset (in the
external assembly), then all of the strongly-typed Datasets I defined in my
Website project disappear from the Website Data Sources, as does the dataset
defined in the external assembly. I must be missing something, or there''s a
bug of some sort.

Here''s what I want to be able to do: Build a report based on a Dataset that
I''ve defined in a separate assembly from my website (i.e. my business logic
layer). I will populate this Dataset manually without using any database.
I don''t think I should have to derive a class in my website (which I''ll
never actually use) from the dataset defined in my separate assembly, just
to be able to use the Dataset defined in that separate assembly as a report
data source for my website.


你好cpnet,


至于webform的本地报告数据源(RDLC) reportviewer

控件,它将列出在web项目本身或任何引用的程序集或项目中定义的那些DataSet或自定义业务类。您的

单独的类库项目是通过项目引用引用的还是

直接dll引用?您可以尝试删除它并再次添加对

的引用以查看它是否有效。以下是在webform reportviewer中显示带有自定义业务类的本地报告的MSDN演练:

http://msdn2.microsoft.com/en-us/lib...92(VS.80).aspx

对于您的方案,如果您想在不查询数据库的情况下提供

reportviewr(localreport)的数据源(或使用DataSource
控制),你可以通过以下方式编程:


========== aspx模板========== ========

< div>

< rsweb:ReportViewer ID =" ReportViewer1" runat =" server"

Font-Names =" Verdana" Font-Size =" 8pt"

Height =" 400px" Width =" 400px">

< LocalReport

ReportPath =" c:\inetpub \wwwroot \\\\\\\\\\\\\\\\\\\\ UrlCopySite \reports\simple

report.rdlc">

< DataSources>


< / DataSources>

< / LocalReport>

< / rsweb:ReportViewer>


.......... ................


========代码背后============ ===========

protected void Page_Load(object sender,EventArgs e)

{


UrlCopySiteLib.ProductDS.ProductsDataTable products = new

UrlCopySiteLib.ProductDS.ProductsDataTable();

products.AddProductsRow(" product1",1,1);

products.AddProductsRow(" product2",2,2);

products.AddProductsRow(" product3",3,3);

产品。 AddProductsRow(" product4",4,4);


ReportDataSource rds = new ReportDataSource(&q uot;产品",产品);


ReportViewer1.LocalReport.DataSources.Add(rds);


}


==================================


希望这会有所帮助。


此致,

Steven Cheng


Microsoft MSDN在线支持导致


===================================== =============


通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx


==================================== ==============


此帖子按原样提供。没有保证,也没有授予任何权利。

Hello cpnet,

As for the Datasource for local report(RDLC) of webform reportviewer
control, it will list those DataSet or custom business classes defined in
the web project itself or in any referenced assembly or projects. Is your
separate class library project referenced through project reference or
direct dll reference? You can try removing it and adding reference against
it again to see whether it works. Here is the MSDN walkthrough on
displaying local report with custom business class in webform reportviewer:

http://msdn2.microsoft.com/en-us/lib...92(VS.80).aspx

For your scenario, if you want to supply the datasource for
reportviewr(localreport) without querying database(or use DataSource
control), you can do it programmatically as below:

==========aspx template==================
<div>
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
Font-Names="Verdana" Font-Size="8pt"
Height="400px" Width="400px">
<LocalReport
ReportPath="c:\inetpub\wwwroot\ASPNET\V2\WebSites\ UrlCopySite\reports\simple
report.rdlc">
<DataSources>

</DataSources>
</LocalReport>
</rsweb:ReportViewer>

..........................

========code behind=======================
protected void Page_Load(object sender, EventArgs e)
{

UrlCopySiteLib.ProductDS.ProductsDataTable products = new
UrlCopySiteLib.ProductDS.ProductsDataTable();
products.AddProductsRow("product1", 1, 1);
products.AddProductsRow("product2", 2, 2);
products.AddProductsRow("product3", 3, 3);
products.AddProductsRow("product4", 4, 4);

ReportDataSource rds = new ReportDataSource("Products", products);

ReportViewer1.LocalReport.DataSources.Add(rds);

}

==================================

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


至于webform reportviewer的本地报告数据源(RDLC)
As for the Datasource for local report(RDLC) of webform reportviewer

控件,它将列出在web项目本身或任何引用的程序集或项目中定义的那些DataSet或自定义业务类。您的

单独的类库项目是通过项目引用引用的还是

直接dll引用?您可以尝试删除它并再次添加对

的引用以查看它是否有效。这是MSDN演练

在webform中显示带有自定义业务类的本地报告

reportviewer:
control, it will list those DataSet or custom business classes defined in
the web project itself or in any referenced assembly or projects. Is your
separate class library project referenced through project reference or
direct dll reference? You can try removing it and adding reference against
it again to see whether it works. Here is the MSDN walkthrough on
displaying local report with custom business class in webform
reportviewer:



不幸的是VS似乎表现得像你在下面描述的那样。

这是我的情况:


- 我已经定义了3个DataSet我的web项目(dsTest1,dsTest2,dsTest2)

- 我在OtherAssembly.dll中定义了第4个DataSet(dsTest4)。我的web项目中的一些类

使用这个dsTest4数据集

- 我在我的web项目中添加了对OtherAssembly.dll的引用

(右 - 点击我的网站项目,然后选择添加引用...,然后

从添加引用对话框的项目选项卡中选择程序集。


当我执行以上所有操作时,NOTHING显示在Website Datasources

窗口中。我曾尝试添加和删除对OtherAssembly.dll

的引用几次,这没有帮助。 OtherAssembly.dll是

的一部分与我的网络项目相同的解决方案。


接下来,我尝试的是:

- 在我的web项目中创建一个新类(dsTest4Descendent),它来自dsTest4(来自OtherAssembly.dll)




当我这样做时,我看到了以下可用作数据源:

- dsTest1

- dsTest2

- dsTest3

- dsTest4

- 我没有看到列出的dsTest4Descendent。


一旦从我的web项目中删除dsTest4Descendent类,所有

可用的网站数据源消失。


我的web项目还有一些帮助类,它们返回强类型的

DataSets / DataTables作为公共属性或方法,而不是<这些显示为网站数据源。

Unfortunately VS doesn''t seem to behave like you''re describing below.
Here''s my situation:

- I have defined 3 DataSets in my web project (dsTest1, dsTest2, dsTest2)
- I have defined a 4th DataSet (dsTest4) in OtherAssembly.dll. Some classes
in my web project use this dsTest4 DataSet
- I have added a reference to OtherAssembly.dll in my web project
(right-clicked on my web project, and selected "Add Reference...", then
selected the assembly from the "Projects" tab of the Add Reference dialog)

When I do all of the above, NOTHING shows up in the Website Datasources
window. I have tried adding and removing the reference to OtherAssembly.dll
a couple of times, and this has not helped. OtherAssembly.dll is part of
the same solution as my web project.

Next, what I tried is:
- create a new class (dsTest4Descendent) in my web project that is derived
from dsTest4 (from OtherAssembly.dll)

When I do this, I see the following available as datasources:
- dsTest1
- dsTest2
- dsTest3
- dsTest4
- I do NOT see dsTest4Descendent listed.

As soon as I remove the dsTest4Descendent class from my web project, ALL of
the available Website Datasources disappear.

My web project also has a few helper classes that return strongly-typed
DataSets/DataTables as either public properties or methods, and none of
these show up as Website Datasources ever.


这篇关于网站Datasources Bug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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