本文介绍了水晶报告收据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有水晶报告和参数,它工作得非常好。我的问题是,每当我订购两件商品时,它只显示第一件商品和数量,我该怎么办?我只是这里的新手。请帮助:(

i have crystal report and parameters on it which is working perfectly fine. My problem is,whenever i ordered two items, it shows only the first item along with the quantity, what should i do? i''m just a newbie here.please help :(

推荐答案

Dim cryRpt As New rep1   'where rep1 is name of reports or do below 1,2
       '' 1.Dim cryRpt As New ReportDocument
       '' 2.cryRpt.Load("C:-----\Reports\orderrpt.rpt")
       Dim crParameterFieldDefinitions As ParameterFieldDefinitions
       Dim crParameterFieldDefinition As ParameterFieldDefinition
       Dim crParameterValues As New ParameterValues
       Dim param As New ParameterDiscreteValue

       '
       ' Get the report parameters collection.
       '
       crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields

       ' Add a parameter value - START
       param = New CrystalDecisions.Shared.ParameterDiscreteValue
       param.Value = "230" 'txtAMOUNT.Text  ' here is specyfy value input for Item parameters
       crParameterFieldDefinition = crParameterFieldDefinitions.Item("total")
       crParameterValues = crParameterFieldDefinition.CurrentValues
       crParameterValues.Add(param)
       crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

       param = New CrystalDecisions.Shared.ParameterDiscreteValue
       param.Value = "15"  'txtfoodrate.Text' here is specyfy value input for Item parameters
       crParameterFieldDefinition = crParameterFieldDefinitions.Item("price")
       crParameterValues = crParameterFieldDefinition.CurrentValues
       crParameterValues.Add(param)
       crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

       param = New CrystalDecisions.Shared.ParameterDiscreteValue
       param.Value = "5"  'txtordered.Text here is specyfy value input for Item parameters
       crParameterFieldDefinition = crParameterFieldDefinitions.Item("foodorder")
       crParameterValues = crParameterFieldDefinition.CurrentValues
       crParameterValues.Add(param)
       crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

       param = New CrystalDecisions.Shared.ParameterDiscreteValue
       param.Value = "12"  ' quantity.Text here is specyfy value input for Item parameters
       crParameterFieldDefinition = crParameterFieldDefinitions.Item("quantity")
       crParameterValues = crParameterFieldDefinition.CurrentValues
       crParameterValues.Add(param)
       crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

       param = New CrystalDecisions.Shared.ParameterDiscreteValue
       param.Value = "4"  '  TextBox5.Text here is specyfy value input for Item parameters
       crParameterFieldDefinition = crParameterFieldDefinitions.Item("folioid")
       crParameterValues = crParameterFieldDefinition.CurrentValues
       crParameterValues.Add(param)
       crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

       ' END of Add a parameter value - END

       CrystalReportViewer1.ReportSource = cryRpt
       CrystalReportViewer1.Refresh()

       '## on crystal reports Add parameter as : ##
       '   total
       '   price
       '   foodorder
       '   quantity
       '   folioid
       '## and Insert in Report ##


这篇关于水晶报告收据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 10:31