hi, i have a Windows Application using visual studio.net 2005..
is there any way to close only the report in the report viewer n not the rest of the windows that r running?
=/

thanks so much! :)

Recommended Answers

All 9 Replies

Hi,


CrystalReportViewer1.ReportSource = Nothing

If ur problem solved ,pls marked Solved

hi.
thanks for your reply.. =D

but may i ask where should i place that line of coding?
cos i put that line at the report viewer under the part CloseToolStripMenuItem_Click and under page load of my applciation window
but it still close everything
=/

did i put at the correct place?
:)
thanks

Hi,


Take one button and on that Click write this code

hmm i followed ur way but it still close all the windows..
:(

i pasted the code u gave me at my application window:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


       [B] TestReport.CrystalReportViewer1.ReportSource = Nothing[/B]

        If (RadioButton1.Checked) Then
            Dim r1 As New CrystalReport1
            TestReport.Text = "Report 1"
            TestReport.CrystalReportViewer1.ReportSource = r1

            TestReport.Show()

      End If
    End Sub

and here at the report viewer:

Private Sub CloseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseToolStripMenuItem.Click

        [B]CrystalReportViewer1.ReportSource = Nothing[/B]

        Me.Close()

    End Sub

did i paste the codes at the correct place? :x

Thanks alot!!
=)

Private Sub CloseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseToolStripMenuItem.Click

CrystalReportViewer1.ReportSource = Nothing

Me.Close()

End Sub

in this code u give

Me.Close()

it will close your form. Please remove this line

hi! =)
thanks so much for ur help..!

i've removed the Me.Close() ... but it only close the report.
is there any way to close the whole crystal report viewer but the other windows of my application remains open?
:confused:

CrystalReportViewer1.Visible = false;

hi,

i've screenshot how the program looks like when added the codings...
the 2 links are to the screenshots.. =)

when i put this coding CrystalReportViewer1.Visible = false;
it closes the report in the following link..
[IMG]http://img.photobucket.com/albums/v601/iluvjay/02.jpg[/IMG]
:icon_neutral:

then when i put this line of code CrystalReportViewer1.ReportSource = Nothing
it closes the report :
[IMG]http://img.photobucket.com/albums/v601/iluvjay/01.jpg[/IMG]


but i needa do something that close the whole window of the report viewer but the other windows of my application remains..
=/
do u have any idea on how to go abt doing it? =)

thanks lots..

yeah i just solved the problem!!
:icon_cheesygrin:

i put the code Me.Visible = False
but Me.Hide() works also..!
=D

thanks reena12 for the help!
(:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.