![]() |
FastReport Barcode
Also ich habe einen FastReport mit einem Barcode dem ich eine Variable (varBarcode) zuweise.
In meinem Programm übergebe ich nun den Barcode A1181002: Beim Ausführen erscheint folgender Fehler: BarCode_varBarcode: BarCode_varBarcode: Fehler im Ausdruck 'A1181002': Undefinierter Bezeichner: 'A1181002' BarCode_varBarcode: Fehler im Ausdruck 'A1181002': Undefinierter Bezeichner: 'A1181002' |
AW: FastReport Barcode
Und wie?
|
AW: FastReport Barcode
Delphi-Quellcode:
frxReport_PrintLabel.Variables['varBarcode'] := Main.Edit_PrintBarcode.Text;
|
AW: FastReport Barcode
Hast Du die Komponente TfrxBarCodeObject mit auf der Form, wo Dein Fast-Report liegt ? Welchen Wert hat die Eigenschaft BarType von Deinem Object Barcode vom Report ?
|
AW: FastReport Barcode
Jap hab ich.
Der BarType Wert ist bcCode39. |
AW: FastReport Barcode
und wie weist du die Variable dem Barcode Objekt zu ?
|
AW: FastReport Barcode
Also Beim Objektinspektor steht da unter Expression <varBarcode>
Ich hab die Variable aber über rechtsklick auf Barcode --> Bearbeiten --> unter Code den Button fx gedruckt und dann auf Variablen und Doppelklick auf varBarcode und dann OK und nochmal OK |
AW: FastReport Barcode
versuche mal folgendes:
Delphi-Quellcode:
statt
frxGlobalVariables['varBarcode'] := Main.Edit_PrintBarcode.Text;
Delphi-Quellcode:
frxReport_PrintLabel.Variables['varBarcode'] := Main.Edit_PrintBarcode.Text;
|
AW: FastReport Barcode
Zitat:
Der übergebene String wird eben als Ausdruck interpretiert, soll heißen, dass FastReport den Inhalt nochmals durch einen Interpreter schickt und der kann diesen nicht verarbeiten, denn A1181002 ist ihm gänzlich unbekannt. Versuch es mal mit
Delphi-Quellcode:
frxReport_PrintLabel.Variables['varBarcode'] := QuotedStr( Main.Edit_PrintBarcode.Text );
// oder frxReport_PrintLabel.Variables['varBarcode'] := '"' + Main.Edit_PrintBarcode.Text + '"'; |
AW: FastReport Barcode
@haentschman:
Delphi-Quellcode:
das hab ich nicht und so eine Komponente finde ich auch nicht.
frxGlobalVariables['varBarcode'] := Main.Edit_PrintBarcode.Text;
@Sir Rufo Danke für deine Antwort aber deine Vorschläge geben mir auch so einen ähnlichen Fehler wieder aus. |
AW: FastReport Barcode
Zitat:
|
AW: FastReport Barcode
Zitat:
|
AW: FastReport Barcode
Jap da stimm ich dem oben zu.. also kanns am Barcodetyp nicht liegen, zudem hab ich einige andere auch ausprobiert und es kommt trotzdem der Fehler.
|
AW: FastReport Barcode
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. |
AW: FastReport Barcode
Zitat:
Zitat:
|
AW: FastReport Barcode
Habs probiert aber er schreibt mir trotzdem Fehlerhafter Ausdruck...
hmm bei reinen Ziffern gehts nur wenn ich einen Buchstaben drinnen habe nicht. :( |
AW: FastReport Barcode
Ganz Dumm gefragt, hast Du Deine verwendete Variable varBarCode nur so in die Barcode-Komponente reingeschrieben oder im Report richtig deklariert und in der Barcode-Komponente ausgewählt. Hänge doch mal Deinen Fast-Report dran, wenn es nichts geheimes ist.
|
AW: FastReport Barcode
:zwinker: Beitrag #7
Zitat:
|
AW: FastReport Barcode
So hab das Problem gelöst, ich hab nicht so genau geschaut, da mein Report einiges an inhalt gehabt hat und ich den Barcode den ich übermittelt habe auch in ein Memofeld geschrieben habe und dort ist der Fehler dann auch erschienen.
Aber jetzt habe ich alle übergebenen Variablen mit ''''+Variable+'''' umprogrammiert. Danke für eure Hilfe. |
AW: FastReport Barcode
Zitat:
![]() Ok, es gibt einen, denn unter bestimmten Umständen bekommst du mit deiner Variante wieder einen Fehler. Deine Variante:
Code:
Mit QuotedStr
Test's => 'Test's'
Code:
Test's => 'Test''s'
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:21 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