Page 1 of 1

Report Preview Window

Posted: Tue May 08, 2007 5:52 am
by satisht
How to focus report preview window?

Report Preview Window

Posted: Tue May 08, 2007 9:31 am
by Edward
Please set FocusOnLoad property of the Preview control in true.

If you need do this after showing the report please use the following:

Code: Select all

stiPreviewControl.View.Focus();
Thank you.

Report Preview Window

Posted: Tue May 08, 2007 11:30 pm
by satisht
Report is a StiReport object
I have used both options but it is giving same error
that ' Object Refrence not set to the instance of object."

1. Report.PreviewControl.FocusOnLoad = True
Report.Compile()
Report.Show()


2. Report.Compile()
Report.Show()
Report.PreviewControl.View.Focus()

How should i resolve this?

Report Preview Window

Posted: Wed May 09, 2007 4:19 am
by Edward
satisht wrote:Report is a StiReport object
I have used both options but it is giving same error
that ' Object Refrence not set to the instance of object."

1. Report.PreviewControl.FocusOnLoad = True
Report.Compile()
Report.Show()


2. Report.Compile()
Report.Show()
Report.PreviewControl.View.Focus()

How should i resolve this?
You should to resolve this in the following way:

Code: Select all

stiPreviewControl1.Report = report;
stiPreviewControl1.Focus();
The stiPreviewControl1 is a custom StiPreviewControl which you can use in your Application for providing custom previewing of the report. For more information please see the CustomPreview sample Application from the standard delivery.

But if you do not want using of StiPreviewControl then the preview form of the report may be focused from any other form in your application in the following way:

Code: Select all

        Dim form As Object
        For Each form In Application.OpenForms
            If TypeOf form Is Stimulsoft.Report.Render.StiPreviewForm Then
                TryCast(form, Stimulsoft.Report.Render.StiPreviewForm).Focus()
            End If
        Next
If these solutions are not suitable for your task then please provide me with more information about your goal.

Thank you.

Report Preview Window

Posted: Wed May 09, 2007 5:12 am
by satisht
Thanks it works!

Report Preview Window

Posted: Wed May 09, 2007 6:07 am
by Edward
Let us know if you need any help.

Thank you.