水晶报表正在累积加载的新旧数据 [英] Crystal report is cumulating new and old data loaded in it

查看:66
本文介绍了水晶报表正在累积加载的新旧数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有一张要加载到透明报表中的发票,
但是问题是每次我加载发票时,
旧数据保留在报告中,新数据已添加到报告中!
我尝试了几件事,但似乎无法正确解决,请帮忙吗?

这是在水晶报表中加载发票数据的代码:

Hi everybody,
I have an invoice that I want to load in a crystal report,
but the problem is that every time I load an invoice,
the old data remains in the report, and the new data is added to it !!

I tried few things but it seems I can''t get it right, any help please ??

This is the code loading the invoice data in the crystal report :

Private Sub InvoiceReport(ByVal pInvoiceID As String)
    Dim lCryRpt As New ReportDocument
    Dim ds As New DataSet
    Dim lsql As String
    Dim lXMLPath As String
    Dim lRPTPath As String

    lXMLPath = "C:\Alumeel\Reports\InvoiceSheet.xml"
    lRPTPath = "C:\Alumeel\Reports\InvoiceSheet.rpt"

    lsql = "Select * From InvoiceItems Where InvoiceID = " & pInvoiceID
    mdb.FillMyDataSet(lsql, ds, "Invoice")
    ds.WriteXmlSchema(lXMLPath)
    lCryRpt.Load(lRPTPath)
    lCryRpt.SetDataSource(ds)
    Me.CrystalReportViewer1.ReportSource = lCryRpt
    Me.CrystalReportViewer1.Update()
    Me.CrystalReportViewer1.Refresh()
    Me.Show()
End Sub

推荐答案

检查报告中是否没有保存数据..."选项.否则,报告将包含旧数据.另外,如果您愿意,也可以使用DiscardSavedData 方法
Check that your report doesn''t have the option "Save data..." on. Otherwise the report will contain old data. Also if you like you can use DiscardSavedData method


这篇关于水晶报表正在累积加载的新旧数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆