Skip to Content
0
Former Member
Jul 15, 2010 at 08:35 AM

report sometimes looses information

21 Views

hello community,

i've a project in visual basic .NET 2008 where i use crystal reports 2008 .NET. so i build a form where i placed a CrystalReportViewer Object from CrystalDecisions.Windows.Forms. I declare a ReportDocument and add 2 reports as a resource. the reports are two variants of a letter with 2 dynamic parameters. an id and a version param which should be set with vb to the report before assigning the ReportDocument object to the ReportViewer. The Reports use this params to select data in the first level. in second level there are some subreports. they need the same params which they get over an association in the report.

on my development machine everything works fine. but on some machines at customers office when the letter was generated and displayed, some text blocks will not being shown. if you reopen the form the blocks are there. next time they're not. on other machines the reportviewing works correct all time.

here is some code how i do this:

Public Sub v_viewSub()

Dim crReport As CrystalDecisions.CrystalReports.Engine.ReportDocument

If nl.nlTyp = nl.tbsDef.bsTypFS Then

crReport = New rptVorlageFS

ElseIf nl.nlTyp = nl.tbsDef.bsTypGS Then

crReport = New rptVorlageGS

End If

crReport.DataSourceConnections.Item(0).SetConnection(oDatenbank.dbPfad, "", "Admin", "")

crReport.SetParameterValue("nlID", nl.nlID)

crReport.SetParameterValue("nlVersion", nl.nlVersion)

Me.crReportViewer.ReuseParameterValuesOnRefresh = True

Me.crReportViewer.ReportSource = Nothing

Me.crReportViewer.ReportSource = crReport

Me.crReportViewer.Show()

End Sub

this is the compressed code. in the application i handle the loading of the ReportDocument object over a backgroundworker because the first time u load the object takes much time. i disabled the data caching in the report in cr 2008 env.

could someone explain why there are such problems? has someone the same problem and could give me a workaround or a hint what to do on this?

b.k.

Edited by: Bastian Kraus on Jul 15, 2010 11:42 AM

Edited by: Bastian Kraus on Jul 15, 2010 11:42 AM