Programmatically Suppressing Report Sections?

Can someone please tell me if there is a way to suppress sections of a report at runtime? I am giving the user the option to output to excel or pdf. If excel, I want to suppress the page headers and footers so I donu2019t end up with a bunch of blank rows for every page break. Can this be done or do I need to create two nearly identically reports to accomplish this? Thanks!
Version u2013 vs2003, C#

Hello, Dan;
You can do a conditional suppression on sections in the designer based on a parameter you pass in at runtime.
If {?SuppressSection} = "View" Then
   False
Else If {?SuppressSection} = "Suppress" then
   True
Then from your application pass in "View" or "Suppress" depending on if you are viewing or exporting the report.
'Pass the parameter Name and parameter Value
crReportDocument.SetParameterValue("SuppressSection", "View")
Elaine

Similar Messages

  • API/RAS - is it possible to remove suppress condition formula from report Section?

    I need to modify a report on the fly so that sometimes the 'Suppress (no drill down)' condition formula is completely removed from a report Section. Optionally I would like to just modify the formula to return FALSE so that the section appears.
    It seems like the code below works when the section format 'EnableSuppress' option is TRUE, but does not seem to do anything when there is a suppress formula for the section.
    Is this possible to do?
    Thanks
    Helen
    private void RemoveSuppress(CrystalDecisions.ReportAppServer.Controllers.ReportSectionController ctlSec
        , CrystalDecisions.ReportAppServer.ReportDefModel.Section sect)
        CrystalDecisions.ReportAppServer.ReportDefModel.ISCRSectionFormat
    secFmt = new CrystalDecisions.ReportAppServer.ReportDefModel.SectionFormat(); // also tried getting the current section format object
        secFmt.EnableSuppress = false;
        secFmt.ConditionFormulas.RemoveAll(); // *** Should ensure the condition formulas are removed correct?
        ctlSec.SetProperty(sect, CrystalDecisions.ReportAppServer.Controllers.CrReportSectionPropertyEnum.crReportSectionPropertyFormat, secFmt);
    private void doOutput(CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument oras)
        CrystalDecisions.ReportAppServer.Controllers.ReportSectionController
            sect = oras.ReportDefController.ReportDefinition.FindSectionByName("DetailSection1");
        RemoveSuppress(oras.ReportDefController.ReportSectionController, sect);
        CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray
            boByteArray = oras.PrintOutputController.Export(RASDefModel.CrReportExportFormatEnum.crReportExportFormatPDF, 1);
        boByteArray.Save(@"c:\temp\r.pdf", true);

    Hi Helen,
    Not sure why or how I missed this one but see this post for more info:
    http://scn.sap.com/thread/3712393
    Don

  • How to suppress a section that a blank subreport appears in?

    Post Author: MikeA-ICE
    CA Forum: General
    I have a series of subreports inside of a main report (each one in a different Group Header like GH2a, GH2b,etc. ) and there are certain times where there are no records in a particular group. The Subreport and the section it is housed in still appear though and I'd like  to suppress the section that  subreport appears in. I found the "Suppress if Subreport is Blank" option which works well but the main report section still displays and takes up space. How can I suppress a section in a report if the subreport it contains doesn't have any records and doesn't need to show?

    Post Author: MikeA-ICE
    CA Forum: General
    Never Mind! I had forgotten about the "Suppress Blank Section" option in the Section Expert. Works like a charm!

  • Setting fixed height in Crystal Reports sections

    Hi,
    I want to set the height of detail section in crystal report. I want to set the details section such that it must at the most accommodate 10 records in the section.
    If I have only 2 records in the section, it should show 8 empty lines.
    If I have more than 25 records in the section, the remaining 15 records will be placed on the next page.
    After that, the footer will be printed at the end of it.
    Is this possible?
    Thanks.

    Try this:
    1. You can also create a SQL expression field or use a subreport  to read how many records that it returns.
    2. Have 10 detail section; and
    3. In each section, put in all fields; and
    4. Have a running total in each section; and
    5. For each field in the section, you suppress based on the running total; and
    6. Do not suppress blank section; and
    7. Set new page if the running total is more than > 10

  • Suppressing a section based on two conditions

    Hello
    currently, I am trying to suppress a section of group based on two conditions:
    - The first condition is to suppress the section always if the user is not at DrillDownGroupLevel 1.
    - The second condition is to supress the section if the GroupName ({Customer.TerritoryID})  is not UK or US.
    I went to the section expert and entered this code in the "Suppress (No drill-down)" x-2 formula field:
    DrillDownGroupLevel <> 1 AND
    GroupName ({Customer.TerritoryID}) <> "US" OR
    GroupName ({Customer.TerritoryID}) <> "UK"
    Unfortunately, it does not work. Any ideas are very welcome!!
    I am using Crystal Reports XI
    Thanks in advance!!

    Which "section of a group" are you trying to conditionally suppress?  (group header, group footer or details within a particular group......or all of them?)
    AND you stated,
    "currently, I am trying to suppress a section of group based on two conditions:
    The first condition is to suppress the section always if the user is not at DrillDownGroupLevel 1.
    The second condition is to supress the section if the GroupName ({Customer.TerritoryID}) is not UK or US.
    Try this formula for the conditional suppression:
    (DrillDownGroupLevel  <> 1) AND
    (GroupName ({Customer.TerritoryID})  "US") OR
    (GroupName ({Customer.TerritoryID})  "UK")
    If that does not work you may want to check and make sure your values are upper case in the TerritoryID.
    In addition, a GOOD way to test conditional suppression formulas is to put them into a conditional highlighting color for the section so you can still see the values and the highlighting lets you know if it's working.  For example:
    IF
    (DrillDownGroupLevel  <> 1) AND
    (GroupName ({Customer.TerritoryID})  "US") OR
    (GroupName ({Customer.TerritoryID})  "UK")
    then YELLOW else WHITE

  • Report Sections & Breaks ---Differences

    Hi please let me know the differenece between report Sections & report Breaks, aprt from the basic & obvious differences.
    Thanks in advance!

    Hello firstly we need to know wether the empty spaces are coming within database fields or is it coming around the data.
    The around the data empty space means you have sections which aren't suppressed.
    If the empty spaces are coming in the data, that means you have a Null value in those places. To convert those Null values into a value of 0, you have to click
    File->Report Options--->Convert Other Null values to Default.
    Regards
    Jehanzeb

  • How do i suppress a section with a formula if a sql query result is 0

    hello everyone,
    i want to supress a section if a query result is 0. Is there a tutorial somewhere how to do that?
    thank you all,
    joshua

    Hi, 
    Crystal needs to know what the record count is.  In our reports, we have a message that comes up when the record count is 0. 
    In the Section Expert, select the section  you want suppressed.  Put a check beside Suppress (No Drill-Down).  In the Conditional formula your formula would look like: 
    Count ({table.FIELD1}) = 0;
    This will suppress that section if no records are returned. 
    Good luck,
    Brian

  • Can i disappear the line at report section.

    hi.
    i have one small Requirement.
    ie.
    under detail section in put one report section
    in report section i draw  two vertical lines left and right
    and also immediate report i draw one horizontal line.
    my requirement is ..
    Based upon the Detail section date the report section some times goes to the  second page some times it is at first page.
    when ever it is  goes to the second page the horizontal line should be Disappear...
    only left and right should be appear..
    is there any magic
    is it possible
    it yes
    plz suggest me some ideas.

    Hi Srini,
    You cannot conditionally suppress lines/boxes.
    Only workaround is to place that horizontal line in another section and suppress that section itself.
    -Abhilash

  • Report Sections - Heed help

    Post Author: philips
    CA Forum: General
    Hi,
    Anyone knows how to work with Report Sections programatically? I need to be able to add/delete certain objects in some sections of my report at run time. Also, how can I load different pictures/images at run time?
    Thanks

    There are a few ways to do this. Just write a function with a cursor and in the loop , create the output string.
    There is some info to do this in asktom which you can search to find the answer

  • BUG: iTunes Reporting Section Doubling Download Metrics

    I've found what seems to be a bug on the reporting section of the iTunes U metrics and am wondering if anyone else is experiencing this.
    I have attached a video to demonstrate what is happening, but essentially if I start counting metrics from Jan 2012, which is when Apple switched over to their new reporting system, the system doubles our number of downloads (among other things). If we start counting from Feb 2012 through the present, the metrics seem to be consistent with what Apple shows me on the front summary page.
    http://cdnapi.kaltura.com/index.php/kwidget/cache_st/1362518770/wid/_347381/uico nf_id/12311262/entry_id/1_5kppif39
    Any thoughts on this would be great.
    Best,
    Katie

    Katie;
    Sorry that I couldn't be of more help. Just for grins I tried the sequence again on a different Mac (MacBook Air, 10.8.2) with the same results...no change in the numbers. 
    Just as an experiment, have you tried resetting Safari?  It might be worth a try.  All the best...
    Syd Rodocker
    SRVideo Media Design
    Apple iTunes U Administrator
    Tennessee's Electronic Learning Center

  • Create a new view on Reports section

    I have tried to create a new view on the "Reports" section in SCSM 2012 SP1 and here is my final MP:
    <ManagementPack xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ContentReadable="true" SchemaVersion="1.1" OriginalSchemaVersion="1.1">
    <Manifest>
    <Identity>
    <ID>SG.Report.Library</ID>
    <Version>1.0.0.0</Version>
    </Identity>
    <Name>SG Report Library</Name>
    <References>
    <Reference Alias="System">
    <ID>System.Library</ID>
    <Version>7.5.2905.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
    <Reference Alias="SMReport">
    <ID>Microsoft.SystemCenter.Report.Library</ID>
    <Version>7.5.2905.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
    </References>
    </Manifest>
    <Presentation>
    <Folders>
    <Folder ID="Folder.SGReporting" Accessibility="Public" ParentFolder="SMReport!ServiceManager" />
    </Folders>
    </Presentation>
    <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
    <DisplayStrings>
    <DisplayString ElementID="SG.Report.Library">
    <Name>SG Report Library</Name>
    <Description />
    </DisplayString>
    <DisplayString ElementID="Folder.SGReporting">
    <Name>SG Reports</Name>
    <Description>Contains SG reports</Description>
    </DisplayString>
    </DisplayStrings>
    </LanguagePack>
    </LanguagePacks>
    <Resources>
    </Resources>
    </ManagementPack>
    I can see the MP is imported successfully, Then I query the DB for folder:
    select * from Folder
    where folderName like '%report%'
    which gives me some rows containing the folder with parentID = '77C85F13-0D2F-5989-F175-781DE54AD627'
    this GUID belongs to "ServiceManager" folder which is the parent folder of "reports" section.
    All goes well without error, yet the folder does not show up!
    I have tried sealing the Mp but still to no avail.
    What I have done wrong?
    YSobhdel

    you have to use the MM01 tocde and enter the mateial you want extend for new view. system will propose the view and select the new view.
    Or use MM50 for mass

  • At bottom of the page Report section Text is not adjusting.

    hi.
    i am having one problem.
    ie.
    i put one report section at under detail section of main report
    in report section again i put sub report in sub report at details section i put one field data is comming from the data base.
    this sub report field is having some data how much of data no body does not know.
    my problem is that.
    exactly this sub report is comming at first page  page footer..
    plz have a look on below image..
    it is comming good at new page..
    what i need is some data has to occupy at first page based upon page space
    remaining  will come into next page.
    Any solutions... plz update me..

    This is my file..
    http://www.megafileupload.com/en/file/550536/WtcLayout-update---Copy1-txt.html
    one more link
    http://www.megafileupload.com/en/file/550537/WtcLayout-update---Copy-rpt.html
    plz have a look on update me what is wrong in my report..

  • Why report section is appearing twice in the output of report designer

    Hi Gurus,
    I have created a report in the report designer and my report contains 5 sections.
    each report section is one query view.
    i inserted all the query views and done some formatting .
    but when i executed the report , one of the report section is appearing twice in the output.
    ex: i need the output like this
    section1
    section2
    section3
    section4
    section5
    But the output i am getting is as follows.
    section1
    section2
    section3
    section3
    section4
    section5
    report designer experts can please let me know why this problem is coming and also please provide possible solution for this.
    Thanks in advance.
    Raj.

    Hi Gurus,
    I have created a report in the report designer and my report contains 5 sections.
    each report section is one query view.
    i inserted all the query views and done some formatting .
    but when i executed the report , one of the report section is appearing twice in the output.
    ex: i need the output like this
    section1
    section2
    section3
    section4
    section5
    But the output i am getting is as follows.
    section1
    section2
    section3
    section3
    section4
    section5
    report designer experts can please let me know why this problem is coming and also please provide possible solution for this.
    Thanks in advance.
    Raj.

  • Report Designer : Data Provider & Report Section .

    Hi Experts ,
    Is it a mandatory compulsion to insert data provider to create a formatted report in Report designer . can we not create it through report section.
    thanks & regards ,
    M.S

    when you insert a data provider, it automatically creates a Report section. If you start with report section, then you still need to add data provider to it.

  • Suppressing sub-section with drill down OK

    This may be an easy one that I just cannot figure out (I hope...).
    I have created two details sections - details A and details B.  I would like to suppress details section B while still allowing for drill down capabilities.  However, that option is not available.  I can either suppress the entire details section (A and B) with drill down capabilities or suppress either A OR B with no drill down capabilities.
    Any and all help would be truly appreciated!!

    I can only think of using an on demand subreport which sits in Details b. but the row and the SR lable will be visible for all records.
    Ian

Maybe you are looking for

  • Very Slow Broadband and Poor Customer Service

    Hi, Since April we have been having issues with our broadband line dropping the connection and terribly slow speed (around 0.4Mbs). We have had 3 engineer visits changing the master socket, home hub, filter and even work done out in the road. Each on

  • Is Verizon going to offer the 32GB and/or 64GB models of the Galaxy S 4?

    I have been waiting for months for information about this phone.  It has come out incrementally in very small bites and, slowest and most grudgingly of all, from Verizon.  Now, finally, Verizon has offered pre-order of the 16GB model.  I don't want t

  • Business systems  for Soap to file scenario

    Hi Experts,    I am working on a soap to file scenario.Which type of business systems shall i  create i.e Third party,As ABAP,As Java etc.Please suggest. Thanks Veeru

  • Fixing itunes library - HELP - multiple copies, how to combine?

    I moved my entire itunes folder to an external hard drive.  This worked mostly ok, but when I tried to change the location of the library in itunes I only retrieved half of my music.  At some point prior to all of this I started opening my library as

  • Internal Error: Please contact System Admin (RCIRAS0216)

    Hello, I am facing Internal Error: Please contact System Admin (RCIRAS0216) when i open the crystal report in SAP Infoview. For some users the same report is working fine. Please can any one suggest me what would be the problem. In CMC and Infoview f