Active Query Builder support area

The GlobalIndent seems to have no effect

Avatar
  • updated
  • Completed

The GlobalIndent seems to have no effect

The IndentInPart does have an effect and indents the From parts a bit

Ideally in the future you want an indent for the subquery as a whole i.e everything between the brackets

SELECT F1,G2
FROM xyztable
Inner join .....
left join
-----(Select j1,y2
-----From
-----Where)
Where .... etc

Not urgent

Avatar
Andrey Zavyalov, PM

There are four properties of the ISQLBuilderSelectFormat to set new lines after any token of the FROM clause, try to play with them:

  • FromNewLineAfterDatasource
  • FromNewLineAfterJoin
  • FromNewLineBeforeComma
  • FromNewLineBeforeJoinExpression


Avatar
Andrew Kennard

Ah OK yes I can now see setting SQLFormatFrom to say 10 gives me almost what I want

It appears that the problem is whatever logic is used to split the Join lines (Inner Join etc) does not honour this indent for the sub query

So you end up with the select and columns indented by x spaces but when it gets to wrapping a Join line for the subquery it is wrapped to coliumn 1 and not under the I of Inner Join

Hope that makes sense

Avatar
Andrey Zavyalov, PM

Use the ActiveQueryBuilderX.SQLFormatFrom.IndentGlobal to format the query the way you need.

There are four sets of formatting options:

  • SQLFormatMain - for the main query formatting
  • SQLFormatFrom - for derived tables (sub-queries in the FROM clause used as datasources)
  • SQLFormatCTE - for Common Table Expressions
  • SQLFormatExpression - for sub-queries in expressions
Avatar
Andrew Kennard

Yes this IndentGlobal now works, thanks .... it was a bug ..... it now indents the whole query ..... but it wasn't really the problem I wanted solving .....

Which was that I wanted the SUB QUERY parts indented more that the parent part of the query i.e. like this
SELECT F1,G2
FROM xyztable
Inner join .....
left join
-----(Select j1,y2
-----From
-----Where
-----Inner Join ....
-----left join
----------(Select t1,u2
----------From
----------Where)
-----)
Where .... etc

Not urgent but it would make things more readable

Avatar
Andrey Zavyalov, PM

Hello,

The bug is fixed in the latest version 1.26.22. Please confirm that it's fixed on your side.
Avatar
Andrey Zavyalov, PM

Hi,

No, this problem hasn't been fixed yet.

Avatar
Andrew Kennard

Is this in the latest release notes related to this thread or something else ?

The error with quotation of sub-query text in the cells of Select List
Control is fixed.

Avatar
Andrey Zavyalov, PM

Hello,

I confirm this problem. We'll fix it as soon as possible.