Setting multiple datasource for a report in Asp.net
I have a report whose data is derived from two stored procedures.so i need to set these two datasources for generating the report.But the reports which have only one SP, ie.only one datasource works properly. For setting the datasource, i wrote code like this:
dim reportdocument as ReportDocument
Dim reportPath As String = Server.MapPath("CrystalRpts\Report.rpt")
ReportDocument.Load(reportPath)
'Function for Setting the Connection
SetDBLogonForReport(MyConnectionInfo, ReportDocument)
dim dt1 as datatable=Datasource1
dim dt2 as datatable=Datasource2
dt1.merge(dt2)
reportdocument.setDataSource(dt1)
CrystalReportViewer.ReportSource=reportdocument
***************************************************
But, the report is not generating.it shows the following error
The Report requires additional information
Servername:- Server
Database:- D开发者_如何学运维atabase
UserID:-
Password:-
But the reports which have only one SP, ie.only one datasource works properly.What colud be reason for this error?
I have already created this report.So i cant combine the two SPs
as it may refresh the report fields.Please advice.
you can set only one datasource to report, but its better you will get all you required at once and set that source to your report.
Its better to combine your two Stored procedure to one
精彩评论