Einzelnen Beitrag anzeigen

Benutzerbild von Salomon
Salomon

Registriert seit: 9. Jun 2002
453 Beiträge
 
#9

Re: Fastreport Variablen übergeben und anzeigen

  Alt 26. Okt 2007, 09:57
Die Änderungen habe ich vorgenommen. Leider ohne Erfolg. Das scheint mir irgend ein komischer Bug zu sein Trotzdem schon mal vielen Dank für deine Hilfe

Ich habe den Wert der Variable mal im OnGetValue Event der frxReportKomponente "abgefangen". Da steht nichts drin... Wenn ich hier das Value ändere wird er im Report angezeigt. Das ist aber nicht der schönste Weg die Variablen in den Report zu bekommen

Delphi-Quellcode:
procedure TDM_Report.frxActivityReportGetValue(const VarName: string;
  var Value: Variant);
begin
  if CompareText(VarName, 'FromDate') = 0 then
  begin
    showmessage(Value);
    Value := 'test';
  end;
end;

//Nachtrag
Habs jetzt endlich gelöst Ganz einfach wenn man die richtigen Dokumente gefunden hat. Aber auf diese Syntax muss man auch erst mal kommen.


Zitat:
It should be noted, that when accessing a report variable its value is calculated if it
is of string type. That means the variable which value is 'Table1."Field1"' will return a value
of a DB field, but not the 'Table1."Field1"' string. You should be careful when assigning a
string-type values to report variables. For example, the next code will raise exception
"unknown variable 'test'" when running a report:
frxReport1.Variables['My Variable'] := 'test';
because FastReport trying to calculate a value of such variable. The right way to pass a
string values is:
frxReport1.Variables['My Variable'] := '''' + 'test' + '''';
In this case the variable value - string 'test' will be shown without errors. But keep
in mind that:
- string should not contain single quotes. All single quotes must be doubled;
- string should not contain #13#10 symbols.
01001000 01100001 01101100 01101100 01101111
01010111 01100101 01101100 01110100 00100001

http://www.it-adviser.net
  Mit Zitat antworten Zitat