Recent

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

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #15 on: May 14, 2019, 12:41:14 pm »
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?

Sorry,
Correct...as I mentioned above it also ate the "!" character which is not between "[]"'s
« Last Edit: May 14, 2019, 01:27:34 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: 3188
Re: LazReport - Feature Bug??
« Reply #16 on: May 14, 2019, 01:18:08 pm »
Correct...as I mentioned above it slao ate the "!" character which is not on between "[]"'s

OK, let me investigate a little ... though it will be mostly googling around: I don't have LazReport installed (never use it).
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 #17 on: May 14, 2019, 04:46:13 pm »
OK, let me investigate a little ... though it will be mostly googling around: I don't have LazReport installed (never use it).
Is not need install. maybe read 15 second ?  :-X

Code: Pascal  [Select][+][-]
  1. function GetBrackedVariable(s: String; var i: integer; out j: Integer): String;
  2. var
  3.   c: Integer;
  4.   fl1, fl2: Boolean;
  5. begin
  6.   j := i; fl1 := True; fl2 := True; c := 0;
  7.   Result := '';
  8.   if s = '' then Exit;
  9.   Dec(j);
  10.   repeat
  11.     Inc(j);
  12.     if fl1 and fl2 then
  13.       if s[j] = '[' then
  14.       begin
  15.         if c = 0 then i := j;
  16.         Inc(c);
  17.       end
  18.       else if s[j] = ']' then Dec(c);
  19.     if fl1 then
  20.       if s[j] = '"' then fl2 := not fl2;
  21.     if fl2 then
  22.       if s[j] = '''' then fl1 := not fl1;
  23.   until (c = 0) or (j >= Length(s));
  24.   Result := Copy(s, i + 1, j - i - 1);
  25. end;
  26.  

lucamar

  • Hero Member
  • *****
  • Posts: 3188
Re: LazReport - Feature Bug??
« Reply #18 on: May 14, 2019, 08:52:44 pm »
OK, let me investigate a little ... though it will be mostly googling around: I don't have LazReport installed (never use it).
Is not need install. maybe read 15 second ?  :-X

That's where the parts enclosed in square brackets are treated. We already knew that. Maybe read 20 seconds? ;)

Now serious: It seems the problem is that other characters beyond the square brackets are also treated as "special". Pixelink needs to know what those are to, if needed, scape them (probably by replacing them with ["somechar"].

If you have LazReport installed or the sources at hand, maybe you could look into that?
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.

jesusr

  • Sr. Member
  • ****
  • Posts: 470
Re: LazReport - Feature Bug??
« Reply #19 on: May 14, 2019, 09:18:40 pm »
Now serious: It seems the problem is that other characters beyond the square brackets are also treated as "special". Pixelink needs to know what those are to, if needed, scape them (probably by replacing them with ["somechar"].

If you have LazReport installed or the sources at hand, maybe you could look into that?

What is between "[" and "]" must be a valid expression (see "Using strings and variables" in the pdf doc file), if it works with 'strings' that do not represent fields and is not documented, we have to check if it is an undocumented feature or a bug.

If the removal of the ! or "other special" character is confirmed, then it's a bug and a bug report is in order, but here I couldn't confirm this, also the posted image shows that the !s aren't removed.

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: LazReport - Feature Bug??
« Reply #20 on: May 14, 2019, 09:28:28 pm »
That's where the parts enclosed in square brackets are treated. We already knew that. Maybe read 20 seconds? ;)
:D

Quote
Now serious: It seems the problem is that other characters beyond the square brackets are also treated as "special". Pixelink needs to know what those are to, if needed, scape them (probably by replacing them with ["somechar"].
Me serious.

Answer already write more before  :)

If want have literal then make literal.

No need have know characters special. Lazreport have support many special function and make add (+), subtract (-) , and, or, fraction, round mod and have many more. Is no can filter easy ?

Quote
If you have LazReport installed or the sources at hand, maybe you could look into that?
Literal = literal and no literal= parse special and have function and calculate.

no can change how work laz report ?

https://github.com/alrieckert/lazarus/blob/master/components/lazreport/source/lr_pars.pas

add:

....
You never know what characters a user may insert into any string.
...
Have same answer. Make literal.
« Last Edit: May 14, 2019, 10:04:32 pm by Thausand »

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
Re: LazReport - Feature Bug??
« Reply #21 on: May 14, 2019, 11:37:36 pm »
1) The other the "!" was missing, not sure what happened , but its there now.

2) Doesn't really matter anyways.... Can't use the [fields] in LazReport for this project, because the Lyrics Chord text is manually typed in by the user (just like coding). And if what you are saying is that because it's an invalid "field, it will remove what's in between. Then why should I go through all this work for.....

3) I have already figured out how to print the entire text (with word-wrap - and multiple pages) using just the printer.canvas.

No need for all this complication for something that I can easily print with Printer.Canvas and not worry about missing characters,

So, LAZ Report is really made for db's and user value fields and not straight print. Which is cool. I will use LAZR when i need to print fields on a form.

So, I am done with this thread and I want to THANK EVERYONE FOR YOUR HELP!!
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

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 857
Re: [DONE] LazReport - Feature Bug??
« Reply #22 on: October 31, 2020, 09:04:11 am »
hello,
i think that i have found a solution to print everything in lazreport :
use a variable string  (see attachment)
resultat and demo project (print the content of a tmemo with printers or lazreport)  in attachment

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

 

TinyPortal © 2005-2018