Rank: Member
Groups: Registered
Joined: 6/9/2017(UTC) Posts: 29 Thanks: 1 times
|
Hi,
Is there a way to always get a regular 'select' statement when creating a report instead of getting a 'select distinct'? I know that the select statement can be edited to remove the 'distinct' clause, but since my users would very seldom use this clause, I would prefer to default the select statement to be a regular select.
Thanks
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
You could use the 'Init Script' defined in the Server Manager, Menu Configuration->Configure Server... In this script you could change the SqlSelect property of your models (SqlSelect). Code:
foreach (var item in report.Models) {
item.SqlSelect = "SELECT";
}
The script is applied just before the report execution. Note that if there is an aggregate (Elements in DATA), the distinct is done by the database engine anyway.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 6/9/2017(UTC) Posts: 29 Thanks: 1 times
|
I don't necessarily want to force all reports to use a regular select, I just want the default to be a regular select when a report is created. Is there a way to accomplish this?
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
No, but it could be a feature request: Having a script applied at the report creation...so all default could be set.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 6/9/2017(UTC) Posts: 29 Thanks: 1 times
|
Actually, when an aggregate is used, the 'distinct' clause is not added by the database (not by Oracle anyway) and if it was, it wouldn't do anything anyway. A 'group by' is required, which is added by Seal Report.
Is there a reason why the distinct clause is always added? I can't think of any reason why it would always be specified.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Well, for normal list without aggregate, the end-user would not expect to have duplicate lines... but this default behavior is subjective I agree. It cannot be changed anyway for backward compatibility.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.