AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

FastReport Barcode

Ein Thema von t0mmy · begonnen am 28. Feb 2012 · letzter Beitrag vom 29. Feb 2012
 
Benutzerbild von Gollum
Gollum

Registriert seit: 14. Jan 2003
Ort: Boxberg
456 Beiträge
 
Delphi 10.1 Berlin Professional
 
#11

AW: FastReport Barcode

  Alt 28. Feb 2012, 13:37
Hallo,

folgend ein Ausschnitt aus der Fastreport-Doku. Vielleicht hilfts:

Delphi-Quellcode:
Modifying the variable’s value

There are two ways to modify the value of a variable:

  frxReport1.Variables['My Variable 2'] := 10;

or

var
  Index: Integer;
  Variable: TfrxVariable;

{ search for the variable }
  Index := frxReport1.Variables.IndexOf('My Variable 2');
{ if it is found, change a value }
  if Index <> -1 then
  begin
    Variable := frxReport1.Variables.Items[Index];
    Variable.Value := 10;
  end;

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.

 
In some cases it is easier to pass variables using a script.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz