progress bar while crystal report loads

mrathi

New member
Joined
Jul 27, 2006
Messages
1
Programming Experience
Beginner
Hi,
I have a windows form with a crystal report viewer and a button. On the click of a button I generate a report and load it into the viewer. Sometimes this takes time and I would like to display a progress bar. Does not have to be accurate, can be a continuous running progress bar. I am open to displaying the progress bar either in the status bar or in a separate form. Any help would be greatly appreciated. I would appreciate if some code samples will be provided.

Thanks
MR
 
In .net i did not find a way to know if the report is completed if i load the report in form_load event...so what i did is load the report in New() method,so that by the time it enters the form_load event the report is completely loaded...so start showing frmstatus till its complete....this frmstatus is not exactly a progress bar but a time tick to show the user it is loading yet...

this is how it should go...

public sub new()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'show progress form
frm = New frmStatus
frm.Show()

'method to load report into viewer
LoadReport()
end sub

'Form load event!
public sub frmreport_load() handles frmreport.load

'report is loaded -- hide the status form
frm.Hide()
blnLoad = False
end sub


frmstatus is a form with a label (label.text being Loading....) and a timer.
and you write

Private Sub tmrCopy_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrCopy.Tick
If lblCp.Text = "Loading..............." Then
lblCp.Text = "Loading"
Else
lblCp.Text &= "."
End If
End Sub

since thhis frmstatus is hidden in that other form..make sure when u close frmreport frmstatus is also closed.

hope this helps!
 
Back
Top