Page 1 of 1

How to dynamically update Databand-Queries

Posted: Wed Apr 02, 2025 9:46 am
by JGO293
Hello,
what am i trying:
I have a databand A which runs through IDs and another databand B which has databand A as a main component and i want Databand Bs Query to be dynamically changed according to the ID in Databand A.

Example:
I have 3 Departments with 10 different people attached to them and the report should look like this:

Code: Select all

Department A
	Person of Department A 1
	...
	Person of Department A 10
Department B
	Person of Department B 1
	...
	Person of Department B 10
Department C
	Person of Department C 1
	...
	Person of Department C 10

I have successfully created a variable "DepartmentKey" that changes to the ID of the current department in the Before Print Event of the Person-Databand. And the query of person objects looks like this SELECT Name FROM Person WHERE Department = @DepartmentKey
But the person Databand does not update its data and prints the same list of person objects per department, it looks like the query is evaluated with the start parameter once and then printed per department

Is there a way to make this happen with different components or am i overlooking something?

Note: This case is a simplifaction of my original problem, so changing the report to a single databand with a single query and running a group component for the departments will not work due to the database structure i am working with

Re: How to dynamically update Databand-Queries

Posted: Wed Apr 02, 2025 10:13 pm
by Lech Kulikowski
Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.

Re: How to dynamically update Databand-Queries

Posted: Mon Apr 07, 2025 12:55 pm
by JGO293
Hello,
the report editor i use at my work is built into a bigger software, which does not let me export or save reports as files.
I have managed to recreate the report in the online editor but with a trial membership i cannot share the file.

Is there another way to get the report in a shareable format?
Otherwise i can send the configuration of my report with text and screenshots as the problem was quite simple to recreate

Re: How to dynamically update Databand-Queries

Posted: Tue Apr 08, 2025 10:56 am
by Lech Kulikowski
Hello,

Ok. Try to send screenshots for analysis.

Thank you.

Re: How to dynamically update Databand-Queries

Posted: Fri Apr 11, 2025 2:04 pm
by JGO293
Hello,

This is the report i have configured:
ReportOverview.png
ReportOverview.png (338.08 KiB) Viewed 12758 times
Databand1 has sampleDepartments as a Data Source, the rest is configured by default
Databand2 has samplePersons as a Data Source, Databand1 as a Master Component and the Filter is configured like this:
"Expression -> samplePersons.Department == DepartmentOfPerson"
(The middle Text component is cut off in the overview screenshot but says "Department of Person: {samplePersons.Department}"

The Before Print Event of Databand2 looks like this:
DB2_PrePrint_Event.png
DB2_PrePrint_Event.png (27.86 KiB) Viewed 12758 times
The variable i change here is defined as this:
Variable_DepartmentOfPersons.png
Variable_DepartmentOfPersons.png (57.31 KiB) Viewed 12758 times
The Data itself is also attached here as csv files


Let me know if this is sufficient information on my report or if you need any other information, then i can provide whatever is necessary

Thank you

Re: How to dynamically update Databand-Queries

Posted: Mon Apr 14, 2025 9:04 pm
by Lech Kulikowski
Hello,

On your screenshots CSV data sources (files), what query do you want to call for B databand?

For the SQL sources, there is the ReconnectOnEachRow option that allows running queries for each line of the databand.

Thank you.

Re: How to dynamically update Databand-Queries

Posted: Mon Apr 28, 2025 11:29 am
by JGO293
Hello,
thank you for the hint, I will try that as soon as possible

Re: How to dynamically update Databand-Queries

Posted: Mon Apr 28, 2025 11:51 am
by Lech Kulikowski
Hello,

You are welcome.