<?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: ReportDocument.ReadRecords() does not query for subreport. in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298948#M4609652</link>
    <description>&lt;P&gt;I've changed the SetCon method in my app to the below code and debugged. Every time, "testc" was set to true. It's definitely connected, just not actually querying after the initial query.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;		static void SetConn(CrystalDecisions.CrystalReports.Engine.ReportDocument doc, CrystalDecisions.Shared.ConnectionInfo cinfo)
			{
			CrystalDecisions.CrystalReports.Engine.Tables tables = doc.Database.Tables;


			bool testc = false;


			foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
				{
				TableLogOnInfo tableLogonInfo = table.LogOnInfo;
				tableLogonInfo.ConnectionInfo = cinfo;
				table.ApplyLogOnInfo(tableLogonInfo);


				testc = table.TestConnectivity();
				testc = false; //breakpoint is here to check all tables' connectivity for issues
				}


			if (!doc.IsSubreport)
				{
				foreach (CrystalDecisions.CrystalReports.Engine.ReportDocument theSub in doc.Subreports)
					SetConn(theSub, cinfo);
				}
			}
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Oct 2020 04:33:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-10-26T04:33:21Z</dc:date>
    <item>
      <title>ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaq-p/12298937</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;May I preface that I am a first time user of these libraries and have just started this project with very little knowledge or help, just some examples of what our business has done in the past.&lt;/P&gt;
  &lt;P&gt;I'm building my project around &lt;A href="https://answers.sap.com/storage/temp/1856449-reportxml.txt"&gt;reportxml.txt&lt;/A&gt; (attached, can't upload the actual report so I converted it with RptToXML).&lt;/P&gt;
  &lt;P&gt;The report has 1 main report and 2 subreports. the main has no parameters, which I'm using ReportDocument.RecordSelectionFormula instead for. there are 4 linked parameters on the subgroups.&lt;/P&gt;
  &lt;P&gt;I've been able to set the ConnectionInfo and DbConnectionAttributes correctly for the main report and subreports, and the ReportDocument.ReadRecords method appears to query the DB at least once correctly, according to SQL Server Profiler.&lt;/P&gt;
  &lt;P&gt;That is where everything shuts down. It doesn't make any further queries and when I try and export a document, there is nothing in it. ReadRecords produces 0 ReportDocument.Rows.&lt;/P&gt;
  &lt;P&gt;The report comes from a system that is currently querying the DB and successfully producing a report when I use their interface. I've watched the Sql Server profiler and it appears to query 3 times (one for main, 2 subreport queries) when running a report in their interface.&lt;/P&gt;
  &lt;P&gt;EDIT: using SAP Crystal Reports version: &lt;A href="https://www.nuget.org/packages/CrystalReports.Engine/13.0.3501"&gt;13.0.3501&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;Here is the code I am using:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;		static void SetConn(ReportDocument doc, ConnectionInfo cinfo)
			{
			Tables tables = doc.Database.Tables;


			foreach (Table table in tables)
				{
				TableLogOnInfo tableLogonInfo = table.LogOnInfo;
				tableLogonInfo.ConnectionInfo = cinfo;
				table.ApplyLogOnInfo(tableLogonInfo);
				}


			if (!doc.IsSubreport)
				{
				foreach (ReportDocument theSub in doc.Subreports)
					SetConn(theSub, cinfo);
				}
			}


		static void Main(string[] args)
			{
				string file = "C:\\report.rpt";
				try
					{
					ReportDocument doc = null;
					ConnectionInfo cinfo = new ConnectionInfo();
					DbConnectionAttributes dbAttributes = new DbConnectionAttributes();
					cinfo.LogonProperties.Clear();
					cinfo.Attributes.Collection.Clear();


					dbAttributes.Collection.Set("Auto Translate", "-1");
					dbAttributes.Collection.Set("Connect Timeout", "15");
					dbAttributes.Collection.Set("Data Source", "&amp;lt;servername&amp;gt;");
					dbAttributes.Collection.Set("General Timeout", "0");
					dbAttributes.Collection.Set("Initial Catalog", "&amp;lt;dbname&amp;gt;");
					dbAttributes.Collection.Set("Integrated Security", false);
					dbAttributes.Collection.Set("Locale Identifier", "1033");
					dbAttributes.Collection.Set("OLE DB Services", "-5");
					dbAttributes.Collection.Set("Provider", "SQLOLEDB");
					dbAttributes.Collection.Set("Tag with column collation when possible", "0");
					dbAttributes.Collection.Set("Use DSN Default Properties", false);
					dbAttributes.Collection.Set("Use Encryption for Data", "0");


					cinfo.LogonProperties.Clear();
					cinfo.Attributes.Collection.Clear();
					cinfo.DatabaseName = "&amp;lt;dbname&amp;gt;";
					cinfo.ServerName = "&amp;lt;servername&amp;gt;";
					cinfo.UserID = "&amp;lt;username&amp;gt;";
					cinfo.Password = "&amp;lt;password&amp;gt;";
					cinfo.Attributes.Collection.Set("Database DLL", "crdb_ado.dll");
					cinfo.Attributes.Collection.Set("QE_DatabaseName", "&amp;lt;dbname&amp;gt;");
					cinfo.Attributes.Collection.Set("QE_DatabaseType", "OLE DB (ADO)");
					cinfo.Attributes.Collection.Set("QE_LogonProperties", dbAttributes);
					cinfo.Attributes.Collection.Set("QE_ServerDescription", "&amp;lt;servername&amp;gt;");
					cinfo.Attributes.Collection.Set("QE_SQLDB", true);
					cinfo.Attributes.Collection.Set("SSO Enabled", false);
					cinfo.LogonProperties = dbAttributes.Collection;


					doc = new ReportDocument();
					doc.Load(file);


					SetConn(doc, cinfo);
					doc.Refresh();


					doc.RecordSelectionFormula = "{person.person_id}='86A835D1-F85C-4EEB-82CC-43866414F490' AND {patient_encounter.enc_id}='98AA1E61-9334-4D9E-A3D0-36E041FBCA31'";


					doc.VerifyDatabase();
					doc.ReadRecords();
					int rowcnt = doc.Rows.Count;
					
					doc.ExportToDisk(ExportFormatType.PortableDocFormat, @"C:\DocTemp\" + DateTime.Now.ToString("yyyyMMddHHmm") + ".pdf");




					}
				catch (Exception ex)
					{
					}

			}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 07:59:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaq-p/12298937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-22T07:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298938#M4609642</link>
      <description>&lt;P&gt;First thing to do is not use that FlexNet site for downloading CR runtime, we don't support it.&lt;/P&gt;&lt;P&gt;SP 28 is actually version 13.0.3500.0, for some reason they rename it.&lt;/P&gt;&lt;P&gt;Go here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads" target="test_blank"&gt;https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads&lt;/A&gt;&lt;/P&gt;&lt;P&gt;SP 29 is the latest release, the assembly versions will be 13.0.4000.0.&lt;/P&gt;&lt;P&gt;Try this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;RowsetController boRowsetController;
RowsetCursor boRowsetCursor;


GroupPath gp = new GroupPath();
gp.FromString("*"); // this changes the results but it is not the complete count and it does not get the subreport SQL
int rows;
boRowsetController = rptClientDoc.RowsetController;
try
{
    if (!IsLoggedOn &amp;amp;&amp;amp; rptSQLExpress == 0)
    {
        btnReportObjects.Text += "\nPlease wait, attempting to get SQL Statement, requires being logged on first\n";
        btnReportObjects.Update();
        boRowsetCursor = boRowsetController.CreateCursor(gp, new RowsetMetaData(), 0);


        (boRowsetCursor).RowsetController.RowsetBatchSize = 1000;
        (boRowsetCursor).Rowset.BatchSize = 1000;
        (boRowsetCursor).MoveLast();
        rows = boRowsetCursor.RecordCount;
        txtRecordCount.Text = rows.ToString();
    }
    else
    {
        btnReportObjects.Text += "\nSee SQL Statement box for SQL info for main and/or subreport";
        btnReportObjects.Text += "\nReport may be using SQLExpressions which require being logged on first";
    }
}
catch (Exception ex)
{
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Don&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 12:48:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298938#M4609642</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2020-10-22T12:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298939#M4609643</link>
      <description>&lt;P&gt;Can you explain what's happening in this code? I can't see where the document is loaded nor where I would filter results. I am updating now to SP29, but I remember having an exception thrown in ReportDocument.Refresh() "Object reference not set to an instance of an object". I'll let you know how that goes.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:57:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298939#M4609643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-22T13:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298940#M4609644</link>
      <description>&lt;P&gt;Ah, sorry about that. The problem is you are using the ReportDocument (Engine), what you need to do is use the ReportClientDocument (RAS), Engine only allows some info and basic changes to be done, for detailed info retrieval you need to use RAS.&lt;/P&gt;&lt;P&gt;Download my parameter test app:&lt;/P&gt;&lt;H4&gt;&lt;A href="https://blogs.sap.com/2016/02/17/how-to-parameters-in-crystal-reports-for-visual-studio-net/"&gt;how-to-parameters-in-crystal-reports-for-visual-studio-net&lt;/A&gt;&lt;/H4&gt;&lt;P&gt;It has examples of how to open the report using the Engine and then converting that report object to a RAS object&lt;/P&gt;&lt;P&gt;Regarding the error...&lt;/P&gt;&lt;P&gt;When ever you get "Object reference not set to an instance of an object" it means the report object you have has gone out of scope, means exactly what it says, in debug mode mouse over the report object in your code, you'll see it's null.&lt;/P&gt;&lt;P&gt;Don't use Refresh, it's not required, every change you programmed gets triggered when you preview, export or print the report.&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 16:06:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298940#M4609644</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2020-10-22T16:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298941#M4609645</link>
      <description>&lt;P&gt;The problem with SP29 (ReportDocument.Refresh() "Object reference not set to an instance of an object") seems to be resolved, but It appears I'm having the same problem as when I originally posted, regardless of the reinstall/upgrade to SP29. I will need a better explanation of how to use your code above, as it doesn't seem to tie in to the code I'm currently using (ex. What is a GroupPath and RowsetController?)&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 19:53:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298941#M4609645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-22T19:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298942#M4609646</link>
      <description>&lt;P&gt;The Get Query is a bonus, not needed for your example. Actually the sample code doesn't get the row count, just add my code in a button to get it for testing.&lt;/P&gt;&lt;P&gt;OK so that's odd, it works on some PC's but not others.&lt;/P&gt;&lt;P&gt;Likely missing the database driver or Client.&lt;/P&gt;&lt;P&gt;Do some debugging, some dependency is missing.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 20:08:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298942#M4609646</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2020-10-22T20:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298943#M4609647</link>
      <description>&lt;P&gt;Thanks, and I did download the project and try some things. I'm not really sure what i need to do differently though, even based on the code I'm looking at. There is a lot of code in there showing how to get the SQL out of reports, but why is that of interest here? I was under the impression that when you export, all the queries in the report are run to fill in the report PDF. Is this not true? Do I need to do something else? The reason I ask is that it only runs one report query for me when exported, but runs 3 (correct number) on another system that produces the desired report PDF. the 2 subreport links should indicate to the report that is run how to query.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 11:46:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298943#M4609647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-23T11:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298944#M4609648</link>
      <description>&lt;P&gt;I've tried the code you posted earlier on my report. First, the "RowsetController.CreateCursor" method thew an exception:&lt;/P&gt;&lt;P&gt;{System.Runtime.InteropServices.COMException (0x8000023A): Error in File VerifyMedsAndAllergies 110480_135384_{103335E6-77B2-4FBD-A9E7-4E481E03EA9C}.rpt:
Invalid group number.
   at CrystalDecisions.ReportAppServer.Controllers.RowsetControllerClass.CreateCursor(ISCRGroupPath GroupPath, RowsetMetaData MetaData, Int32 Reserved)
   at Program.Main(String[] args) in D:\Program.cs:line 239}&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Then, I removed the "gp.FromString("*")" to see if that would help and it doesn't throw, but it gets 0 rows and makes the exact same query as ReportDocument.ReadRecords() on the DB according to sql server profiler. what is that line for? (gp.FromString("*"))&lt;/P&gt;&lt;P&gt;It is definitely not a Database driver issue, since the one query is happening, but nothing else.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 11:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298944#M4609648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-23T11:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298945#M4609649</link>
      <description>&lt;P&gt;Did you uninstall what ever previous version you had installed and replace all CR Assemblies with SP 29 and verify by looking a the properties of each assembly it's being loaded from the same location and same platform?&lt;/P&gt;&lt;P&gt;If all CR assemblies are x86 then you'll see this location for each dll.&lt;/P&gt;&lt;P&gt;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.CrystalReports.Engine.dll&lt;/P&gt;&lt;P&gt;Check your references also, you should have all of these:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportAppServer;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.ReportDefModel;
using CrystalDecisions.ReportAppServer.CommonControls;
using CrystalDecisions.ReportAppServer.CommLayer;
using CrystalDecisions.ReportAppServer.CommonObjectModel;
using CrystalDecisions.ReportAppServer.ObjectFactory;
using CrystalDecisions.ReportAppServer.Prompting;
using CrystalDecisions.ReportAppServer.DataSetConversion;
using CrystalDecisions.ReportAppServer.DataDefModel;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Windows.Forms;
using CrystalDecisions.ReportAppServer.XmlSerialize;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Oct 2020 13:24:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298945#M4609649</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2020-10-23T13:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298946#M4609650</link>
      <description>&lt;P&gt;Hi Trent,&lt;/P&gt;&lt;P&gt;Thanks for the report, without data though I can't get the record count. And the only way to get the count is being logged onto the data source, main and subreports.&lt;/P&gt;&lt;P&gt;Same for you, you need to log on to both before records can be retrieved. And you need to preview the report to be able to get the record count.&lt;/P&gt;&lt;P&gt;We don't have a process that can get the count without saved data, because CRD is a multi-pass processing tool, we need to read records and then depending on the reports format, the placement of data fields into the various parts of the report, Header, Details, subreports etc.&lt;/P&gt;&lt;P&gt;So getting a record count on a report without saved data won't work, and only reason no data would be returned in the subreports is because the log on info failed.&lt;/P&gt;&lt;P&gt;When you set the log on info for both main and subreports try using this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;try
{
    if (crTable.TestConnectivity())
        ConWorks = true;
    else
        ConWorks = false;
}
catch (Exception ex)
{
    btnSQLStatement.Text += "Test Connectivity failed: " + ex.ToString();
}
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If that fails then you know why your subs show no data.&lt;/P&gt;&lt;P&gt;As I said, don't use VerifyDatabase, it can cause the report to run a second time without any values you set in code.&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 15:20:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298946#M4609650</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2020-10-23T15:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298947#M4609651</link>
      <description>&lt;P&gt;Also, I have run the query that it DOES do, and I get 1 row (pictured below). I ran it directly on the server the report is connected to in SQL Server Management studio.&lt;/P&gt;&lt;P&gt;If the report does a query that should retrieve one row, shouldn't it continue to execute further queries based on the fields in the report? Is there something else I need to do to make that happen?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 04:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298947#M4609651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-26T04:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298948#M4609652</link>
      <description>&lt;P&gt;I've changed the SetCon method in my app to the below code and debugged. Every time, "testc" was set to true. It's definitely connected, just not actually querying after the initial query.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;		static void SetConn(CrystalDecisions.CrystalReports.Engine.ReportDocument doc, CrystalDecisions.Shared.ConnectionInfo cinfo)
			{
			CrystalDecisions.CrystalReports.Engine.Tables tables = doc.Database.Tables;


			bool testc = false;


			foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
				{
				TableLogOnInfo tableLogonInfo = table.LogOnInfo;
				tableLogonInfo.ConnectionInfo = cinfo;
				table.ApplyLogOnInfo(tableLogonInfo);


				testc = table.TestConnectivity();
				testc = false; //breakpoint is here to check all tables' connectivity for issues
				}


			if (!doc.IsSubreport)
				{
				foreach (CrystalDecisions.CrystalReports.Engine.ReportDocument theSub in doc.Subreports)
					SetConn(theSub, cinfo);
				}
			}
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Oct 2020 04:33:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298948#M4609652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-26T04:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298949#M4609653</link>
      <description>&lt;P&gt;Since I'd like to be thorough and assure you're getting all the necessary tools to troubleshoot, here is a link to the report I'm trying to export as PDF:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1LRPJOOp_6321ZQPMUH4FjEwpKkIAec-d/view?usp=sharing" target="_blank"&gt;report link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 08:31:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298949#M4609653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-26T08:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298950#M4609654</link>
      <description>&lt;P&gt;Yes, I have verified All referenced files are from that directory (it is x86) and I've referenced all in the .CS file exactly as you state. I see no change in execution after verification to the resultant PDF, it's still blank after running. The previous code you shared still causes the same exception, and when the gp.FromString("*") line is commented out, returns 0 rows.&lt;/P&gt;&lt;P&gt;The database is still only being queried once when exporting, like so:&lt;/P&gt;&lt;P&gt;SELECT "person"."other_id_number", "person"."first_name", "person"."middle_name", "person"."last_name", "patient"."practice_id", "patient"."person_id", "person"."person_id", "patient_encounter"."enc_id" FROM   ("patient" "patient" INNER JOIN "person" "person" ON "patient"."person_id"="person"."person_id") INNER JOIN "patient_encounter" "patient_encounter" ON ("patient"."practice_id"="patient_encounter"."practice_id") AND ("patient"."person_id"="patient_encounter"."person_id") WHERE  "person"."person_id"='86A835D1-F85C-4EEB-82CC-43866414F490' AND "patient_encounter"."enc_id"='98AA1E61-9334-4D9E-A3D0-36E041FBCA31'&lt;/P&gt;&lt;P&gt;The interface that IS working correctly (not mine) queries the database 3 times, once EXACTLY the same as above and 2 others, like so:&lt;/P&gt;&lt;P&gt;SELECT "fdb_medication"."brand_name", "patient_medication"."sig_desc", "patient_medication"."date_stopped", "patient"."practice_id", "patient"."person_id", "patient_medication"."reprndc_ind", "fdb_medication"."dose" FROM   ("patient" "patient" INNER JOIN "patient_medication" "patient_medication" ON ("patient"."person_id"="patient_medication"."person_id") AND ("patient"."practice_id"="patient_medication"."practice_id")) INNER JOIN "fdb_medication" "fdb_medication" ON "patient_medication"."ndc_id"="fdb_medication"."ndc_id"&lt;/P&gt;&lt;P&gt;SELECT "patient_allergy"."allergy_comment", "patient_allergy"."rxn_desc", "patient_allergy"."person_id", "allergy_mstr"."description", "patient_allergy"."allergy_type", "patient_allergy"."allergy_type_id", "allergy_type_mstr"."allergy_type_id", "allergy_mstr"."allergy_type_id", "patient_allergy"."practice_id" FROM   ("NGDemo"."dbo"."patient_allergy" "patient_allergy" INNER JOIN "NGDemo"."dbo"."allergy_mstr" "allergy_mstr" ON "patient_allergy"."allergy_id"="allergy_mstr"."allergy_id") INNER JOIN "NGDemo"."dbo"."allergy_type_mstr" "allergy_type_mstr" ON ("patient_allergy"."allergy_type_id"="allergy_type_mstr"."allergy_type_id") AND ("allergy_mstr"."allergy_type_id"="allergy_type_mstr"."allergy_type_id") WHERE  "patient_allergy"."practice_id"='0002' AND "allergy_mstr"."allergy_type_id"="allergy_type_mstr"."allergy_type_id" AND "patient_allergy"."allergy_type_id"="allergy_type_mstr"."allergy_type_id" AND "patient_allergy"."person_id"='86A835D1-F85C-4EEB-82CC-43866414F490' ORDER BY "patient_allergy"."person_id"&lt;/P&gt;&lt;P&gt;Could you re-evaluate my code in the original post? I have to be missing something here.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 09:07:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298950#M4609654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-26T09:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298951#M4609655</link>
      <description>&lt;P&gt;Hi Trent,&lt;/P&gt;&lt;P&gt;Cool, so we know it's connected so the one thing that would cause the no query is in the Report Options is the Suppress Printing if no Records.&lt;/P&gt;&lt;P&gt;Using a report With saved data could cause this to happen or what ever parameters you are using are not being passed and the subreports have no data.&lt;/P&gt;&lt;P&gt;Enable CRLogger, run the report in CRD and then again in your app and see what the difference is.&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;&lt;P&gt;PS - use Google and search for crlogger, it'll find a KBA on how to use it.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 14:14:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298951#M4609655</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2020-10-26T14:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298952#M4609656</link>
      <description>&lt;P&gt;Bad on is using the Legacy provider=SQLOLEDB&lt;/P&gt;&lt;P&gt;The working one is missing the beginning of the log so I can see what CR is trying to use.&lt;/P&gt;&lt;P&gt;Update your MS SQL Client and use the SQL Native 11 client in the report.&lt;/P&gt;&lt;P&gt;You can get it from the SQL 2012 installer or MSI from Microsoft's downloads.&lt;/P&gt;&lt;P&gt;Requires manually updating the Report using Set Location...&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 14:35:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298952#M4609656</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2020-10-28T14:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298953#M4609657</link>
      <description>&lt;P&gt;Thanks Don. For some reason, my old account has been rendered useless and I cannot log on. I've created a new one since I haven't gotten a response to my issue from SAP Community Support &amp;lt;sapnetwork@sap.com&amp;gt; in days.&lt;/P&gt;&lt;P&gt;Anyway, I did run the crlogger, and the results for the failed report are &lt;A href="https://drive.google.com/file/d/1Pq5TsgkjtBlATQ_bLoRL529_5HsAVgNQ/view?usp=sharing"&gt;here&lt;/A&gt;, and the successful one is &lt;A href="https://drive.google.com/file/d/1-SyY8ECnoi6oi0-zWU7kaTADI_5dSE8_/view?usp=sharing" target="_blank"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I've noticed that a line in the successful log says "QERowset.cpp	2814	bindToField succeeded: person.other_id_number &lt;STRONG&gt;is using&lt;/STRONG&gt; client buffer"&lt;/P&gt;&lt;P&gt;While the same line in the unsuccessful log says "QERowset.cpp	2814	bindToField succeeded: person.other_id_number &lt;STRONG&gt;is not using&lt;/STRONG&gt; client buffer".&lt;/P&gt;&lt;P&gt;Is this significant, or is there anything else you can glean from the logs? Any ideas in terms of what I can change to remedy this?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 20:13:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298953#M4609657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-28T20:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: ReportDocument.ReadRecords() does not query for subreport.</title>
      <link>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298954#M4609658</link>
      <description>&lt;P&gt;Excellent! Don, for the Win! I installed SQL Native Client 11 (64bit, windows 10) and used it as a DSN data source, works a treat! For those ever happening across this issue, use these connection properties to set on your tables:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;					string odbcname = "&amp;lt;DSN Name&amp;gt;";
					dbAttributes.Collection.Set("DSN", odbcname);
					dbAttributes.Collection.Set("PreQEDatabaseName", odbcname);
					dbAttributes.Collection.Set("PreQEServerName", odbcname);
					dbAttributes.Collection.Set("Trusted_Connection", false);
					dbAttributes.Collection.Set("UseDSNProperties", false);


					cinfo.DatabaseName = odbcname;
					cinfo.ServerName = odbcname;
					cinfo.UserID = "&amp;lt;username&amp;gt;";
					cinfo.Password = "&amp;lt;password&amp;gt;";
					cinfo.Attributes.Collection.Set("Database DLL", "crdb_odbc.dll");
					cinfo.Attributes.Collection.Set("QE_DatabaseName", odbcname);
					cinfo.Attributes.Collection.Set("QE_DatabaseType", "ODBC (RDO)");
					cinfo.Attributes.Collection.Set("QE_LogonProperties", dbAttributes);
					cinfo.Attributes.Collection.Set("QE_ServerDescription", odbcname);
					cinfo.Attributes.Collection.Set("QE_SQLDB", true);
					cinfo.Attributes.Collection.Set("SSO Enabled", false);
					cinfo.LogonProperties = dbAttributes.Collection;
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2020 20:13:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/reportdocument-readrecords-does-not-query-for-subreport/qaa-p/12298954#M4609658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-28T20:13:49Z</dc:date>
    </item>
  </channel>
</rss>

