Setting multiple datasource for a report in Asp.net
Posted
by Nandini
on Stack Overflow
See other posts from Stack Overflow
or by Nandini
Published on 2010-03-24T11:12:04Z
Indexed on
2010/03/24
11:13 UTC
Read the original article
Hit count: 317
ASP.NET
Hi all, 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:- Database
UserID:-
Password:-
But the reports which have only one SP, ie.only one datasource works properly.What colud be reason for this error?
© Stack Overflow or respective owner