Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Hide report section programatically using csharp Post Reply Post New Topic
Author Message
mmmundhra
Newbie
Newbie


Joined: 05 Sep 2010
Online Status: Offline
Posts: 2
Quote mmmundhra Replybullet Topic: Hide report section programatically using csharp
     Posted: 06 Sep 2010 at 12:03am
Solution :

FUNCTION CALLING :
//Rep is report object containing .Rpt file...
ShowHideAllReportObjectsInSection(Rep, 8, true);

FUNCTIONS :
        public void ShowHideAllReportObjectsInSection(CrystalDecisions.CrystalReports.Engine.ReportDocument Rep, int nSectionNo, bool bSuppress)
        {
            using (CrystalDecisions.CrystalReports.Engine.Section SEC = (CrystalDecisions.CrystalReports.Engine.Section)Rep.ReportDefinition.Sections[nSectionNo])
            {
               SEC.SectionFormat.EnableSuppressIfBlank = true;
               int I;
               for (I = 1; (I <= SEC.ReportObjects.Count); I++)
               {
                    SEC.ReportObjects[I - 1].ObjectFormat.EnableSuppress = bSuppress;
               }
            }
        }
man mohan mundhra (kolkata)
IP IP Logged
mmmundhra
Newbie
Newbie


Joined: 05 Sep 2010
Online Status: Offline
Posts: 2
Quote mmmundhra Replybullet Posted: 06 Sep 2010 at 12:04am
you need to add following reference in your project or code module :

using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
man mohan mundhra (kolkata)
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum