Preview Control Questions

Stimulsoft Reports.NET discussion
Post Reply
casic
Posts: 68
Joined: Thu Jan 18, 2007 4:25 pm
Location: Germany

Preview Control Questions

Post by casic »

Hi there,

I still try to integrate the preview control into my own preview form but I have some problems retrieving neccessary information:

- Current zoom factor
- "ActivePageChanged" event (to get notified when an other page was selected, e.g. PgDown/PgUp keys)

Also, I didn't found a way to stop loading/saving the preview configuration - this is a heavy problem because the PageViewMode-property always use the value of the configuration file instead of the property value (specified in the form designer). Setting the property at runtime, it only works after rendering which results in some flicker effects...

It would be great to have a "Light"-version of the preview control without toolbar, statusbar, loading/saving configuration etc. - only with the neccessary properties, methods and events so it can be used in own preview controls or forms.

Thank you for your support,

Markus
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Preview Control Questions

Post by Vital »

I still try to integrate the preview control into my own preview form but I have some problems retrieving neccessary information:

- Current zoom factor
You can get zoom from Report.Info.Zoom property.
- "ActivePageChanged" event (to get notified when an other page was selected, e.g. PgDown/PgUp keys)
Please check CurrentPageChanged event (available in build from Jan, 22).
Also, I didn't found a way to stop loading/saving the preview configuration - this is a heavy problem because the PageViewMode-property always use the value of the configuration file instead of the property value (specified in the form designer). Setting the property at runtime, it only works after rendering which results in some flicker effects...
Please use following code:

Code: Select all

StiSettings.Load();
StiSettings.Set("StiPreviewControl", "PageViewMode", PageViewMode);
StiSettings.Save();
Thank you.
casic
Posts: 68
Joined: Thu Jan 18, 2007 4:25 pm
Location: Germany

Preview Control Questions

Post by casic »

You can get zoom from Report.Info.Zoom property.
Unfortunately this works only once: Using the methods SetZoomOnePage or SetZoomPageWidth after rendering doesn't update the zoom property. It seems, that after using these methods the configuration file is loaded again and the zoom property is set to the value of the config file.

Is there a way to disable the usage of a config file (like DontSaveDesignerConfig property of the designer)?

Thank you,

Markus
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Preview Control Questions

Post by Edward »

casic wrote:You can get zoom from Report.Info.Zoom property.

Unfortunately this works only once: Using the methods SetZoomOnePage or SetZoomPageWidth after rendering doesn't update the zoom property.
Please use the last build from the January, 24.
casic wrote:It seems, that after using these methods the configuration file is loaded again and the zoom property is set to the value of the config file.

Is there a way to disable the usage of a config file (like DontSaveDesignerConfig property of the designer)?
It is impossible in the nearest versions of StimulReport.Net.

Thank you.
casic
Posts: 68
Joined: Thu Jan 18, 2007 4:25 pm
Location: Germany

Preview Control Questions

Post by casic »

Edward wrote:
casic wrote:You can get zoom from Report.Info.Zoom property.

Unfortunately this works only once: Using the methods SetZoomOnePage or SetZoomPageWidth after rendering doesn't update the zoom property.
Please use the last build from the January, 24.
Sorry, this also doesn't work in the new build. I used the following test code:

Code: Select all

MessageBox.Show(stiPreviewControl1.Report.Info.Zoom.ToString());
stiPreviewControl1.SetZoomPageWidth();
MessageBox.Show(stiPreviewControl1.Report.Info.Zoom.ToString());
stiPreviewControl1.SetZoom(m_report.Info.Zoom*100);
The Zoom property still contains the same value.

cu

Markus
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Preview Control Questions

Post by Edward »

Please use instead of stiPreviewControl1.Report properties of the CompiledReport object.

so your lines will be the following:

Code: Select all

MessageBox.Show(stiPreviewControl1.Report.CompiledReport.Info.Zoom.ToString());
Thank you.
casic
Posts: 68
Joined: Thu Jan 18, 2007 4:25 pm
Location: Germany

Preview Control Questions

Post by casic »

That's it!

Thank you,

Markus
Post Reply