The GlobalIndent seems to have no effect

Completed

Comments

18 comments

  • Hello,

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

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    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.

    0
    Comment actions Permalink
  • Hi,

    No, this problem hasn't been fixed yet.

    0
    Comment actions Permalink
  • Hello,

    The bug is fixed in the latest version 1.26.22. Please confirm that it's fixed on your side.
    0
    Comment actions Permalink
  • Avatar
    Minieggs

    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

    0
    Comment actions Permalink
  • 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
    0
    Comment actions Permalink
  • Avatar
    Minieggs

    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

    0
    Comment actions Permalink
  • 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


    0
    Comment actions Permalink
  • Avatar
    Minieggs

    Thanks I have had a play with some of those and others and they do make the SQL iutput different but none of them appears to stop this type of wrapping in a subquery


    --Left Join (Select qvwCampaignLinks.Contact_Ref As Contact_Ref,
    qvwCampaignLinks.ID As Journal_Number
    ------------From qvwCampaignLinks
    ------------Where qvwCampaignLinks.[Key] In ('DON0002')
    ------------Union All
    ------------Select qvwCampaignLinks.Contact_Ref As Contact_Ref,
    qvwRegularGivingPayments.Journal_Number As Journal_Number
    ------------From qvwCampaignLinks
    --------------Inner Join qvwRegularGivingPayments On qvwCampaignLinks.ID =
    qvwRegularGivingPayments.Agreement_Number

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    Just replaced above spaces with dashes so you can see layout as this forum removed the spaces

    0
    Comment actions Permalink
  • FromNewLineAfterDatasource = false
    FromNewLineAfterJoin = true
    FromNewLineBeforeComma = false
    FromNewLineBeforeJoinExpression = false
    MainPartsFromNewLine = true
    NewLineAfterPartKeywords = false
    SelectNewLineAfterItem = false
    SelectNewLineBeforeComma = false
    IndentInParts = 2
    IndentGlobal = 0
    SQLFormatFrom.IndentGlobal = 8

    Isn't it a configuration that suits your needs?

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    Thanks for continuing to look at this.

    I have tried your settings and although it changed the output the fundamental problem of things wrapping back to column 1 as explained above still remains

    Whilst I would like this to work it is not as important to me when compared with the other two threads I replied to

    Thanks again

    0
    Comment actions Permalink
  • Well, if you want to solve this problem, please send us a text file with full text of SQL query generated by Active Query Builder and a query text with desired formatting.

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    Thanks very much

    What email address should I send it to ?

    0
    Comment actions Permalink
  • You can send it here. Hopefully you can attach it to your comment, can't you?

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    I can see insert video, picture and link but nothing for file ?

    If I paste it in here it looses the formatting

    I've taken some screen grabs and attached as pictures, I hope you can see them

    The indenting doesn't have to be EXACTLY like the second picture BUT I don't want to see anything in column 1 other than Select, From and Where of the main outer query

    Thanks

    Current output


    Desired output

    0
    Comment actions Permalink
  • ActiveQueryBuilderX.SQLFormatRightMargin - set it to zero. Menwhile I will check if wrapping could work in another way.

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    Thanks for this

    As far as I am concerned this is fixed for now

    Any improvements in the wrapping logic would be welcome but not vital

    Please can you now comment on my other two threads

    Thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.