Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 months ago
Solved

Two Parameters are required in Paginated Report, pls help

Hi Team, I am new to paginated report develop using report builder. Here my data source is azure databricks, and my query is I need to create 2 parameters like track_id and barcode_id, If user ent...
  • DanieleUgoCopp's avatar
    6 months ago

    hello,

    I think the fix is to handle null or empty parameters in your WHERE clause, so one can work when the other is not filled.

    Try adjusting your query logic to something like “(track_id IN (@track_id) OR @track_id IS NULL) AND (barcode_id IN (@barcode_id) OR @barcode_id IS NULL)”, or similar depending on Databricks syntax, the idea is to not force both filters at the same time, also double check that both parameters are actually passed to the dataset, not just one mapped.

     

    Best regards,
    Daniele

  • v-abhinavmu's avatar
    6 months ago

    Hi Anonymous,
    Thanks for reaching out to the Microsoft Fabric Community forum.

     

    I tried to reproduce a similar scenario and noticed that this behavior can sometimes occur depending on how the parameters are handled in the query. Since the requirement is to filter using either track_id or barcode_id, you might try adjusting the query to allow one parameter to work even if the other is not provided.

    For example, you could try something like:

     

    (@track_id IS NULL OR track_id IN (@track_id))
    OR
    (@barcode_id IS NULL OR barcode_id IN (@barcode_id))

     

    And also check parameter settings, Right click --> parameter properties --> Allow Null/Blank values, do this for both id's.

     

     

    Run the report with different inputs,

     

     

     

     

    This approach might help in scenarios where users provide only one of the parameters. Please give it a try and let me know if it works in your case.

    Thank you!