Some issues and improvements in Find function

Stimulsoft Reports.WPF discussion
Post Reply
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

Some issues and improvements in Find function

Post by LukasT »

Hello,
Finding in Viewer has some issues. For example, if I find some text, it is highlighted on screen a little weird... see attached image.
weird_finding_stimulsoft.jpg
weird_finding_stimulsoft.jpg (99.59 KiB) Viewed 2353 times
And some questions...
... On the interface of StiWpfViewerControl are two invoke methods - InvokeFindPrevious and InvokeFindNext, but I have no property where I can set finding text. And would be possible to add additional information about finding result - number of all occurrence and current position?
Thank you....
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Some issues and improvements in Find function

Post by HighAley »

Hello.

We couldn't reproduce your issue with highlighting of the searched text. Please, try the latest prerelease build and if there will be the issue too, please, send us a step-by-step instruction how to reproduce the issue.

If you need to implement search feature then we use RoutedUICommand. Here is a sample how we have it done:

Code: Select all

<ToolBar x:Name="findToolBar" DockPanel.Dock="Bottom" FocusManager.IsFocusScope="False" Visibility="{Binding ElementName=viewerControl, Path=FindToolBarVisibility}">
            <Button x:Name="buttonFindClose" Command="viewer:StiWpfViewerControl.FindCloseCommand">
                <wpf:DisabledImage x:Name="imageFindClose" Width="16" Height="16"/>
            </Button>
            <Label x:Name="labelFindWhat" Margin="0,1,0,0"/>
            <TextBox x:Name="textBoxFind" Width="200" KeyDown="textBoxFind_KeyDown" Text=""/>
            <Button Command="viewer:StiWpfViewerControl.FindPreviousCommand">
                <StackPanel Orientation="Horizontal" IsHitTestVisible="False">
                    <Image x:Name="imageFindPrevious" Stretch="None" Margin="4,0"/>
                    <TextBlock x:Name="labelFindPrevious" Padding="0,1,4,2" TextAlignment="Center"/>
                </StackPanel>
            </Button>
            <Button Command="viewer:StiWpfViewerControl.FindCommand" >
                <StackPanel Orientation="Horizontal" IsHitTestVisible="False">
                    <Image x:Name="imageFindNext" Stretch="None" Margin="4,0"/>
                    <TextBlock x:Name="labelFindNext" Padding="0,1,4,2" TextAlignment="Center"/>
                </StackPanel>
            </Button>
            <ToggleButton x:Name="buttonFindMatchCaseSwitch" Command="viewer:StiWpfViewerControl.FindMatchCaseSwitchCommand" Margin="8,0,0,0"
                      IsChecked="{Binding ElementName=viewerControl, Path=IsFindMatchCaseChecked}"/>
            <ToggleButton x:Name="buttonFindMatchWholeWordSwitch" Command="viewer:StiWpfViewerControl.FindMatchWholeWordSwitchCommand" Margin="8,0,0,0"
                      IsChecked="{Binding ElementName=viewerControl, Path=IsFindMatchWholeWordChecked}"/>
            <ProgressBar Margin="12,4,4,4" Name="progressBarFind" Width="150" Visibility="Collapsed"/>
        </ToolBar>
We have added a new property of the Viewer -- TextSearch. It will be available in our next prerelease build.

Thank you.
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

Re: Some issues and improvements in Find function

Post by LukasT »

Is possible, that it is wrong highlighted due hidden find toolbar....? I parsed StiWpfViewerControl visual and I am putting searched text into "textBoxFind" TextBox and calling InvokeFindPrevious and InvokeFindNext and your toolbar is hidden, so maybe you are counting position of highlighting boxes from some point including position of find toolbar...

Thank you for TextSearch property... and what about some property, which can indicate that exists some finding result... or that something is highlighted?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Some issues and improvements in Find function

Post by HighAley »

Hello.

We still couldn't reproduce your issue.
Please, send us a working project which reproduces the issue.

Thank you.
Post Reply