Autor Beitrag
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 10.01.06 12:04 
Hi,
Ich suche eine Komponente o.ä. um Reports zu erstellen, ohne dabei auf eine db zuzugreifen.
Die Daten liegen in Records of arrays vor und ich würde sie ungern noch mal in eine db einpflegen.

Kennt jemand was, womit man Reports auf der Basis programminterner Variablen erstellen kann ?

Schönen Gruß
Der Azubi...
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Di 10.01.06 12:32 
Mit den QuickReport-Komponenten geht das. Die sind zwar primär auf eine Datenbank-Anbindung ausgerichtet, funktionieren aber auch ohne Datenbank - das ist allerdings etwas mehr Handarbeit. TQuickRep hat ein OnNeedData-Event, in dem du deinen Report füllen kannst. OnNeedData wird solange aufgerufen wie du im Parameter MoreData true zurückgibst. Für die Datenfelder im Report kannst du den TQRLabel oder TQRMemo-Komponenten benutzen, die du im OnNeedData-Event füllst.

Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
azubi_20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 10.01.06 12:54 
Hmm, interessant...
aber leider sind die Quickreport-Kompos ziemlich teuer.

Ich habe hier Delphi 2005 prof. und da gibts "Crystal Reports", aber so wie ich das sehe, geht es damit auch nicht... :-(

Gibt es noch andere Alternativen, die billiger sind (oder gar umsonst ...) ?
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Di 10.01.06 14:02 
Eine kostenlose Möglichkeit wäre die Reporterzeugung über XSL-FO. Wenn du dich allerdings mit XML, XSL und FO noch nicht beschäftigt hast, erfordert das eine beträchtliche Einarbeitungszeit. FO ist eine XML-basierte Seitenbeschreibungssprache, die sich gut für Reports verwenden lässt. Ein kostenloser Renderer dafür ist FOP.
Du schreibst die Report-Daten in eine XML-Datei, die mit einem XSL-Stylesheet in ein FO-Dokument transformiert wird. Das FO wird dann vom FO-Prozessor in ein PDF gerendert oder direkt gedruckt.Ein Vorteil dieser Vorgehensweise ist eine klare Trennung von Daten (die aus der XML-Datei stammen) und Layout (das vom Stylesheet festgelegt wird). Damit lässt sich das Report-Layout auch ohne Änderung des Programmcodes modifizieren.

Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
azubi_20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 10.01.06 14:18 
Danke für deine Hinweise.

Ich werde es mir mal angucken...
wwwdirk
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38


D6 Prof / D2005 Prof
BeitragVerfasst: Di 10.01.06 14:25 
Titel: Rave-Report
Hi,
die in Delphi2005 integrierte Report-Engine RaveReports kann auch ohne DB-Anbindung benutzt werden. Ich hab da mal nen Vortrag auf der EKON gehört. Details weiss ich allerdings auch nicht. Schlag dich mal durch die Doku. Auf der Page von Nevrona erhältlich: www.nevrona.com/Default.aspx?tabid=163!

Gruß
Dirk
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 10.01.06 21:03 
Und wenn Du was wirklich professionelles suchst und sowieso was kaufen musst, dann halte Dich an List & Label. Sind zwar auch nicht billig, aber sehr gut. Ich hatte mal das Vergnügen damit zu arbeiten und ich muss sagen, es schlägt Rave bei weitem. ;-)

Ich war mal auf einer 2-Tages-Schulung zu XSL-FO, um PDF-Dateien erzeugen zu können. Wenn man ein paar gute Tuts hat, dann ist das gar nicht mehr sooo schwer.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Di 10.01.06 21:24 
Ich kann Dir dann noch die FreeReport (kostnix) und FastReport (100? euronen) empfehlen. Dort gibt es eine einfache 'Userdataset'-Komponente, mit der Du einfach auf solche Strukturen zugreifen kannst. Ich weiss nicht genau, ob es das bei FreeReport auch gibt, denke aber schon. Schau doch einfach bei www.fast-report.com vorbei und lad Dir ne trial runter...

_________________
Na denn, dann. Bis dann, denn.
azubi_20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Mi 11.01.06 09:24 
Ich hab mir mal rave angeschaut.
also mit rave kann man variablen so übergeben

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
With RvProject1 do begin
    Open;
    SetParam('ParamName','ParamValue');
    ExecuteReport('Report1');
    Close;
  end; { with }


aber ich schau mir noch mal die freereport-kompo an...
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Mi 11.01.06 11:43 
Fastreport bietet, wie erwähnt, das UserDataset an. Eine wirklich einfache Geschichte.
Du definiertst die 'Feldnamen' in einer TStringlist-Property
Dann hast Du die Events OnFirst, OnNext, OnPrev, OnEof, OnGetValue (So ähnlich heissen die)

Wenn Du ein Array of Record oder sowas hast, dann
OnFirst - MyIndex := 0;
OnNext - Inc (MyIndex)
OnPrev - Dec (MyIndex)
OnEof - IsEof := (MyIndex>= MyArraySize)
OnGetValue - If Field ='Field1' Then Value := MyArray[MyIndex].Field1

... etc.

_________________
Na denn, dann. Bis dann, denn.
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mi 11.01.06 21:42 
Genau so ein DataSet bietet Rave auch an. Man definiert vorher die Felder und im Ereignis GetValue (o.Ä.) wird dann der Wert pro Zeile übergeben.
Die Parameter sollten nur für Einstellungen verwendet werden, nicht für die eigentliche Datenübergabe.
azubi_20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Do 12.01.06 10:43 
Ich hab jetzt mal versucht mit RAVE ein Array of Strings zu übergeben. Das klappt aber nicht.
Mein Report bleibt leer.

Im Rave habe ich eine Region mit einem DataBand. In dem habe ich eine DataText-Komponente.
Diese habe ich mit dem "Testfeld" der DataView verknüpft. Nachfolgend mein Quelltext :

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, RpCon, RpBase, RpSystem, RpDefine, RpRave;

type
  TForm1 = class(TForm)
    RvProject1: TRvProject;
    RvSystem1: TRvSystem;
    RvCustomConnection1: TRvCustomConnection;
    Button1: TButton;
    procedure RvCustomConnection1GetCols(Connection: TRvCustomConnection);
    procedure RvCustomConnection1GetRow(Connection: TRvCustomConnection);
    procedure RvCustomConnection1Open(Connection: TRvCustomConnection);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  Aarray : Array[1..10] of string;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  rvproject1.Open;
  rvproject1.ExecuteReport('report1');
end;

procedure TForm1.FormCreate(Sender: TObject);
var i : integer;
begin
  for i:= 1 to 10 do
   Aarray[i] := inttostr(i);
end;

procedure TForm1.RvCustomConnection1Open(Connection: TRvCustomConnection);
begin
  Connection.DataRows:=length(Aarray);
end;

procedure TForm1.RvCustomConnection1GetCols(Connection: TRvCustomConnection);
begin
  Connection.WriteField('Testfeld', dtString, 25, '', '');
end;

procedure TForm1.RvCustomConnection1GetRow(Connection: TRvCustomConnection);
begin
  with Connection do
    begin
      WriteStrData('',aarray[connection.dataindex]);
    end;
end;

end.



Was muss ich noch machen, dass das Array im RaveReport zu sehen ist ?
azubi_20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Do 12.01.06 10:55 
Ok, ich habe vergessen beim Datenband die Dataview zuzuordnen.
Jetzt kommt aber nur "(invalid)" im Report.
Was muss ich noch tun ?
Xion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
EE-Maler
Beiträge: 1952
Erhaltene Danke: 128

Windows XP
Delphi (2005, SmartInspect), SQL, Lua, Java (Eclipse), C++ (Visual Studio 2010, Qt Creator), Python (Blender), Prolog (SWIProlog), Haskell (ghci)
BeitragVerfasst: So 10.09.06 10:51 
in Freerport:

Beispiel: ich schreibe eine Zeile aus TableMainData in den Report (memo13), wobei ich 1. und letztes Zeichen wegschneide

ausblenden Delphi-Quelltext
1:
2:
3:
   S:=Copy(Form1.TableMainData.FieldByName('Rich').AsString,2,Length(Form1.TableMainData.FieldByName('Rich').AsString)-2);
   tfrmemoview(Form1.frReport1.findobject('memo13')).Memo.Clear;
   tfrmemoview(Form1.frReport1.findobject('memo13')).Memo.Add(S);

_________________
a broken heart is like a broken window - it'll never heal
In einem gut regierten Land ist Armut eine Schande, in einem schlecht regierten Reichtum. (Konfuzius)