Scroll to last Position in View after rendering

Stimulsoft Reports.NET discussion
Post Reply
cubinator
Posts: 4
Joined: Wed Feb 05, 2025 11:36 am

Scroll to last Position in View after rendering

Post 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?
Lech Kulikowski
Posts: 7184
Joined: Tue Mar 20, 2018 5:34 am

Re: Scroll to last Position in View after rendering

Post by Lech Kulikowski »

Hello,

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

Thank you.
cubinator
Posts: 4
Joined: Wed Feb 05, 2025 11:36 am

Re: Scroll to last Position in View after rendering

Post by cubinator »

Can I send you the .mrt File?
Lech Kulikowski
Posts: 7184
Joined: Tue Mar 20, 2018 5:34 am

Re: Scroll to last Position in View after rendering

Post by Lech Kulikowski »

Hello,

Any sample that allows us to reproduce the issue.

Thank you.
cubinator
Posts: 4
Joined: Wed Feb 05, 2025 11:36 am

Re: Scroll to last Position in View after rendering

Post 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.
Lech Kulikowski
Posts: 7184
Joined: Tue Mar 20, 2018 5:34 am

Re: Scroll to last Position in View after rendering

Post by Lech Kulikowski »

Hello,

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

Thank you.
cubinator
Posts: 4
Joined: Wed Feb 05, 2025 11:36 am

Re: Scroll to last Position in View after rendering

Post by cubinator »

Hi,

plesae see the attached .mrt and code.
Attachments
Code.txt
(3 KiB) Downloaded 38 times
Kopie von DDL Mitarbeiterinformation.mrt
(27.92 KiB) Downloaded 36 times
Lech Kulikowski
Posts: 7184
Joined: Tue Mar 20, 2018 5:34 am

Re: Scroll to last Position in View after rendering

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply