0

I am trying to implement custom find control for my SSRS report viewer so that it is also able to search for accented characters in report . So far I am able to achieve only default behaviour of SSRS find() function through my custom code . Is it possible to make SSRS report viewer search for accented characters .

enter image description here

For example , for this column of my report ,if I want to search for Ōtara by typing Otara in the find control , it does not return any result . Can this be achieved? Note : If I type Ōtara in the find control it works as expected

enter image description here

On my page I have report viewer

<rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="1000" Width="100%" AsyncRendering="false" SizeToReportContent="true" ShowParameterPrompts="false" OnReportError="ReportViewer1_ReportError"> </rsweb:ReportViewer>

Here is my script for find and findNext() functionality:

            function find(){
                var textToBeSearched = $('#findTextJs').val();
                var viewer = $find('<%= ReportViewer1.ClientID%>');
        if (!viewer.get_isLoading() && viewer.get_reportAreaContentType() == Microsoft.Reporting.WebFormsClient.ReportAreaContent.ReportPage) {
            viewer.find(textToBeSearched);
        }
                return false;
            }

          function findNext() {
               var viewer = $find('<%= ReportViewer1.ClientID%>');
             
              if (!viewer.get_isLoading() && viewer.get_reportAreaContentType() == Microsoft.Reporting.WebFormsClient.ReportAreaContent.ReportPage) {
                  viewer.findNext();
              }
                   return false;
            }

Please note find and findNext() are working as expected . I am looking for any way it is possible if we can search for accented characters also.

Thom A
  • 88,727
  • 11
  • 45
  • 75
Assassin
  • 70
  • 1
  • 8
  • Like [I said](https://stackoverflow.com/questions/70349000/is-there-any-way-to-search-for-accented-characters-in-ssrs-report-viewer#comment124355649_70349000) in your last question: *"Ensure you are using an Accent Insensitive Collation and then `N'Ōtara'` and `N'Otara'` will be treated as having equal values. "* You are clearly using an Accent **sensitive** collation, and so the 2 do not match. Perhaps you should add a computed (persisted) and indexed column to your table that `COLLATE`s the value to an accent insensitive collation, so that you can query against that. – Thom A Dec 16 '21 at 11:51
  • I am using an Accent Insensitive Collation . – Assassin Dec 16 '21 at 12:02
  • Then the values would match, as you can see in this [db<>fiddle](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=73bed2d9fe5b2806a3698c943b68a681). – Thom A Dec 16 '21 at 12:04
  • I think SSRS report viewer find() does not look into database , it searches in the report output . – Assassin Dec 16 '21 at 12:07
  • But why are you not using parameters in the SQL query? – Thom A Dec 16 '21 at 12:12
  • It does not work that way – Assassin Dec 16 '21 at 12:50
  • so rather than using the Find .. create a parameter that searches the DB instead and make it do the work of the find. Find here in your example will look for matching text in the already rendered report.. no Collation will help you with that! – Harry Dec 17 '21 at 03:25

0 Answers0