Page 1 of 1

Scroll to last Position in View after rendering

Posted: Wed Feb 05, 2025 12:15 pm
by cubinator
Hi,

i have the following Issue.
In my Report I can add datasets by clicking certain Textfields in the Databands.
After adding the new dataset I render by Report.Render(true).

The Problem is that after rendering the view jumps again to the top of the ReportView.
It would be important for us that the report-user doesn't have to scroll manually, after rendering, to the position
where the new Dataset was inserted.

The thing that I've tried out is to find the Label of the new dataset by:

Code: Select all

[StiFindHelper finder = new StiFindHelper();
finder.StartFind("lorem", this.RenderedPages, true, true);


However this ends with the following exception (invalid file format):

Code: Select all

   bei System.Windows.Forms.RichTextBox.StreamIn(Stream data, Int32 flags)
   bei System.Windows.Forms.RichTextBox.StreamIn(String str, Int32 flags)
   bei System.Windows.Forms.RichTextBox.set_Rtf(String value)
   bei Stimulsoft.Report.Viewer.StiFindHelper.StartFind(String value, StiPagesCollection pages, Boolean matchCase, Boolean matchWholeWord)
   bei Reports.Report.FindText()
   bei Stimulsoft.Report.Components.StiComponent.InvokeClick(Object sender, EventArgs e)
   bei Stimulsoft.Report.Viewer.StiViewerControl.View_Click(Object sender, EventArgs e)
What do I make wrong?
Or is there another Way to solve my problem?

Re: Scroll to last Position in View after rendering

Posted: Wed Feb 05, 2025 9:56 pm
by Lech Kulikowski
Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.

Re: Scroll to last Position in View after rendering

Posted: Thu Feb 06, 2025 10:17 am
by cubinator
Can I send you the .mrt File?

Re: Scroll to last Position in View after rendering

Posted: Thu Feb 06, 2025 12:26 pm
by Lech Kulikowski
Hello,

Any sample that allows us to reproduce the issue.

Thank you.

Re: Scroll to last Position in View after rendering

Posted: Mon Mar 17, 2025 10:20 am
by cubinator
Hi,

I've found out that the problem only is in existence with one certain report of mine. With all the other reports it works fine.

However I realised that FindHelper only solves part of my issue.
FindHelper only highlights the searched text but i does not scroll automatically to the text.
So I tried to pass the found componets from FindHelper to StiReport.ViewerControl.ScrollToComponent();
But it did not scroll automatically to the textpassage.

The testmethod that is declined by event looks something like this and is defined as custom methode in class Report.

Code: Select all

public void FindText()
		{
			StiViewerForm viewerForm = StiGuiOptions.GetViewerForm(this, StiGuiMode.Gdi) as StiViewerForm;
			viewerForm.Report = this;
			this.ViewerControl = viewerForm.ViewerControl;
			
			StiFindHelper finder = new StiFindHelper();
			finder.StartFind("Kalczyk", this.RenderedPages, true, true);

			StiViewerControl viewerControllConverted = this.ViewerControl as StiViewerControl;
			viewerControllConverted.ScrollToComponent(finder.FindedComponents[0]);
		}
What did I make wrong.

Re: Scroll to last Position in View after rendering

Posted: Mon Mar 17, 2025 3:50 pm
by Lech Kulikowski
Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.

Re: Scroll to last Position in View after rendering

Posted: Wed Mar 19, 2025 9:03 am
by cubinator
Hi,

plesae see the attached .mrt and code.

Re: Scroll to last Position in View after rendering

Posted: Wed Mar 19, 2025 1:58 pm
by Lech Kulikowski
Hello,

Please send us a sample project that we can run and reproduce the issue for analysis.

Thank you.