<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Crystal Reports not running for Query using XML Path in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918637#M4477304</link>
    <description>&lt;P&gt;Thanks Dell for the prompt response, I have been pulling my little hair for a while.&lt;/P&gt;&lt;P&gt;Driver = SQL Server Native Client 11.00&lt;STRONG&gt; ( Crystal Report is 2008 NOT 2012) &lt;/STRONG&gt;Sorry it was a typo before. The &lt;STRONG&gt;SQL Server I am connection is SQL 2012.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;There is another supplementary question:&lt;/P&gt;&lt;P&gt;Will I be able to Compare/Match the output string with another string from a different table using above method ?&lt;/P&gt;&lt;P&gt;Once again thanks a lot for this proposed solution, I will update the outcome shortly.&lt;/P&gt;&lt;P&gt;Sarfraz&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2019 08:01:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-05-10T08:01:55Z</dc:date>
    <item>
      <title>Crystal Reports not running for Query using XML Path</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaq-p/11918635</link>
      <description>&lt;P&gt;Hi fellows,&lt;/P&gt;
  &lt;P&gt;First question in this forum so please pardon me for any mistake.&lt;/P&gt;
  &lt;P&gt;I am using the following query in of the view in SQL 2012 &amp;amp; my Crystal Report Version is 2012&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;IMG alt="" /&gt;&lt;IMG alt="" /&gt;&lt;A href="https://answers.sap.com/storage/temp/1681697-query.jpg"&gt;query.jpg&lt;/A&gt; (See the attachment for query details) couldn't paste it here.&lt;/P&gt;
  &lt;P&gt;it's working fine and giving me the results I am after. However, I am call this view from Crystal reports it comes up with the following error&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1681694-5c9gz.png" /&gt;&lt;/P&gt;
  &lt;P&gt;If I remove the end part from the same query i.e. &lt;/P&gt;
  &lt;P&gt;TYPE).value('(./text())[1]','varchar(max)') it works fine.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;I have tried to SET_ANSI_NULLS &amp;amp; QUOTED_IDENTIFIER OFF but that didn't give me any joy.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;Can someone please help me as it's making me crazy and delaying the project further.&lt;/P&gt;
  &lt;P&gt;P.S.&lt;/P&gt;
  &lt;P&gt;Alternatively, if someone could please propose a solution for concatenation in CR 20018 as below scenario:&lt;/P&gt;
  &lt;P&gt;Table Data&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1681695-9ypef.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Solution required.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1681696-ji2up.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Adapted from &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://www.codeproject.com/Articles/691102/String-Aggregation-in-the-World-of-SQL-Server"&gt;https://www.codeproject.com/Articles/691102/String-Aggregation-in-the-World-of-SQL-Server&lt;/A&gt; &lt;/P&gt;
  &lt;P&gt;Thanks in advance, looking forward for a prompt response.&lt;/P&gt;
  &lt;P&gt;Cheers,&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;Sarfraz&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 07:38:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaq-p/11918635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-09T07:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports not running for Query using XML Path</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918636#M4477303</link>
      <description>&lt;P&gt;Which SQL Server ODBC driver are you using and what version of SQL Server are you connecting to?&lt;/P&gt;&lt;P&gt;One way to do this using just Crystal formulas would be this:&lt;/P&gt;&lt;P&gt;1.  Group by EntityID.  Suppress the group header and details section.,&lt;/P&gt;&lt;P&gt;2.  Create two formulas, both of which will look something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{@ConcatValue1}
WhilePrintingRecords;
StringVar v1;
if OnFirstRecord or previous({Entity ID}) &amp;lt;&amp;gt; {Entity ID} then v1 := "";
if v1 = "" then 
  v1 := {Value1}
else
  v1 := ", " + {Value1};
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;3.  Put both of these formulas in the suppressed details section.&lt;/P&gt;&lt;P&gt;4.  Create another pair of formulas to display the values:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{@ShowValue1}
WhilePrintingRecords;
StringVar v1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;5.  Display the data in the group footer section.&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 14:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918636#M4477303</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2019-05-09T14:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports not running for Query using XML Path</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918637#M4477304</link>
      <description>&lt;P&gt;Thanks Dell for the prompt response, I have been pulling my little hair for a while.&lt;/P&gt;&lt;P&gt;Driver = SQL Server Native Client 11.00&lt;STRONG&gt; ( Crystal Report is 2008 NOT 2012) &lt;/STRONG&gt;Sorry it was a typo before. The &lt;STRONG&gt;SQL Server I am connection is SQL 2012.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;There is another supplementary question:&lt;/P&gt;&lt;P&gt;Will I be able to Compare/Match the output string with another string from a different table using above method ?&lt;/P&gt;&lt;P&gt;Once again thanks a lot for this proposed solution, I will update the outcome shortly.&lt;/P&gt;&lt;P&gt;Sarfraz&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 08:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918637#M4477304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-10T08:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports not running for Query using XML Path</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918638#M4477305</link>
      <description>&lt;P&gt;Hi Dell,&lt;/P&gt;&lt;P&gt;The solution you provided has given me the desired results. I only had to tweak little bit but more or less same logic.&lt;/P&gt;&lt;P&gt;Now the last (hopefully) problem left , that is I am comparing  two strings using formula, if two values "matched", result is printed on the report and if not matched, it prints " Mismatched" , it's also working perfectly fine.&lt;/P&gt;&lt;P&gt;Now, I want to use a parameter for user to select either "Matched" or "Mismatched values", unfortunately what I am reading it's not possible in CR to use formula field as parameter. Unless I am missing something?&lt;/P&gt;&lt;P&gt;Second option I could print only 'mismatched' values on the report but even this is not achievable for me. I will appreciate if you could look into this for me.&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 08:03:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918638#M4477305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-10T08:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports not running for Query using XML Path</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918639#M4477306</link>
      <description>&lt;P&gt;Assuming that your formula for matched/mismatched is called {@IsMatched}:&lt;/P&gt;&lt;P&gt;1.  Create a parameter with the options Matched, Mismatched, All.  I'll call this {?RecordType} for this example.&lt;/P&gt;&lt;P&gt;2.  In the &lt;STRONG&gt;Group&lt;/STRONG&gt; Select Expert (not the record select expert...), use a formula like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{?RecordType} = 'All' or
{?RecordType} = {@IsMatched}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This should give you what you're looking for.&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2019 00:04:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918639#M4477306</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2019-05-12T00:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports not running for Query using XML Path</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918640#M4477307</link>
      <description>&lt;P&gt;Thank you very much for all the assistance. It worked fine !&lt;/P&gt;&lt;P&gt;P.S. The initial 'Quoted Identifier' was resolved by updating drivers to &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Microsoft ODBC Driver for SQL Server Version 14.00.1000&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now report is working fine. &lt;BR /&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 06:49:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-not-running-for-query-using-xml-path/qaa-p/11918640#M4477307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-14T06:49:33Z</dc:date>
    </item>
  </channel>
</rss>

