Solved

Hide/Show Crystal report sections at Run time.

Posted on 2004-09-30
8
1,207 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

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…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

831 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