Skip to Content
author's profile photo Former Member
Former Member

Issue with parameter passing in Crystal Report

Hi,

I have an issue with parameter passing. Probably someone of you had the same requirement in the past...

1. In main report there is a formula defined to find out the value of a parameter which needs to be passed to one subreport:

The subreport contains this script to assign the parameter from the main report to the appropriate field:

this doesn't work for following cases (first snapshot):

- else " " doesn't work

- when I write all the other cases instead of the else statement, e.g. "ALL;SHE", it doesn't work either because more than one value is recognized as one string

2. I have tried to implement it in another way:

Instead of the script in subreport (2nd snapshot) I have used the parameter linking:

This works for all other cases but not for the differentiation of netherland and belguim in first snapshot.

I hope that the requirement is clear. If you have any idea how I can pass a parameter that needs to be differentiated according the filter selection I will be very grateful.

BR,

Suita

formula.JPG (25.5 kB)
formula2.JPG (18.3 kB)
formula3.JPG (57.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 27, 2016 at 02:13 PM

    I might re-write the If statement like this:

    If GetUniqueName({?BI__BI_DISGRP_BI_BUSLIN_S_001}) = 'RMC' then

    if GetUniqueName{{?BI_COUNTR_P00}) = 'NL' then 'DBO'

    else if GetUniqueName{{?BI_COUNTR_P00}) = 'BE' then 'BRU'

    else ' '

    else ' '

    Make sure that you have "Default Values for Nulls" turned on in the Formula editor!

    For testing purposes, I would then display this value on both the main report and the subreport to verify that it's getting passed correctly.

    For the filter in the subreport, it looks like you're looking for a '0' in some cases, but this formula will never return '0'. So, you can either change the blank from the main report formula to a '0' or change the filter in the subreport to look for a space.

    Also, try to avoid using If statements in the Select Expert - frequently Crystal cannot push them to the database for processing so it will pull all of the data into memory and filter it there which slows down the report processing. I would rewrite the filter as something like this (assuming you change the formula above to return '0' in the else clauses):

    (

    {?MainReport.CallCenterCity} = '0' or

    {HCL01_OSCHCM01_Q002_DASHB.CallCenter City\CallCenter City-Key} = {?MainReport.CallCenterCity}

    )

    -Dell

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Dell Stinnett-Christy

      Hello Dell,

      the requirement regarding this implementation has been changed and I will change the report accordingly.

      The hint with not using IF-Statements was good. Do you have any other hints or do you know any good documentations with pros, cons, constraints, etc.?

      Thanks again.

      BR,

      Suita

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.