Hi all,
I have a report (created in CR 8.5 - connecting via ADO.Net) that runs off of a stored procedure. The stored procedure has two parameters that filter that returned data (both the fields are strings). When I run the report the report prints but no data is displayed (but if I run the same stored procedure and dump the data to a datagrid values are returned). Does anyone have any idea about what is going wrong? Does anyone have a walkthrough for creating the report? Thanks,
jbehrne
Here is the code to print the report:
Here is the stored procedure:
If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
I have a report (created in CR 8.5 - connecting via ADO.Net) that runs off of a stored procedure. The stored procedure has two parameters that filter that returned data (both the fields are strings). When I run the report the report prints but no data is displayed (but if I run the same stored procedure and dump the data to a datagrid values are returned). Does anyone have any idea about what is going wrong? Does anyone have a walkthrough for creating the report? Thanks,
jbehrne
Here is the code to print the report:
Code:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Dim cr As New CrystalDecisions.CrystalReports.Engine.ReportDocument
cr.Load(ReportLoc & "\PBHistoricalByEntry.rpt")
Dim pvEntry As New CrystalDecisions.Shared.ParameterValues
Dim pdvEntry As New CrystalDecisions.Shared.ParameterDiscreteValue
pdvEntry.Value = Me.cmbEntry.Text
pvEntry.Add(pdvEntry)
cr.DataDefinition.ParameterFields("@SelectedEntry").ApplyCurrentValues(pvEntry)
Dim pvAcct As New CrystalDecisions.Shared.ParameterValues
Dim pdvAcct As New CrystalDecisions.Shared.ParameterDiscreteValue
pdvAcct.Value = Me.txtAcct.Text
pvAcct.Add(pdvAcct)
cr.DataDefinition.ParameterFields("@SelectedAcctNum").ApplyCurrentValues(pvAcct)
cr.PrintToPrinter(1, True, 1, 0)
Here is the stored procedure:
Code:
SELECT AccountDescription, AccountCode, JobName, Total, Pieces, DocumentNumber, EntryNumber, StatementDate
FROM dbo.tblPBHistory
WHERE (EntryNumber = @SelectedEntry) AND (AccountCode = @SelectedAcctNum)
If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations