Einzelnen Beitrag anzeigen

Benutzerbild von cs.rumpelstilzchen
cs.rumpelstilzchen

Registriert seit: 16. Sep 2004
Ort: NRW
72 Beiträge
 
Delphi XE4 Professional
 
#8

Re: Rave: Reihenfolge von Objekten (Bändern) zur Laufzeit än

  Alt 3. Jan 2006, 15:19
Hallo Merlin 17!

Danke für deine Aufmerksamkeit.

In der Tat, ich habe von Nevrona eine Interessante Antwort erhalten:

Meine Frage war:
Zitat:
I want Rave to print components on a new page if the user wants to.
I tried to use the components properties like this:

MyComponent := FindRaveComponent(szModulName,MyPage) as TRaveComponent;
if MyComponent <> nil then
begin
MyComponent.Visible := True;
MyComponent.BringToFront;
end;

But i can't find the properties StartNewPage and FinishNewPage!

What i found is the Tag-propertie. So i decided to set it to 1 and then use this information in the Rave-Event-Programming. But the Tag-propertie is not known there!!!
Die Antwort dazu:

Zitat:
Hi Jürgen,

Thank you for including your Rave product (BE or BEX) and version. PLEASE do this in ALL support messages (check Rave Help About). It helps us provide a better support answer. For your information, Rave 6.0.1 is the BE (Borland Edition) product - not BEX which is an upgrade. The latest version of Rave 6 BEX is 6.0.5.

> I want Rave to print components on a new page if the user wants to. I
tried to use the components properties like this: ..... But i can't find the properties StartNewPage and FinishNewPage! What i found is the Tag-propertie. So i decided to set it to 1 and then use this information in the Rave-Event-Programming. But the Tag-propertie is not known there!!!

The first thing I have to say is FindRaveComponent is simply a back-door to the visual designer that was intended for "MINOR" changes or adjustments to visual reports before the report is started. Once the report has started, the FindRaveComponent code is NOT used. Tip #79 "Create Reports without Visual Designer" on our web site "Tips and Tricks"
page has a full paragraph on this. Basically, if you are doing more than one or two "simple" properties (left, top, color etc) then you really should be looking at true code-base reporting. If I could go back in time - I would strongly recommend that the "FindRaveComponent" not have been developed or released. I would not and do not recommend that you use the FindRaveComponent method for anything other than very simple things.

The Rave Reports event system has been significantly improved since it was first introduced in Rave BE 5.0.8. The FindRaveComponent method allowed early Rave 5 users to do some things that the early scripting engine could not do. However, the scripting engine (events) has matured considerably since its introduction and became as powerful (later releases of Rave 5), then even more powerful (Rave 6) than the FindRaveComponent method. The scripting engine can make conditional changes as the report is running - something the FindRaveComponent method never could do.

In fact, if you are using Rave 6 or later, then I would say you should focus on using combinations of parameters and Rave events. If you cannot do it with parameter and events, then you probably need to look at a "true code-based" solution and not the FindRaveComponent method.

That said, "StartNewPage" and "FinishNewPage" are properties of a Band component. I did a quick test in both the event system and in my test project with a FindRaveComponent and had no problem. However, I believe that some of the components are "set" to the "designer" setting when the report starts. So "back-door" changes may appear to be ignored.

Technical Support
support@nevrona.com
Wobei man sich den Satz "If I could go back in time - I would strongly recommend that the "FindRaveComponent" not have been developed or released." dringend merken sollte! Wer weiss wielange das überhaupt noch so möglich sein wird!

Es ist tatsächlich nicht möglich die Eigenschaften StartNewPage und FinishNewPage direkt im Delphi zu manipulieren! Und im Rave habe ich innerhalb eines Events keinen direkten Zugriff auf Parameter und auf den 'Tag'-Wert.
Also hab ich den unter Programmierern so beliebten 'Schrägdurchdiebrustinsauge'-Ansatz probiert:
- Parameter für jedes der zu steuernden Module angelegt
- zu jedem Datenband einen Footer hinzugefügt
- dort ein DataText-Objekt mit Inhalt zugehöriger Parameter
- jedem Footer ein 'BeforePrint'-Event verpasst
- im Event abhängig vom Inhalt des Datatext-Objekts die Eigenschaft 'FinishNewPage' gesetzt
Ein bisserl Umständlich, aber es funzt!!!!

Mit Rave kann man schon ne Menge anstellen, aber nach wie vor finde ich es äußerst befremdlich, daß es keine vollständige Dokumentation dazu gibt!

Es ist doch lächerlich, da wird das runde Rad immer wieder neu erfunden nur weil der Hersteller keine Lust hat mal was schriftliches zu Produzieren, mit dem man wirklich arbeiten kann!

Wie weit bist du mit deinem Buch zu Rave? Hätte das Zeug zum Bestseller!

Übrigens hast du richtig vermutet, das Problem mit der Exception war tatsächlich ein 'Dreckfuhler'. Das Objekt hatte im Rave einen anderen Namen!

So long und nochmals Danke

Jürgen
Der weiß, daß er nichts weiß, wie alle anderen auch nichts wissen.
Nur weiß er, was die anderen und auch er selbst noch lernen müssen.
(Novalis 1772 - 1801)
  Mit Zitat antworten Zitat