How to prevent Crystal Reports from requesting cre

2019-08-14 23:34发布

I've used reflection to extract the sql query being used by a Crystal Report. I then use this extracted sql (very carefully) to fill a dataset, which IO then bind to my ReportDocument object via the SetDataSource method. All this goes smoothly, but whenever I'm trying to view or export my report, it requires that I provide my credentials / parameter values, which defeats the purpose of querying/binding my data manually.

Is there any way around having to provide credentials / parameters when my report data is being push into the report (i.e. can I get the report to not refresh istself from the database directly?) I've tried setting the "save with data" value, but it doesn't seem to help.

1条回答
\"骚年 ilove
2楼-- · 2019-08-15 00:03

May be it can help:

ReportDocument cryReportDocument = .......;
cryReportDocument.SetDatabaseLogon("userName", "password");
cryReportDocument.SetParameterValue("parameterName", value);
CrystalReportViewer1.ReportSource = cryReportDocument;    
查看更多
登录 后发表回答