Recent

Author Topic: How to use square brackets as string in lazreport column title  (Read 4603 times)

krzynio

  • Jr. Member
  • **
  • Posts: 99
    • Krzynio's home page
Square brackets are used for defining variables.
How to use them as string in column header?
I.e. Route length [km]
Ubuntu 23.10 x64, / Windows 11 PL - latest updates
Lazarus 2.2.6, FPC 3.2.2

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: How to use square brackets as string in lazreport column title
« Reply #1 on: May 25, 2017, 09:41:49 am »
Escape them. something like '''[''','''']'''
Specialize a type, not a var.

krzynio

  • Jr. Member
  • **
  • Posts: 99
    • Krzynio's home page
Re: How to use square brackets as string in lazreport column title
« Reply #2 on: May 25, 2017, 09:49:52 am »
I tried '''['''km. The result is ''''km. Bracket was eaten.
I also tried /[ \[ "[ but without success
Ubuntu 23.10 x64, / Windows 11 PL - latest updates
Lazarus 2.2.6, FPC 3.2.2

paweld

  • Hero Member
  • *****
  • Posts: 970
Re: How to use square brackets as string in lazreport column title
« Reply #3 on: May 25, 2017, 12:58:55 pm »
Code: [Select]
['[']
[']']
Best regards / Pozdrawiam
paweld

krzynio

  • Jr. Member
  • **
  • Posts: 99
    • Krzynio's home page
Re: How to use square brackets as string in lazreport column title
« Reply #4 on: May 25, 2017, 02:25:16 pm »
Thank you! Works like a charm.
How did you guess it?
Ubuntu 23.10 x64, / Windows 11 PL - latest updates
Lazarus 2.2.6, FPC 3.2.2

 

TinyPortal © 2005-2018