Force Suppress in Crystal Reports - crystal-reports

How can I suppress a Details Section with a formula?
In my reports it may happen that a details section is empty. The only problem is, that CR wants to show the details section at least once because there are labels and some graphics in the Section...

If you right click on the Details section while in Design view you can choose Section Expert and then specify a formula which, if true, will suppress the Details section. (You don't say which Crystal Reports version you have, these instructions are for v10.)
You could use this formula for example:
count({detail_field},{group_field}) = 0

like paulmorris said...go to the section expert and bring up the suppress formula for the details section. Enter a boolean expression that is true when you want to suppress, such as...
isnull({someFieldThatIndicatesTheDetailsWillBeEmpty})

Related

Crystal Report - Printing information from sub-report

I am working on a Crystal Report and if the address which is in a subreport is duplicate I need the information to print on the same page if it’s different I need it to print on a separate page....Please Help!
Like AmmoPT said, we might need more information to help you.
But maybe you you can try this:
Right click on the section where the sub-report is: Section Expert - Paging .
Then on new page before, click the x-2 formula icon and use something like this:
if {your_adress_field}=previous({your_adress_field}) then false else true

How to rearrange report section at print time in ActiveReports?

I need to print the report footer before the group header/footer in ActiveReports 6. My code in report footer requires calculation from the group header/footer, so instead of moving all the controls to report header and do massive changes to code, I wonder if there's a quick way to just rearrange the page at print time.
I currently have:
rhMain (reportheader) for report cover page
gfVehicle (groupfooter) for detail on each vehicle, summary data is also calculated and stored here for each vehicle to be used in report summary
rfMain (reportfooter) for report summary
What I need to be arranged:
rhMain cover page
rfMain summary page
gfVehicle detail on each vehicle
What I have tried is move all the summary stuff to rhMain and during rfMain_format, I change the value of the controls in rhMain. This failed probably because rhMain is already rendered at this point.
Any other ideas?
There is no way to rearrange the sections during printing. The sections are designed to be rendered in a specific order and it cannot be changed. If you can provide some detailed information about your use case we may try suggesting some workaround. You can post your questions to ActiveReports support forums.
Can you please explain your scenario so we can try to help based on it. In general a report footer is nothing but a "group-footer" for the whole report (that is not bound, so would it help to replace the report-header/footer with an outside group header/footer.
Please include an image of what you're trying to do so we help further.
Issam Elbaytam
Grapecity.

How to conditioanlly hide group header in crystal report based on a column value in details section

I hope some one must have dealt this situation before.
I have a crystal report and on that report I have different sections including headers ,detail and footer. I'm displaying parts related information on details section and description is one of the fields thats being displayed.
So now based on part's description(in detail section)I have to display some text on the page header. So I have to look for part's description for every single part ,and if even a single part has the given description out of all the parts I have to print a message on report header.
My assumption is to use conditonal suppress option at the page header section, but not sure how to check for values from details section at the page header level.
Any help will be highly appreciated.
Thanks
NAF
Here's the way I would approach it.
Create a formula which returns 1 when your condition is met- otherwise 0. For example:
if {table.field} like '*acid*' then 1 else 0;
Then your conditional surpression can sum your new formula- and if the result is 0 it will hide the message.
sum({formula}) = 0
If you want to display it in Report Header then i would use a SQL Expression to conditionally suppres the text you want.
The SQL Expression
(select count(1) from dbo.TABLE where description = 'my_description')
Then in the Suppress formula:
{?SQL_EXPRESSSION} = 0

Insert page breaks between report groups with two-sided printing

In group expert options I have set Keep Group Together, which makes sure a new page is set.
With two-sided printing enabled, how can I make sure that a new group always forms on a new sheet of paper? Can this be done in the formula expert? Is there some way of checking if the page I'm on is even or odd and insert a page from there? Just asking leading questions because I'm not familiar with what is possible with Crystal's formula editor. BTW, This is Crystal XI Enterprise Server.
You can do this with the onfirstrecord, pagenumber and the onlastrecord keywords.
On the group header section "New page before" formula...
not onfirstrecord //so every group (except the first) starts on a new page
On "New page after" formula...
//to keep the group from starting on even page but make sure the last page is not blank
remainder(pagenumber, 2) = 1 and not onlastrecord
Open the Section Expert screen. Select Report Header and check "Suppress (No Drill-Down)". Then select in the group header select the group you want to page break and check "New Page Before".
This Works fine if I need Page Break on one Group. How do I do if Page Break on Multiple Groups?
I found answer..
Using Next(Field) or Previous(Field), I added below condition and worked fine.
In Next Page Before formula:
Not onFirstRecord and ({table.field} <> previous({table.field}))
hi IronicMuffin i understand you question. the answer is versy simple but more effetcive.
step 1: Include dataset or database expert into your crystal report
Step2: In the outside surface of the report area right click and goto report and goto group expert
Step3: add the which field you include the group that time the bottom of the window options will appear
Step 4: click the option and agian goto 2nd tab of the option.
step 5: finally check(check=true) check box of Repeat Group header on each page other check box or put uncheck

Crystal report - Header suppress

In Crystal report how we suppress page header on pagenumber >= 2 when records are completed on the previous page
Go to the Section Expert of the header. Suppress it with the checkbox and then, in the suppression formula, do this (with Basic syntax):
if pagenumber > 1 then formula = true
Maybe this will help? Just make a couple headers and a conditional that hides on the non-first page...
In the suppress formula box you can simply enter
Pagenumber<>1
This is true for all but the first page and thus will suppress on all but the first page.
Maybe you want to suppress the header on the second page if there is no record in the Detail section.
Please take a look at
Number of details records on the crystal report page