<?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: Changes to ReportClientDocument.ReportOptions not getting saved in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795655#M4804243</link>
    <description>&lt;P&gt;Out of curiosity, do any of your reports have data saved with them and is there a difference in how reports with saved data behave vs. those without?&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 20:03:26 GMT</pubDate>
    <dc:creator>DellSC</dc:creator>
    <dc:date>2023-07-20T20:03:26Z</dc:date>
    <item>
      <title>Changes to ReportClientDocument.ReportOptions not getting saved</title>
      <link>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaq-p/12795654</link>
      <description>&lt;P&gt;Hi, I'm seeing the issue described in &lt;A href="https://answers.sap.com/questions/9760972/reportdocumentload-slow-due-to-saved-serverdatabas.html" target="test_blank"&gt;https://answers.sap.com/questions/9760972/reportdocumentload-slow-due-to-saved-serverdatabas.html&lt;/A&gt; where simply calling Load() on a report file will attempt to connect to the database, before my app has a chance to change the tables' connection info to point to the correct place. The given solution is to turn off the various Verify report options, which is what I'd like to do. I have hundreds of reports though, so I'd like to automate that, rather than opening every report in the Crystal report designer and unchecking the box. The obvious method of calling Load(), setting EnableVerifyOnEveryPrint to false, then calling SaveAs() doesn't seem to work though &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; But I found &lt;A href="https://blogs.sap.com/2012/09/07/working-with-crystal-reports-report-options-through-crystal-reports-inproc-ras-net-sdk/" target="test_blank"&gt;https://blogs.sap.com/2012/09/07/working-with-crystal-reports-report-options-through-crystal-reports-inproc-ras-net-sdk/&lt;/A&gt; , which implies that it *should* work. This is what I'm doing:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;        CrystalDecisions.CrystalReports.Engine.ReportDocument rd = new CrystalDecisions.CrystalReports.Engine.ReportDocument();&lt;BR /&gt;        CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rcd;&lt;BR /&gt;        rd.Load(@"C:\temp\MyReport.rpt");&lt;BR /&gt;        rcd = rd.ReportClientDocument;&lt;BR /&gt;        CrystalDecisions.ReportAppServer.ReportDefModel.ReportOptions OReportOptions = rcd.ReportOptions;&lt;BR /&gt;        OReportOptions.EnableVerifyOnEveryPrint = false;&lt;BR /&gt;        rcd.SaveAs("MyReport_Updated.rpt", @"C:\temp");&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But when I open MyReport_Updated.rpt, "Verify on First Refresh" is still checked.&lt;/P&gt;
  &lt;P&gt;Also, what's really strange is that I have two reports that both have "Verify on First Refresh" checked, but only one of them attempts to connect to the database on Load(). From what I read in the above forum post, I would have expected any report that has the Verify option to immediately connect to the DB, so why isn't it happening for one of the files?&lt;/P&gt;
  &lt;P&gt;And I think it would be nice to have an option for Load() to not attempt a DB connection; in my case, I know that the stored connection info is almost certainly wrong, and the first thing I do is to change it, but I have to Load the report before I can do that.&lt;/P&gt;
  &lt;P&gt;I'm running Crystal Reports for VS 13.0.33.4485.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 18:07:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaq-p/12795654</guid>
      <dc:creator>davehuang</dc:creator>
      <dc:date>2023-07-20T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changes to ReportClientDocument.ReportOptions not getting saved</title>
      <link>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795655#M4804243</link>
      <description>&lt;P&gt;Out of curiosity, do any of your reports have data saved with them and is there a difference in how reports with saved data behave vs. those without?&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 20:03:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795655#M4804243</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2023-07-20T20:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Changes to ReportClientDocument.ReportOptions not getting saved</title>
      <link>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795656#M4804244</link>
      <description>&lt;P&gt;No, they don't have data saved (File -&amp;gt; Save Data with Report is unchecked). I tried checking it, and it didn't seem to make any difference with either of the issues (attempting to turn off Verify on First Refresh through code didn't work, and calling Load() on the .rpt still causes 4 login failures to the MSSQL server).&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 20:00:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795656#M4804244</guid>
      <dc:creator>davehuang</dc:creator>
      <dc:date>2023-07-21T20:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Changes to ReportClientDocument.ReportOptions not getting saved</title>
      <link>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795657#M4804245</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;CR for VS runtime is a bit tricky sometimes, depending one what you want to do, sometimes you can just make the change as you did and it takes when saved but the majority of those changes are only while the report is in scope.&lt;/P&gt;&lt;P&gt;Here's how to: Note: I have a check box to show the state of each but this does work&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;private void btnSetChanges_Click(object sender, EventArgs e)
{
    CrystalDecisions.ReportAppServer.ReportDefModel.ReportOptions iro = rptClientDoc.ReportOptions;
    CrystalDecisions.ReportAppServer.ReportDefModel.ReportOptions myRPTOpts = iro.Clone();

    // SP 4 addition
    myRPTOpts.ConvertNullFieldToDefault = checkBox3.Checked;
    myRPTOpts.ConvertOtherNullsToDefault = checkBox17.Checked;

    myRPTOpts.CanSelectDistinctRecords = checkBox1.Checked;
    myRPTOpts.CanSetTableLocation = checkBox2.Checked;
    myRPTOpts.DisplayGroupContentView = checkBox4.Checked;
    myRPTOpts.EnableAsyncQuery = checkBox5.Checked;
    myRPTOpts.EnablePushDownGroupBy = checkBox6.Checked;
    myRPTOpts.EnableSaveDataWithReport = checkBox7.Checked;
    myRPTOpts.EnableSaveSummariesWithReport = checkBox8.Checked;
    myRPTOpts.EnableSelectDistinctRecords = checkBox9.Checked;
    myRPTOpts.EnableTranslateDOSMemos = checkBox10.Checked;
    myRPTOpts.EnableTranslateDOSStrings = checkBox11.Checked;
    myRPTOpts.EnableUseCaseInsensitiveSQLData = checkBox12.Checked;
    myRPTOpts.EnableUseDummyData = checkBox13.Checked;
    myRPTOpts.EnableUseIndexForSpeed = checkBox14.Checked;
    myRPTOpts.EnableVerifyOnEveryPrint = checkBox15.Checked;
    myRPTOpts.ErrorOnMaxNumOfRecords = checkBox16.Checked;

    // both routines below do not get saved - must be read only properties in the report or other methods to update them
    if (cbConvertDateTimeType.SelectedItem.ToString() == "crConvertDateTimeTypeKeepDateTimeType")
    {
        myRPTOpts.ConvertDateTimeType = CrConvertDateTimeTypeEnum.crConvertDateTimeTypeKeepDateTimeType;
    }
    if (cbConvertDateTimeType.SelectedItem.ToString() == "crConvertDateTimeTypeKeepDateTimeType")
    {
        myRPTOpts.ConvertDateTimeType = CrConvertDateTimeTypeEnum.crConvertDateTimeTypeToDate;
    }
    if (cbConvertDateTimeType.SelectedItem.ToString() == "crConvertDateTimeTypeKeepDateTimeType")
    {
        myRPTOpts.ConvertDateTimeType = CrConvertDateTimeTypeEnum.crConvertDateTimeTypeToString;
    }
    if (cbPreferredView.SelectedItem.ToString() == "crReportDocumentCubeView")
    {
        myRPTOpts.PreferredView = CrReportDocumentViewEnum.crReportDocumentCubeView;
    }
    if (cbPreferredView.SelectedItem.ToString() == "crReportDocumentExcelView")
    {
        myRPTOpts.PreferredView = CrReportDocumentViewEnum.crReportDocumentExcelView;
    }
    if (cbPreferredView.SelectedItem.ToString() == "crReportDocumentQueryView")
    {
        myRPTOpts.PreferredView = CrReportDocumentViewEnum.crReportDocumentQueryView;
    }
    if (cbPreferredView.SelectedItem.ToString() == "crReportDocumentReportView")
    {
        myRPTOpts.PreferredView = CrReportDocumentViewEnum.crReportDocumentReportView;
    }

    //crMaxNumOfRecords.Text = myRPTOpts.MaxNumOfRecords.ToString();
    //crNumOfBrowsingRecords.Text = myRPTOpts.NumOfBrowsingRecords.ToString();
    //crNumOfCachedBatches.Text = myRPTOpts.NumOfCachedBatches.ToString();

    //myRPTOpts.MaxNumOfRecords = Convert.ToInt16(crMaxNumOfRecords.Text);
    //myRPTOpts.NumOfBrowsingRecords = Convert.ToUInt16(crNumOfBrowsingRecords.Text);
    //myRPTOpts.NumOfCachedBatches = Convert.ToInt16(crNumOfCachedBatches.Text);

    myRPTOpts.EnableVerifyOnEveryPrint = false;
    rptClientDoc.ModifyReportOptions(myRPTOpts);

    //CrystalDecisions.ReportAppServer.ReportDefModel.ReportOptions myRPTOpts;
    //myRPTOpts = rptClientDoc.ReportOptions;
}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2023 21:15:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795657#M4804245</guid>
      <dc:creator>DonWilliams</dc:creator>
      <dc:date>2023-07-21T21:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Changes to ReportClientDocument.ReportOptions not getting saved</title>
      <link>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795658#M4804246</link>
      <description>&lt;P&gt;That worked; thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 18:27:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/changes-to-reportclientdocument-reportoptions-not-getting-saved/qaa-p/12795658#M4804246</guid>
      <dc:creator>davehuang</dc:creator>
      <dc:date>2023-07-22T18:27:36Z</dc:date>
    </item>
  </channel>
</rss>

