水晶报表asp.net我是否必须使用setdatabaselogon [英] crystal reports asp.net do i have to use setdatabaselogon

查看:62
本文介绍了水晶报表asp.net我是否必须使用setdatabaselogon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用xsd文件(带有ado.net连接的数据集)设计的水晶报表.Crystal版本14.2.5.2618以及使用vs 2017 ...已部署到.net 4.7.2框架网站.我有一个服务(WCF),它返回有效且已填充的数据集.当我将报告部署到Web服务器时,报告会提示您进行数据库登录,即使在开发过程中也很好.这是更改名称以保护无辜者的代码.

I have a crystal report designed using xsd file (dataset with ado.net connection). Crystal version 14.2.5.2618 and using vs 2017... deployed to .net 4.7.2 framework website. I have a service (WCF) returning a dataset that is valid and filled. When I deploy the report to the web server the report prompts for a database login even though it is fine in development. Here is the code with names changed to protect the innocent.

m_myRPT.Load(Server.MapPath("~/Reports/my.rpt"))
m_myRPT.PrintOptions.PaperOrientation = PaperOrientation.Portrait
m_myRPT.SetDataSource(m_DS.Tables("dtData")) 'returned from WCF and is fine
CRV_reportviewer.ReportSource = m_MyRPT
CRV_reportviewer.DataBind()

就像我说的那样,这在开发中效果很好.所有数据都将正确返回,并且数据集也将检出.我的问题是:

Like I said, this works fine in development. All data is returned properly and the dataset checks out too. My questions are:

1)我是否必须使用SetDatabaseLogon(WCF服务提供数据...报表不应访问数据库,并且我也不希望其访问)

1) Do I HAVE to use SetDatabaseLogon (WCF service supplies data... report should not have access to database and I don't want it to access either)

2)我可以对此进行设置,以便数据集表足以满足报表数据的需求吗……

2) Can I set this up so the dataset table suffices for report data ...

3)数据集的有效表不应包含足以显示报告的足够数据...所以基本上...
4)如何摆脱提示(最好是在报表无法访问数据库的情况下)?

3) Shouldn't the DataSet with a valid table full of data suffice for the report to display... So basically...
4) How can I get rid of prompt (preferably without the report having access to the database) ?

对这些问题的任何答案都是很好的...我不介意更改报告,因此它无需对数据进行提示,而不必在网页上的任何位置对数据库访问凭据进行硬编码... WCF服务提供数据..n层应用程序...我知道这是四个问题合而为一,但如果有人那么好,第四点是我真正需要回答的问题

Any answer to these questions would be great... I do not mind changing the report so it does not prompt for data without having to hard code database access credentials anywhere on the web pages... WCF Service provides data... n-tier application... I know these are four questions in one but number four is what I really need answered if anyone would be so kind

这些年来,我多次使用Crystal,但是想不起必须授予它访问数据库的权限...

I used Crystal many times over the years but cannot recall having to give it access to the database...

致以最诚挚的谢意,

推荐答案

1,必须确保CrystalReport中的DataTable名称相同,如果是,请继续执行

1, You must to ensure, that name of DataTable is the same in CrystalReport, if yes, go next step

2,仅将数据源设置为报表是不够的,您必须将数据传递给报表:

2, It s not enough to only Set DataSource to a report, you must pass data to a report :

      ds.WriteXml(XmlDataPath)

将数据集另存为xml,现在您可以将生成的xml添加到Crystal报表中,因此打开Crystal报表,转到数据库">数据库专家">创建新连接"> ADO.NET(xml)并选择生成的xml的路径

save your dataset as xml, now you can add your generated xml to a Crystal Report, so open Crystal Report, go to Database> Database expert> Create New Connection> ADO.NET(xml) and choose path to generated xml

我遇到了同样的问题,这些步骤对我有帮助

I faced the same problem, and these steps helped me

这篇关于水晶报表asp.net我是否必须使用setdatabaselogon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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