Solved

Hide/Show Crystal report sections at Run time.

Posted on 2004-09-30
8
1,219 Views
Last Modified: 2008-02-01
I have made a report which get populated from Store Proc
I have made a form which contains crystalreportviewer (child) and another form(Parent) where User can select various options for data selection. In one option I am allowing User to select Group by  three option(City,Country,Region)

I m handling all these details properly in Store Proc but my Question is how can I hide and show Grouping sections in Crystal Report at runtime. I don't want to write formula in CR to do this. I want to know is there way in VB.net  to do this task.

I am using Visual Studio.net(2003) Professional with build in CR.

I had look at following link but not much help: http://support.businessobjects.com/library/kbase/articles/c2015835.asp

Many thanks in advance.
0
Comment
Question by:sansaw80
  • 4
  • 3
8 Comments
 
LVL 10

Expert Comment

by:ebolek
ID: 12192270
yes there is.

This is how you hide group header1 .
Reportdocument myreport as new reportdocument();
myreport.load(path);
myreport.reportdefinitions.areas[GH1].supress = true;

Regards
Emre
0
 

Author Comment

by:sansaw80
ID: 12192510
Hi Emre,

thanks for replying but using a ReportDocument is the only way?? Reason is I am populating my reports using following code:

       Dim myRpt As New RptTest

       For i = 0 To UBound(ParaValues) 'Public Array
            'setting parameter
            myRpt.SetParameterValue(i , ParaValues(i))
        Next

        myRpt.SetDatabaseLogon("sa", "")

        CrystalReportViewer1.ReportSource = myRpt
        CrystalReportViewer1.Refresh()

0
 
LVL 10

Expert Comment

by:ebolek
ID: 12192631
perect that is what I am saying. You can use my cod e then

myrpt.reportdefinitions.areas[GH1].supress = true;
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:sansaw80
ID: 12192810
Sorry for being pain but I m new to .net

I tried  your code but it doesn't work, reason I think as I said I m not using ReportDocument in my form I m only using ReportViewer and passing Rpt name and Parameters in Public array and showing report using that array.

And whn I try to use your line of code while executing system prompts me that Public member 'reportdefinitions'  not found for 'RptTest'
0
 
LVL 10

Accepted Solution

by:
ebolek earned 250 total points
ID: 12192834
try this

myrpt.ReportDefinition.Sections["GH1"].SectionFormat.EnableSuppress = true;  
0
 

Author Comment

by:sansaw80
ID: 12192930
Thanks mate, it Rocks.....
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12192942
Sorry for the wrong one. I wrote the code from my head. Then when you say it was mot working i had to open vb. net:)

Glad it works

Regards
Emre
0
 

Expert Comment

by:Francisco_M
ID: 14094992
Hi ebolek,
I have almost the same problem... am using the Crytal Report object 4.6 with vb6. I just want to know how to hide the detail-section at run-time...

e.g:  
         with crystalReport1
              .reportFilename="\\myserver\myReport.rpt"
              .Sqlquery="select chicken from myFarm"
              ...?(how do I hide the detail section here?)
              .PrintReport
         end with

If u can help I will really appreciate...
thanks
Francisco_M


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question