1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Issue Passing NULL StartDate from Main Report to Subreport in SSRS Body:

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 17, 2024 às 13:02.

  1. Stack

    Stack Membro Participativo

    I'm working on an SSRS report in Visual Studio that passes parameters between a main report and multiple subreports. The goal is to have parameter values Option1 and Option2 that input StartDate param and enter it based on calculations (those options work fine, they're implemented in the stored proc that runs on the subreports) but also to have to option for Manual Entry of StartDate via the calendar (Date/Time value)

    I’m running into an issue where passing a NULL value for StartDate from the main report to the subreports causes the reports to fail with error "One or more parameters required to run the report have not been specified" , despite both the main and subreports having StartDate set as nullable. When subreports get hardcoded data, they run just fine. Meaning that I somewhat localized the issue and it's coming from the point the main report gathers the params' values.

    My goal is to be able to pass null value in StartDate param from the main report to the subreport. Everything else (like subreport working with the null value in the stored proc) is as good as it gets.

    Here’s what I’ve tried so far:

    Allowed NULL values in the StartDate parameter: Both in the main and subreports, I marked the StartDate parameter as nullable, but the issue persists.

    Added conditional expressions: I included expressions for the StartDate param in the main report to check if StartDate is NULL, and if so, pass EndDate or a hardcoded value instead. This didn’t resolve the issue.

    Introduced a hidden parameter (EffectiveStartDate): I created a hidden EffectiveStartDate parameter to pass a value when StartDate is NULL. I used this parameter in place of StartDate in the subreports. The subreports still work fine when run standalone, but the issue persists when running them from the main report.

    Feel like I have exhausted all available choices and would be thankful for your advice.

    Cheers

    Continue reading...

Compartilhe esta Página