logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Ott  
#1 Posted : Tuesday, July 11, 2017 2:04:14 PM(UTC)
Ott

Rank: Newbie

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 4
Canada
Location: Ottawa

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
epf  
#2 Posted : Tuesday, July 11, 2017 2:31:51 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 391
Switzerland

Thanks: 6 times
Was thanked: 53 time(s) in 52 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.
Ott  
#3 Posted : Tuesday, July 11, 2017 2:39:16 PM(UTC)
Ott

Rank: Newbie

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 4
Canada
Location: Ottawa

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?

epf  
#4 Posted : Tuesday, July 11, 2017 3:13:40 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 391
Switzerland

Thanks: 6 times
Was thanked: 53 time(s) in 52 post(s)
No, but it could be a feature request:
Having a script applied at the report creation...so all default could be set.

Ott  
#5 Posted : Tuesday, July 11, 2017 3:37:55 PM(UTC)
Ott

Rank: Newbie

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 4
Canada
Location: Ottawa

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.
epf  
#6 Posted : Tuesday, July 11, 2017 3:55:28 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 391
Switzerland

Thanks: 6 times
Was thanked: 53 time(s) in 52 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.
Users browsing this topic
Guest (3)
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.

Powered by YAF 2.0.0 | YAF © 2003-2017, Yet Another Forum.NET
This page was generated in 0.078 seconds.