none
how to refresh multiply crystal reports automatically ? RRS feed

  • Question

  • I am new using crystal report. I was able to automatically load a single report. however, I am having problem loading multiple reports. Below is my code. When I  run this code it displays the two reports but after refreshing, it only runs the 13 pages in the first report. Can somebody help? please, Thanks in advance. 

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System<g class="gr_ gr_109 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="109" id="109">.Data</g>;

    using System<g class="gr_ gr_110 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="110" id="110">.Drawing</g>;

    using System<g class="gr_ gr_111 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="111" id="111">.Linq</g>;

    using System<g class="gr_ gr_112 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="112" id="112">.Text</g>;

    using System.Threading.Tasks;

    using System.Windows.Forms;

     

     

     

    namespace Demo6

    {

        public partial class <g class="gr_ gr_86 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="86" id="86">Form1</g><g class="gr_ gr_86 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" data-gr-id="86" id="86">:</g> Form

        {

            CrystalReport1 rpt = new CrystalReport1();

          

            public Form1()

            {

                InitializeComponent();

    #if DEBUG

                this.PageRefreshTimer.Interval = 1000;

    #endif

            }

     

            private void Form1_Load(object sender, EventArgs e)

            {

                rpt.SetDatabaseLogon("C*******", "****************");

                rpt.SetParameterValue(rpt.Parameter_END_DATE.ParameterFieldName, DateTime.Now);

                crystalReportViewer1.ReportSource = rpt;

             

     

     

            }

     

            private void PageRefreshTimer_Tick(object sender, EventArgs e)

            {

                int currentPage = crystalReportViewer1.GetCurrentPageNumber();

                crystalReportViewer1.ShowNextPage();

            

                if (currentPage == crystalReportViewer1.GetCurrentPageNumber())

                {

     

     

     

     

                  

     

                    CrystalReport2 rpts = new CrystalReport2();

                    rpt.SetDatabaseLogon("C*******", "****************");

                    crystalReportViewer1.ReportSource = rpt;

                    crystalReportViewer1.Refresh();

                    crystalReportViewer1.RefreshReport();

     

                    crystalReportViewer1.ReportSource = rpts;

     

     

     

                }

     

            }

     

            private void crystalReportViewer1_Navigate(object source, CrystalDecisions.Windows.Forms.NavigateEventArgs e)

            {

            

                PageRefreshTimer.Enabled = true;

             

            }

     

            private void crystalReportViewer1_Load(object sender, EventArgs e)

            {

               

            }

     

          

        }

    }

     


    • Edited by BJCB4 Monday, October 29, 2018 10:16 AM
    • Moved by CoolDadTx Monday, October 29, 2018 2:44 PM Third party product
    Monday, October 29, 2018 10:06 AM

All replies

  • These forums are for MS products. Please post questions related to third party products like Crystal Reports in their forums. The provided link actually points to ASP.NET but there are other CR forums as well.

    Michael Taylor http://www.michaeltaylorp3.net

    Monday, October 29, 2018 2:33 PM