Page 1 of 2
Dynamic Query - Columns automatically resize based on Result
Posted: Fri May 20, 2016 9:30 am
by ollie283
Hi Peeps,
This may of been asked before and I apologize if it has. Basically I would like to know whether it was possible (and if so, how) for the columns on my report to automatically resize at run-time based on the results pulled back from my dynamic SQL query. As it stands, when I view the data of my SQL Query it will add/remove columns depending on the data results brought back. I would like to replicate this in my report. I know you can set conditions, however it is not suited for my purpose.
Any help would be appreciated
Cheers,
Ollie
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Fri May 20, 2016 10:31 am
by Alex K.
Hello,
Can you please describe your task in more details. Also, can you please provide a more information about your dynamic SQL query.
Also, please check the sample project in the attachment, which show how to create report with the necessary data, columns from code.
Thank you.
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Fri May 20, 2016 12:32 pm
by ollie283
I am trying to make it so that the report adjusts to the results of the query. So for e.g. If my query brings back columns A,B,C,D then the report adjusts for that and fills out those columns. Like wise if the query brought back just A,B,C it would respectively fit. Please see my screenshot. The dynamic query basically looks to see if the "User Field" columns are being used or not within the DB. So if you look at the screenshot "Query Results" the highlighted columns are User Translation 1 and 2. However sometimes it may be more and i need the report to basically mirror exactly the results of the query, so adjusting the size according to the results.
Hope this makes some sense.
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Fri May 20, 2016 1:06 pm
by Alex K.
Hello,
As a way, please try to use the additional data source for these values and relation between tables. And use the master-detail construction with Cross-Data component.
Thank you.
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Fri May 20, 2016 1:33 pm
by ollie283
Hi,
You will have to excuse my lack of knowledge, but I am quite new to building reports in this software. So could you try the best you can to explain it in layman's terms.
Cheers
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Fri May 20, 2016 1:39 pm
by Alex K.
Hello,
Can you please send us a test data, we will try to prepare a sample for you.
Thank you.
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Fri May 20, 2016 2:14 pm
by ollie283
Please find attached a zipped document that contains a script which populates your DB with test data. And my dynamic query.
Thanks
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Mon May 23, 2016 9:54 am
by Alex K.
Hello,
Please check the sample report in the attachment.
Thank you.
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Thu Jun 02, 2016 9:03 am
by ollie283
Hi Aleksey,
Sorry for the late reply, been tied up at work lately. However I am now back to working on this report. Thanks for providing the sample report. I think I have get the jist of it. However I can not see why it is not adding the additional columns. As per the attached screenshot, it expanded up to the country field but no further. Do you know why this is?
Cheers,
Ollie
Re: Dynamic Query - Columns automatically resize based on Re
Posted: Thu Jun 02, 2016 9:58 am
by Alex K.
Hello,
Can you please send us a sample with test data which reproduces the issue for analysis.
The sample from previous posts does not contains a DateOfBirth column.
Thank you.