Recent

Author Topic: [DONE] LazReport - Feature Bug??  (Read 2358 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
[DONE] LazReport - Feature Bug??
« on: May 12, 2019, 11:58:42 pm »
Got Laz Report to print normal text fine using a long string in Memo.Text
So, I am trying to add it to my Lyrics Editor that does have markup code in it.

<Title>
<Artist>
<Key: [?]>

So, if i remove all the markup, I do NOT get the error, and displays fine.

Title
Artist
Key: ?

However, If I try to print markup code, I get the error below....



« Last Edit: May 14, 2019, 11:38:06 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

lucamar

  • Hero Member
  • *****
  • Posts: 3429
Re: LazReport - Feature Bug??
« Reply #1 on: May 13, 2019, 12:42:15 am »
I don't know what's happening (I have zero experience with LazReport) but by the error it sounds like the problem isn't markup in general but the specific text "[?]".

Can it be that LazReport expects to have a field name specified in that way i.e. "[fieldname]"? If so, there must be a way to scape it somehow.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #2 on: May 13, 2019, 02:09:04 am »
I don't know what's happening (I have zero experience with LazReport) but by the error it sounds like the problem isn't markup in general but the specific text "[?]".

Can it be that LazReport expects to have a field name specified in that way i.e. "[fieldname]"? If so, there must be a way to scape it somehow.

Yeah, Markup text - specific  characters... same thing to me
Its called markup in my app because it is added tags to help make the text code view-able in 3rd party viewer apps, kind of the same as html "<>" are technically characters, but we call it markup... same for BBCode, markup.

Field name... No,  because if that were the case, then it would give me and error saying need to assign field name to data (or similar message).

This is pretty basic stuff.... if normal characters work, and I did a sample project with two pages of plain normal Memo1.text, and it all worked, except that text didn't have any specialized characters.

I am sure this was made like this on purpose, why i don't know.
If that is true, then LAZ Report is pretty much useless if you want to print source code. It can only be used on normal text and database fields.
« Last Edit: May 13, 2019, 02:12:18 am by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #3 on: May 13, 2019, 02:42:55 am »
Just by chance I happened to see a property under options
Where you can turn that error notifier off and allow the special characters.

Awesome... I was disappointed if that was a bug or built  that way... glad I found this... I would rather be wrong than stuck.

Thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #4 on: May 13, 2019, 03:05:18 am »
Well... I got excited to quick.

So, turn off the notifier does allow some characters, but not all.

Look at my screen....

It removed "[?]"

Upon further investigation... if I have a chord "[dm]" or any other chord in between the "[]"'s
It completely removes the '[]" and anything in between.

So, that isn't right, can't have this.

Why are special characters not allowed to be printed???
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

lucamar

  • Hero Member
  • *****
  • Posts: 3429
Re: LazReport - Feature Bug??
« Reply #5 on: May 13, 2019, 03:36:44 am »
According to the (FastReport) manual:
({Lazarus}/components/lazreport/doc/fr_eng.pdf)
the notation "[something]" is reserved to insert variables and datafields into the text. It's the very first object described.

There doesn't seem to be any way to escape it if you want it to be taken literally but I've only skimed the text. You should read it and see if I've missed someting. But take into account that the doc is about FastReport; LazReport isn't exactly the same.

An let's hope someone more with more knowledge than I comes and offers a soultion :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: LazReport - Feature Bug??
« Reply #6 on: May 13, 2019, 04:04:45 am »
...
There doesn't seem to be any way to escape it if you want it to be taken literally but I've only skimed the text.
...
I not know and make try suggest.

I have make fast look lr_parse and see quote single make text literal ? Then maybe have work <Key: '[?]'> ? (i not know what is mark question for laz report so maybe quote single have other place, example '['?']' )


paweld

  • Sr. Member
  • ****
  • Posts: 256
Re: LazReport - Feature Bug??
« Reply #7 on: May 13, 2019, 06:49:56 am »
Code: [Select]
<Title>
<Artist>
<Key: ['[?]']>
Best regards
paweld

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #8 on: May 13, 2019, 12:15:59 pm »
If I have to escape every character that is not allowed... then I will need a list of them all.
a "!" is not allowed either, so I need to know what all of them are.
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

lucamar

  • Hero Member
  • *****
  • Posts: 3429
Re: LazReport - Feature Bug??
« Reply #9 on: May 13, 2019, 03:48:21 pm »
If I have to escape every character that is not allowed... then I will need a list of them all.
a "!" is not allowed either, so I need to know what all of them are.

The problem is the square brackets [ and ]. The square-brackets are used to insert variables and datafields but apparently (from the answers above) you can use them also to add literals, so when you have in your text p.e. [Dd] you have to replace it with ['[Dd]'].

It's not so difficult: just replace every instance of "[" by "['[' and instances of "]" with "]']" before printing and back after printing.

That should do the trick :)
« Last Edit: May 13, 2019, 03:52:37 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #10 on: May 13, 2019, 04:16:50 pm »
If I have to escape every character that is not allowed... then I will need a list of them all.
a "!" is not allowed either, so I need to know what all of them are.

The problem is the square brackets [ and ]. The square-brackets are used to insert variables and datafields but apparently (from the answers above) you can use them also to add literals, so when you have in your text p.e. [Dd] you have to replace it with ['[Dd]'].

It's not so difficult: just replace every instance of "[" by "['[' and instances of "]" with "]']" before printing and back after printing.

That should do the trick :)

Yeah... I already got that from above.

I need a list of all the characters that LAZ Report excludes so I can code accordingly.

You never know what characters a user may insert into any string.

Thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #11 on: May 13, 2019, 09:55:06 pm »
I am still needing the list of all excluded characters from the LAZ Report
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

lucamar

  • Hero Member
  • *****
  • Posts: 3429
Re: LazReport - Feature Bug??
« Reply #12 on: May 14, 2019, 02:45:01 am »
I am still needing the list of all excluded characters from the LAZ Report

What do you mean by "excluded characters"? You mean that if you add, for example, "sacre bleu!!!" LazReport will silently delete the "!"? Or that adding this question it deletes the "?"?

I find that hard to believe but, as I said above, I have zero experience with it ...

In any case, it shouldn't be difficult to ascertain: prepare a text with all characters and send it to a report to see which characters are silently dropped. Only, take care to exclude the square brackets from it: you already know those are special.
« Last Edit: May 14, 2019, 02:47:59 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #13 on: May 14, 2019, 08:36:11 am »
I am still needing the list of all excluded characters from the LAZ Report

What do you mean by "excluded characters"? You mean that if you add, for example, "sacre bleu!!!" LazReport will silently delete the "!"? Or that adding this question it deletes the "?"?

I find that hard to believe but, as I said above, I have zero experience with it ...

In any case, it shouldn't be difficult to ascertain: prepare a text with all characters and send it to a report to see which characters are silently dropped. Only, take care to exclude the square brackets from it: you already know those are special.

All I need it a list of all the characters that LAZ Reports hides from the printed page, so I know which characters I am supposed to escape in code.

Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

lucamar

  • Hero Member
  • *****
  • Posts: 3429
Re: LazReport - Feature Bug??
« Reply #14 on: May 14, 2019, 10:54:50 am »
What do you mean by "excluded characters"? You mean that if you add, for example, "sacre bleu!!!" LazReport will silently delete the "!"? Or that adding this question it deletes the "?"?

All I need it a list of all the characters that LAZ Reports hides from the printed page, so I know which characters I am supposed to escape in code.

Yeah, I got that, but you don't answer my question: Do you mean LazReports eats-up some characters wherever they are and not just when they are between square brackets?
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018