Values repeat in detail section
Crystal Report is repeating values like this:
1 rar 1 rar 1 rar 1 rar 1 rar
I want the o开发者_如何学编程utput to be like this:
1 rar
I wrote code like this:
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues()
Dim crParameterDiscreteValue As New ParameterDiscreteValue()
crParameterDiscreteValue.Value = Label1.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions("@invoiceno")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
How can I fix this?
Consider grouping by whatever value you don't want repeated.
I would look at the database expert of the report. It's most likely that you have the links setup in a way that will multiply the records being shown.
If it's linked properly, and there are multiple records, you may want to look at using an SQL query (or command) to get the data and use the 'Unique' keyword to ensure that records are shown only once.
Can you post more infomration on what type of datasource you are using, as well as what the contents of the Details field are (i.e. Formula Fields, Database Fields)
精彩评论