Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Hide/Show Crystal report sections at Run time.

Posted on 2004-09-30
8
1,212 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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