Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-02

LazReport Band.name patch

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuliano Colla

While implementing an application which uses LazReport, trying to take advantage of OnBeginBand I discovered that Band.Name is never set and is left as an empty string.
This can be annoying if you have more than one Band of the same type, so that Band.Typ is not enough to tell the right band. Here attached two patches which for me fixed the issue, one, an svn diff, for the svn version 2.4, and the other, a plain diff, for the current Lazarus release (1.0.4) version, i.e. 2.3. Maybe it can be done much better, but just in case...

Giuliano

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lr_class.diff
Type: text/x-patch
Size: 951 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130202/22123f06/attachment.bin> -------------- next part --------------
A non-text attachment was scrubbed...
Name: lazrep-1.0.4.diff
Type: text/x-patch
Size: 964 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130202/22123f06/attachment-0001.bin>

Reply by email

Jesus Reyes
to Giuliano Colla

--- El s?b 2-feb-13, Giuliano Colla escribi?:

Show quoted text 21 lines
De: Giuliano Colla Asunto: LazReport Band.name patch A: Cc: "Jesus Reyes" Fecha: s?bado, 2 de febrero de 2013, 8:32 While implementing an application which uses LazReport, trying to take advantage of OnBeginBand I discovered that Band.Name is never set and is left as an empty string. This can be annoying if you have more than one Band of the same type, so that Band.Typ is not enough to tell the right band. Here attached two patches which for me fixed the issue, one, an svn diff, for the svn version 2.4, and the other, a plain diff, for the current Lazarus release (1.0.4) version, i.e. 2.3. Maybe it can be done much better, but just in case... Giuliano

Thanks, applied in trunk (r40127). It's too late for including in next release (1.0.6) will have to wait 1.0.8

Jesus Reyes A.

Reply by email

Giuliano Colla
Jesus Reyes wrote 5 lines
Hi Giuliano, As you may know, the patch was merged to fixes but, a problem was detected, it introduced a regression, please see http://bugs.freepascal.org/view.php?id=23901 Jesus Reyes A.

I made further tests both under Linux and under Windows. The behavior turns out to be the same.

What happens is that my patch (i.e. setting Band name from the BandView) doesn't affect Preview at design time, doesn't affect any method for displaying a Report (PrepareReport, etc.) but it causes an error if you attempt to design a report in runtime (something I had not tested, because I didn't use it) .
In that condition (and only in that condition) whenever the name of an object is set, it verifies if the name is duplicated. As we have the same name for BandView and Band, when we set the name of the Band it triggers the error.
It's unclear to me while this test is made only in this condition, because there should be no difference if you design a report at design time, or at run time, but that's how it's made.

I've tested a different approach, i.e. not *setting* the Band name, but just *getting* Band name from BandView, (a Name property in TfrBand which just returns the name of the corresponding Bandview, i.e. View.Name). It doesn't produce side effects, because when the BandView name is set the corresponding Band object doesn't yet exist.

There are two solutions:
1) I send you the new patch.
2) We leave things as they are, but the examples and the documentation are modified to make it clear that TfrBand.Name is always empty, and that one must use TfrBand.View.Name to obtain a meaningful information.

You're the boss, so it's up to you to decide.

Giuliano

Reply by email

Jesus Reyes
to Giuliano Colla

--- El jue 21-feb-13, Giuliano Colla escribi?:

Show quoted text 19 lines
I've tested a different approach, i.e. not *setting* the Band name, but just *getting* Band name from BandView, (a Name property in TfrBand which just returns the name of the corresponding Bandview, i.e. View.Name). It doesn't produce side effects, because when the BandView name is set the corresponding Band object doesn't yet exist. There are two solutions: 1) I send you the new patch. 2) We leave things as they are, but the examples and the documentation are modified to make it clear that TfrBand.Name is always empty, and that one must use TfrBand.View.Name to obtain a meaningful information. You're the boss, so it's up to you to decide. Giuliano

Yes, please send the patch.

Jesus Reyes A.

Reply by email

Giuliano Colla
to Jesus Reyes
Jesus Reyes wrote 24 lines
--- El jue 21-feb-13, Giuliano Colla escribi?: > I've tested a different approach, i.e. not *setting* the > Band name, but just *getting* Band name from BandView, (a > Name property in TfrBand which just returns the name of the > corresponding Bandview, i.e. View.Name). It doesn't produce > side effects, because when the BandView name is set the > corresponding Band object doesn't yet exist. > > There are two solutions: > 1) I send you the new patch. > 2) We leave things as they are, but the examples and the > documentation are modified to make it clear that > TfrBand.Name is always empty, and that one must use > TfrBand.View.Name to obtain a meaningful information. > > You're the boss, so it's up to you to decide. > > Giuliano > Yes, please send the patch. Jesus Reyes A.

Here is it.

Giuliano

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lr_class.diff
Type: text/x-patch
Size: 807 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130225/9bdcd891/attachment.bin>

Reply by email

Giuliano Colla
to Giuliano Colla

On February 25 I sent you a small patch to fix the band.name issue. I've never got any feedback, and, as of today, I don't see the patch in trunk.
Did you decide to reject the patch, or you didn't get it?

Giuliano

Reply by email

Maxim Ganetsky
to Giuliano Colla

21.04.2013 19:37, Giuliano Colla ?????:

On February 25 I sent you a small patch to fix the band.name issue. I've never got any feedback, and, as of today, I don't see the patch in trunk. Did you decide to reject the patch, or you didn't get it?

You really should create bug report with this patch. Most likely it was simply forgotten.

Best regards, Maxim Ganetsky mailto:

Reply by email

Giuliano Colla
to Maxim Ganetsky

Il 21/04/2013 17:52, Maxim Ganetsky ha scritto:

Show quoted text 9 lines
21.04.2013 19:37, Giuliano Colla ?????: > On February 25 I sent you a small patch to fix the band.name issue. > I've never got any feedback, and, as of today, I don't see the patch in > trunk. > Did you decide to reject the patch, or you didn't get it? You really should create bug report with this patch. Most likely it was simply forgotten.

That's why I asked. Thank you.

Reply by email

Giuliano Colla
to Maxim Ganetsky: 21.04.2013 19:37, Giuliano Colla ?????: You really should create bug report with this…

Il 21/04/2013 17:52, Maxim Ganetsky ha scritto:

Show quoted text 9 lines
21.04.2013 19:37, Giuliano Colla ?????: > On February 25 I sent you a small patch to fix the band.name issue. > I've never got any feedback, and, as of today, I don't see the patch in > trunk. > Did you decide to reject the patch, or you didn't get it? You really should create bug report with this patch. Most likely it was simply forgotten.

Bug report created:
http://bugs.freepascal.org/view.php?id=24305

Giuliano

Reply by email