Last post Sep 16, 2013 02:05 AM by aarsh
Sep 13, 2013 11:09 PM|sabarinathanitt87|LINK
When my procedure returns more than one row...but on field section of my crystal rport it displaying only the first row.....why it is not showing all the rows
weather we need to change any setting for this........urgent help me............
Sep 13, 2013 11:36 PM|A2H|LINK
Please try the solution suggested in below link
Sep 14, 2013 12:08 AM|sabarinathanitt87|LINK
Hi No use after reading that............same issue for me
Sep 15, 2013 10:42 PM|Lisa Zhang - MSFT|LINK
According to your description, the crystal report only displayed the first row but the procedure returned more than one row.
Firstly, I suggest you set a breakpoint to check if the stored procedure returns the right DataSet or not and the one row showed in the report is included in the DataSet or not.
Secondly, please try to refer to the code snippet below and I think you will find the solution. Note: the code is in vb.net, but it can easily be converted to C#.
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Private Sub ConfigureReport()
If Not Page.IsPostBack Then
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
myConnectionInfo.DatabaseName = DatabaseName
myConnectionInfo.UserID = userid
myConnectionInfo.Password = password
Dim ReportPath As String = Server.MapPath("YourReport.rpt")
ReportViewer1.ReportSource = ReportPath
Dim field1 As ParameterField = Me.ReportViewer1.ParameterFieldInfo(0)
Dim field2 As ParameterField = Me.ReportViewer1.ParameterFieldInfo(1)
Dim val1 As New ParameterDiscreteValue()
Dim val2 As New ParameterDiscreteValue()
val1.Value = "value1"
val2.Value = "value2"
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
Dim myTableLogOnInfos As TableLogOnInfos = ReportViewer1.LogOnInfo()
For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
More explaination about the code please try to refer to the link below:
# Connecting a stored procedure to a crystal report
Here is an article about using stored procedures to create crystal report:
# using stored procedures to create crystal report
If you need more assistance, please feel free to let me know.
If possible, please try to post some more information in order to get more supports in a better way.
Sep 16, 2013 02:05 AM|aarsh|LINK
Please make sure that you're sticking the fields are in details and not in headers section. Please have a look at these screen shots :
You may want to put a breakpoint when you're getting results to make sure that the query does return the results
protected void Page_Load(object sender, EventArgs e)
DataTable tblOrderDetail = new DataTable("OrderDetail");
SqlCommand commnad = new SqlCommand("[dbo].[CustMultiOrdersDetail]");
commnad.CommandType = CommandType.StoredProcedure;
commnad.Parameters.Add(new SqlParameter("OrderID", "10643,10692,10702,10835,10952"));
ReportHelper.GetQueryResultFromNorthwind(ref commnad, ref tblOrderDetail);
//breakpoint on next line to see if 'tblOrderDetail' has got value
CrystalReport1 objReport = new CrystalReport1();
ReportDocument doc = new ReportDocument();
CrystalReportViewer1.ReportSource = objReport;
//objReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Page.Response, true, "Test PDF.pdf");