cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to use IF with referal to e.g. "details b"?

alexsr700
Participant
0 Kudos
193

Hi everyone,

I am trying to reduce the amount of code I use.

I have multiple detail sections in the report that are essentially clones of each other. The only difference is one line of code in the respective input formulas.

So depending on the user input field {?source} the `details a` or `details b` would be shown. The formula for `details a` uses input_value:={field1} and `details b` uses input_value:={field2}.

Sorry, if that seemed complicated. Happy to explain better if there are questions 🙂

Thank you again for your continued support!

Alex

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor
0 Kudos

Crystal formulas don't have a way to inquire what section they are placed in. So this can't be done.

alexsr700
Participant
0 Kudos

Okay, thank you for the bad news 😞

I will try to find a different solution.

Is is maybe possible to check if the current code is running inside the formula called "formula1" or inside "formula2".

Answers (3)

Answers (3)

ido_millet
Active Contributor
0 Kudos

In that case, perhaps you can use a formula instead of a field. The formula can take care of the logic branching.
But it's tough to judge without more context.

alexsr700
Participant
0 Kudos

Well, it really is as simple as changing the one input value. In some cases it is even the same input table field but once the original and once multiplied by x.

So having 10 sections instead of 5 does make a significant difference when it comes to maintenance.

I agree. Keeping it simple is important. That is why I am trying to minimize the code I use and make as much of it copy&pastable between formulas as possible.

However, the layout is an important factor also. The more sections (each with their own conditional formulas) the more maintenance work there is.

ido_millet
Active Contributor
0 Kudos

My advice would be to keep it simple.
You need different content in each section -- so place different content in each section.

Alternatively, get the desired content in the data set consumed by the report (using SP/VIEW/Command) so you don't need to use section suppress logic.