cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with generated Report

Former Member
0 Kudos

I have a crystal report which is generated by the user on our intranet. They generate the Credit Note and it appears fine. When they come to print it, the data disappears! Anyone know why this would be happening?

Kind Regards,

Jonah

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

You'll need to provide more details about your environment and the application that is generating the report. What version of Crystal Reports is being used? What type of web application is it? Which Crystal SDK is being used?

Once you've posted more information about the application that is generating the report this thread will probably have to be moved to one of the Crystal Reports SDK forums since this is not a Crystal Reports Design issue.

Sincerely,

Dan Kelleher

Former Member
0 Kudos

Ok, sorry, i was rather vague (was thinking this while typing up. Thought there might have been a quick fix?) I'm using Crystal Report 10.5 on Visual Studio. The report is generated through a web page. The web page with call off to an AS400 and retrieve the details and thus display a report. Here is my code below.

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Net.Mail
Imports System.Net.Mail.Attachment
Partial Class _Default
    Inherits System.Web.UI.Page
    Dim cryRpt As New ReportDocument
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cryRpt As New ReportDocument
        cryRpt.Load("C:\Documents and Settings\Administrator.xxxxxxx\My Documents\Visual Studio 2005\WebSites\CreditNotes\CrystalReport3.rpt")
        Dim crParameterFieldDefinitions As ParameterFieldDefinitions
        Dim crParameterFieldDefinition As ParameterFieldDefinition
        Dim crParameterValues As New ParameterValues
        Dim crParameterDiscreteValue As New ParameterDiscreteValue
        crParameterDiscreteValue.Value = TextBox1.Text
        crParameterFieldDefinitions = _
        cryRpt.DataDefinition.ParameterFields
        crParameterFieldDefinition = _
        crParameterFieldDefinitions.Item("CreditNo")
        crParameterValues = crParameterFieldDefinition.CurrentValues
        crParameterValues.Clear()
        crParameterValues.Add(crParameterDiscreteValue)
        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
        CrystalReportViewer1.ReportSource = cryRpt
        Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
        myConnectionInfo.DatabaseName = "xxx"
        myConnectionInfo.UserID = "xxxxxx"
        myConnectionInfo.Password = "xxxxxx"
        myConnectionInfo.ServerName = "xxx.xxx.xxx.xxx"
        SetDBLogonForReport(myConnectionInfo)
        CrystalReportViewer1.RefreshReport()
    End Sub
    Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
        Dim myTableLogOnInfos As TableLogOnInfos = CrystalReportViewer1.LogOnInfo
        For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
            myTableLogOnInfo.ConnectionInfo = myConnectionInfo
        Next
    End Sub
End Class

The report works perfectly as soon as you click the button but for some reason clears all the data as soon as you press the print button on the Business Objects Tool bar. I haven't got a clue why. Please help..

Former Member
0 Kudos

Moving thread to the .NET Development - Crystal Reports forum.

Sincerely,

Dan Kelleher

Former Member
0 Kudos

Hi i've just found out that it's not just the print button, it's any button on the Business Object's toolbar. It will wipe the data as soon as any button is pressed.

Kind Regards,

Jonah

Former Member
0 Kudos

Hello Jonah,

Please comment out the "CrystalReportViewer1.RefreshReport()" line of code and test your application again. What happens?

Sincerely,

Dan Kelleher

Former Member
0 Kudos

Hi Dan, that seems to have worked. Thank You.

Answers (0)