Solved

Hide/Show Crystal report sections at Run time.

Posted on 2004-09-30
8
1,192 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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. …
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

929 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

13 Experts available now in Live!

Get 1:1 Help Now