cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports - Working with field values across multiple pages

Former Member
0 Kudos

Hoping the CR Gurus will be able to assist, and please bear with me when I try and explain this as best I can.

I have a Field from my Stored Proc that if I run a Parameter as blank (rather then inputting a value) it will produce a multiple page report. The best example I can give is; there's a movie being played at multiple cinemas, my report will produce a page per cinema that's playing said movie - what I need to do is for every multiple cinema (there's only three Cinema's in total) that's playing the movie I need to make it as 'secondary'.

I cannot for the life of me figure out a if/then statement for this to work, I originally had;

If {@CinemaName} = 'Sesame Street' or {@CinemaName} = 'Cpt Birdseye' then 'Secondary Cinema'

else 'Primary Cinema'

But then that caused issues for when a movie was playing in only one of those two listed above obviously, resulting in 'Secondary Cinema' even though its only playing there.

Any ideas on how I could sort this, I've racked my brain with something to do with unique or counting the 'Movie' field and if its found more than once it will then run the above if/then, but I've had no luck actually implementing a solution across the multiple pages.

Thanks!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

To help better demonstrate I've attached the below picture in the hopes it illustrates visually :

Former Member
0 Kudos

Last stitched effort for some help

Former Member
0 Kudos

Hi John,

If possible can you please share your report with saved data

Former Member
0 Kudos

Unfortunately its not possible Vissu as there is some company related information within it. Is there anything else I can do to assist though, more than happy to try and give you all I can.

Every attempt I've made so far, from making 'do while' loops and so on, it can only pull the 'first' entry within the array out - from what I read this is due to not having a Sub-Report/Group as Crystal Reports is unable to distinguish Field Values from other pages until after its run.

Thanks again for the help Vissu!

Former Member
0 Kudos

Hi Try this.

If {@CinemaName} in ['Sesame Street','Cpt Birdseye'] then 'Secondary Cinema'

else 'Primary Cinema'



or



if count({@CinemaName}) >1 then 'Secondary Cinema' else 'Primary Cinema'

Former Member
0 Kudos

Thanks for the prompt reply Vissu, but unfortunately neither of those have worked. Maybe I should try an explain a little more:

I have three Cinemas;

  1. Sesame Street
  2. Cpt Birdseye
  3. Elm Street

When I run my report I ask for three parameters (Officer Name, Date and Movie), when I leave the 'Movie' blank (so I can get a 'full' report of all movies) it prints a multi-page report. We have a primary Cinema (Elm St) that if played in there, it will always be played at 'Sesame Street' and 'Cpt Birdseye' and then those need to get marked as Secondary Cinema. However, if played in either 'Sesame Street' or 'Cpt Birdseye' they will always be played solo (with no secondary cinemas) and I do not want them marked.

My original formula:

If {@CinemaName} = 'Sesame Street' or {@CinemaName} = 'Cpt Birdseye' then 'Secondary Cinema'

else 'Primary Cinema'


Worked when it was being played at Elm Street and produced the correct Secondary Cinema - but if any movie was played in the other Cinemas by themselves, it would print out 'Secondary Cinema'.


What would be perfect would be a way to say if count({@movie})>1 then 'Secondary Cinema' else 'Primary Cinema' - but it seems that the count is counting ALL movies as a total/sum and not the individual movie title and as a result marks everything as 'Secondary Cinema' cause the count is obviously over 1.

Regards,

John

Former Member
0 Kudos

Hi John,

What is the code inside @CinemaName formula

Former Member
0 Kudos

Nothing special - just a case that converts the CinemaID (a number) to its long name variant, aka; Elm Street, Sesame Street or Cpt Birdseye.

I know the below is incorrect, but I hope that it demonstrates the logic I am after:

If Count({MovieTitle})>1 and ({@CinemaName} = 'Sesame Street' or {@CinemaName} = 'Cpt Birdseye') then 'Secondary Cinema' else ''

Basically, if the same Movie Title is being played at 'Elm Street' then it will also be (100%) played at 'Sesame Street' and 'Cpt Birdseye', so the later two will be marked as 'Secondary Cinema', however the 'Elm Street' page will have no value in the field (because I know its Primary). However, if a Movie Title is only played at either 'Sesame Street' or 'Cpt Birdseye' then the field will also be blank because they are only played at either one solo.

Thanks for your continued help!