<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>Crystal Reports Forum : Writing Code</title>
        <link>https://www.crystalreportsbook.com/forum</link>
        <description>This is an XML content feed of; Crystal Reports Forum : Writing Code : Last 10 Posts</description>
                    <item>
                <title>.NET questions</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22864&amp;PID=74881#74881</link>
                <description>I haven&amp;#039;t done this in Power Shell, however, I hope I can point you in the right direction.
&lt;br /&gt;
&lt;br /&gt;1.  I would replace &amp;#34;HasRecords&amp;#34; with &amp;#34;Refresh&amp;#34; to run the report.
&lt;br /&gt;
&lt;br /&gt;2.  To get to the parameters for the subreport, you actually have to walk through the sections of the report in code to find the subreports and pull the parameters from individual subreports just like you&amp;#039;re doing for the main report.  In fact, I&amp;#039;m surprised your report is even running because I don&amp;#039;t see where you&amp;#039;re setting the credentials for the database connections, which you also have to do for each subreport as well as the main report.
&lt;br /&gt;
&lt;br /&gt;-Dell</description>
                <pubDate>Mon, 20 Apr 2020 05:47:12 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22864&amp;PID=74881#74881</guid>
            </item>
                    <item>
                <title>.NET questions</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22864&amp;PID=74874#74874</link>
                <description>Hello:
&lt;br /&gt;
&lt;br /&gt;I was hoping there where a few .NET gurus here that could help me understand some basic programming using the CRYSTALDECISIONS.SHARED and CRYSTALDECISIONS.ENGINE assemblies.
&lt;br /&gt;
&lt;br /&gt;First off, here is my Powershell code to load a report, set parameters, and then displays the parameters for viewing on the screen.
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;[reflection.assembly]::LoadWithPartialName(&amp;#039;CrystalDecisions.Shared&amp;#039;)
&lt;br /&gt;[reflection.assembly]::LoadWithPartialName(&amp;#039;CrystalDecisions.CrystalReports.Engine&amp;#039;)
&lt;br /&gt;
&lt;br /&gt;$report &amp;#61; New-Object CrystalDecisions.CrystalReports.Engine.ReportDocument
&lt;br /&gt;$report.Load(&amp;#34;C:\TEMPLATE.rpt&amp;#34;)
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;#hard code prompted values here
&lt;br /&gt;$customer &amp;#61; &amp;#039;065447&amp;#039;
&lt;br /&gt;$location &amp;#61; 1000
&lt;br /&gt;$locationsToExclude &amp;#61; 0
&lt;br /&gt;$range &amp;#61; New-Object CrystalDecisions.Shared.ParameterRangeValue
&lt;br /&gt;$range.StartValue &amp;#61; 1
&lt;br /&gt;$range.EndValue &amp;#61; 999
&lt;br /&gt;
&lt;br /&gt;#main report parameter mapping
&lt;br /&gt;$report.SetParameterValue(&amp;#34;Parent&amp;#34;,$customer)
&lt;br /&gt;$report.SetParameterValue(&amp;#34;Location&amp;#34;,$location)
&lt;br /&gt;$report.SetParameterValue(&amp;#34;&amp;#64;LocationsToExclude&amp;#34;,$locationsToExclude)
&lt;br /&gt;$report.SetParameterValue(&amp;#34;LocationRange&amp;#34;,$range)
&lt;br /&gt;
&lt;br /&gt;#sub reports parameter mapping
&lt;br /&gt;$report.SetParameterValue(&amp;#34;Pm-SHIPMENT.PRO&amp;#34;,&amp;#039;FB_Pointer.PRO&amp;#039;)
&lt;br /&gt;
&lt;br /&gt;$report.HasRecords
&lt;br /&gt;
&lt;br /&gt;#$parameterField &amp;#61; New-Object CrystalDecisions.Shared.ParameterField
&lt;br /&gt;
&lt;br /&gt;foreach ($parameterField in $report.DataDefinition.ParameterFields)
&lt;br /&gt;{
&lt;br /&gt;        write-output &amp;#34;The current value of:&amp;#34;
&lt;br /&gt;        $parameterField.Name
&lt;br /&gt;        write-output &amp;#34;In report:&amp;#34;
&lt;br /&gt;        $parameterField.ReportName
&lt;br /&gt;        write-output &amp;#34;is:&amp;#34;
&lt;br /&gt;        $parameterField.CurrentValues.Value
&lt;br /&gt;        write-output &amp;#34;Of kind:&amp;#34;
&lt;br /&gt;        $parameterField.DiscreteOrRangeKind
&lt;br /&gt;        write-output &amp;#34;-------------------&amp;#34;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;QUESTION 1
&lt;br /&gt;What exactly does HASRECORDS do? If I leave out that line, the report has no data and is blank.  Is HASRECORDS basically an &amp;#039;execute&amp;#039; command?
&lt;br /&gt;
&lt;br /&gt;QUESTION 2
&lt;br /&gt;The FOREACH loop at the end simply shows parameter values for each parameter, but the parameters on the sub report never show anything.  How do I access the values of the sub reports?
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;Thanks for any input.</description>
                <pubDate>Thu, 12 Mar 2020 05:02:41 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22864&amp;PID=74874#74874</guid>
            </item>
                    <item>
                <title>ReportDocument.SummaryInfo.Template</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4616&amp;PID=74413#74413</link>
                <description>Or it may not be available.  I would go to https://answers.sap.com/tags/01200314690800000341 on the SAP Community to try to get an answer. Questions in the SAP Crystal Reports tag are read by some of the support folks from SAP and they would probably be able to answer this for you.
&lt;br /&gt;
&lt;br /&gt;-Dell</description>
                <pubDate>Mon, 11 Feb 2019 07:06:00 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4616&amp;PID=74413#74413</guid>
            </item>
                    <item>
                <title>ReportDocument.SummaryInfo.Template</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4616&amp;PID=74401#74401</link>
                <description>I would contact SAP help on that one.  They probably re-named the property to something else.

</description>
                <pubDate>Wed, 30 Jan 2019 05:24:18 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4616&amp;PID=74401#74401</guid>
            </item>
                    <item>
                <title>ReportDocument.SummaryInfo.Template</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4616&amp;PID=74397#74397</link>
                <description>Any news on that? Thank You</description>
                <pubDate>Tue, 29 Jan 2019 13:40:33 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4616&amp;PID=74397#74397</guid>
            </item>
                    <item>
                <title>Null Field</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74074#74074</link>
                <description>Looks correct to me.  Don&amp;#039;t forget about the &amp;#34;Default Values for Nulls&amp;#34;

</description>
                <pubDate>Tue, 19 Jun 2018 09:08:39 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74074#74074</guid>
            </item>
                    <item>
                <title>Null Field</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74073#74073</link>
                <description>Thank you, that is what I am looking for.
&lt;br /&gt;
&lt;br /&gt;What if I wanted to report on 2 blank fields, would it be an if statement or would I just put it in the select expert such as: 
&lt;br /&gt;
&lt;br /&gt;ISNULL({Treatme2.AppUser}) and
&lt;br /&gt;ISNULL({Treatme2.AppDate}) 
&lt;br /&gt;
&lt;br /&gt;Treatme2 is the table. 
&lt;br /&gt;AppUser is the field.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;smText&quot;&gt;Edited by lbuffett - 19 Jun 2018 at 7:09am&lt;/span&gt;</description>
                <pubDate>Tue, 19 Jun 2018 07:08:14 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74073#74073</guid>
            </item>
                    <item>
                <title>Null Field</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74070#74070</link>
                <description>In the select expert, go to the formula editor and do a isnull check on the acceptance date (i.e., isnull({somedate}).  Also make sure the &amp;#34;Default Values for Nulls&amp;#34; is selected in the Formula Workshop.&lt;br /&gt;</description>
                <pubDate>Mon, 18 Jun 2018 04:14:14 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74070#74070</guid>
            </item>
                    <item>
                <title>Null Field</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74068#74068</link>
                <description>Hello
&lt;br /&gt;
&lt;br /&gt;I am trying to figure out how to come up with code (within crystal 2016) that will only show students where the acceptance date is null.  Hopefully, this will show me all students that are incomplete.
&lt;br /&gt;
&lt;br /&gt;Anyone know or have an idea how to do it?  I can find all kinds of SQL statements; however, I am not sure how to do it in crystal.
&lt;br /&gt;
&lt;br /&gt;Les   </description>
                <pubDate>Sat, 16 Jun 2018 17:28:46 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22630&amp;PID=74068#74068</guid>
            </item>
                    <item>
                <title>Formatting text as a date</title>
                <link>https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20750&amp;PID=71700#71700</link>
                <description>Thank you for posting the answer it will be help full to me and many others also. because I also Don&amp;#039;t have Idea about it.</description>
                <pubDate>Wed, 15 Jun 2016 01:28:26 GMT</pubDate>
                <guid isPermaLink="true">https://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20750&amp;PID=71700#71700</guid>
            </item>
            </channel>
</rss>
