Solved

Hide/Show Crystal report sections at Run time.

Posted on 2004-09-30
8
1,185 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
Comment Utility
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
Comment Utility
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
Comment Utility
perect that is what I am saying. You can use my cod e then

myrpt.reportdefinitions.areas[GH1].supress = true;
0
 

Author Comment

by:sansaw80
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 10

Accepted Solution

by:
ebolek earned 250 total points
Comment Utility
try this

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

Author Comment

by:sansaw80
Comment Utility
Thanks mate, it Rocks.....
0
 
LVL 10

Expert Comment

by:ebolek
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now