Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Incude Groups where data is null Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Topic: Incude Groups where data is null
    Posted: 01 Oct 2014 at 6:33am
Hello all,

I am currently trying to create a report that shows two types of data ('Type A' and 'Type B') and then have some dynamic text that says "There were no records of Type A in the reporting period" or "There were no records of Type B in the reporting period" in the respective 'grouping' section.

The issue arises because there aren't always records in Type A or Type B. Is there a way to ensure that Crystal Reports creates a group for them both regardless of whether there is data available or not?

I do not currently have the ability to create views on the Database.

Any help appreciated in advance.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2014 at 7:45am

What is the source or data of the 'grouping'.

Does is exist before you apply a select statment?
Can you use a command as your data source?
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 01 Oct 2014 at 10:46am
As you only ever have two groups, you could create something in the report header or footer with a custom suppress?

In the custom suppress use
count(Type A field)>0
Have a text box in that section with what you would like it to say

Do the same for Type B

Make sense?
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 01 Oct 2014 at 9:44pm
Hi DBlank - it's a MySQL Database with about 7 tables so using a command won't be an easy thing to do.

Hi Z9962 - I did try having one manual section in the page header (type a) and one manual section in the page footer (type b) in case there are months that there is no data at all (which is possible) but they are spaced too far apart...
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 01 Oct 2014 at 9:54pm

if it is just spacing, this should be resolvable through using custom suppress in appropriate locations.

IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 01 Oct 2014 at 9:57pm
I did try and it didn't work but I will try again :-).

I've also had another thought of adding in additional detail sections with the custom manual information and adding conditional suppression's - fingers crossed!
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 01 Oct 2014 at 10:10pm
Is there a function that determines the grouping level (GroupingLevel does something different to what I was hoping), by which I mean;

If my report is looking for two 'types' of data which are grouped as 'Type A' and 'Type B' is there a function which would do the following....

Type A
Data inserted here
Grouping Level: 1

Type B
Data inserted here
Grouping level: 2
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 01 Oct 2014 at 10:14pm
Sorry guys I think I may have just found it ('GroupNumber') I think....
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 01 Oct 2014 at 10:59pm
Ok I got the below formula working BUT only when there is two groups (which obviously there isn't if the data doesn't exist) which puts me right back to square one..... Any suggestions??

GroupNumber<>2 OR
({#P2RT}>0 And GroupNumber=2)

IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 01 Oct 2014 at 11:35pm
Update.....

I've got it working using the original suggestion (Report Headers and Report Footers) - I putting them in the Page Header and Page Footer which is why it wasn't working as I expected :-)

The challenge now comes for my next report which has more than two 'types' ......
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.