Issue with 2016.01.08 build in my own application

Stimulsoft Reports.NET discussion
Post Reply
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Issue with 2016.01.08 build in my own application

Post by Jennypi »

Hi,

A developer from my company has embedded Stimulsoft engine into a small application.
You can download this application

I am now trying to update this application in order to use the librairies from the 2016.01.08 prerelease build.
Unfortunately, it generates an "Out of range" error.
Here is the full exception:
System.ArgumentOutOfRangeException was unhandled by user code
HResult=-2146233086
Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
ParamName=index
Source=mscorlib
StackTrace:
at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
at Stimulsoft.Report.Components.StiPagesCollection.get_Item(Int32 index)
at Stimulsoft.Report.Viewer.StiViewerControl.UpdateControlsState()
at Stimulsoft.Report.Viewer.StiViewerControl.set_CurrentPrintPage(Int32 value)
at Stimulsoft.Report.Viewer.StiViewerControl.RefreshInternal()
at Stimulsoft.Report.Viewer.StiViewerControl.Refresh()
at Reports.MainForm.RefreshPreview() in H:\data\databases\Reports\MainForm.cs:line 259
at Reports.MainForm.CreateNewReport() in H:\data\databases\Reports\MainForm.cs:line 232
at Reports.MainForm.OnLoad(EventArgs e) in H:\data\databases\Reports\MainForm.cs:line 216
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Is there a bug in Stimulsoft’s library or did you make a breaking change in your API? The developer working with me tried commenting out a couple lines…

Code: Select all

                                void RefreshPreview()
                                {
                                                //_report.ResetRenderedState();
                                                //_preview.Refresh();
                                                _report.ViewerControl = _preview;
                                                _report.Render();
                                }
That eliminates the error, but we don’t know if it will cause other problems with refresh.

Can you please help us?
Will it help to download the 2016.01.14 buid? There is no list of changes for this version so I don't know if you fixed something related to my problem.

Thank you for your help.
Attachments
install.zip
(19.1 KiB) Downloaded 152 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Issue with 2016.01.08 build in my own application

Post by Alex K. »

Hello,

Please try to use the following code:

Code: Select all

void RefreshPreview()
{
	_report.ResetRenderedState();
        _report.Render();
	_preview.Refresh();
	_report.ViewerControl = _preview;
}
Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Issue with 2016.01.08 build in my own application

Post by Jennypi »

It seems to work perfectly!
Thank you! :)
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Issue with 2016.01.08 build in my own application

Post by Andrew »

Hello.

Great! Thank you for letting us know about this.
Post Reply