24. Juli 2008 13:54
switch(OptionWert = 0, "Caption 1",
OptionWert = 2, "Caption 2")
24. Juli 2008 14:07
select
No_ , case when Type =0 then 'nichts' when Type = 1 then 'Fibu' else 'Artikel' end as Type
from Sales_Line
24. Juli 2008 14:20
24. Juli 2008 14:26
4. August 2008 12:57
4. August 2008 13:29
j.r hat geschrieben:Die Krux dabei: Wie bekomme ich die Captions der Optionsfelder in diese Tabelle geschrieben?
Da habe ich überhaupt keine Idee, da ich bislang nicht einmal weiß, wo die Captions in der SQL-Datenbank abgelegt werden.
4. August 2008 22:14
OBJECT Table 50100 Option Caption
{
OBJECT-PROPERTIES
{
Date=04.07.08;
Time=22:05:06;
Modified=Yes;
Version List=;
}
PROPERTIES
{
}
FIELDS
{
{ 10 ; ;Table No. ;Integer }
{ 20 ; ;Field No. ;Integer }
{ 30 ; ;Option Value ;Integer }
{ 40 ; ;Language Code ;Code10 }
{ 100 ; ;Table Name ;Text30 }
{ 110 ; ;Field Name ;Text30 }
{ 120 ; ;Option Name ;Text60 }
{ 130 ; ;Option Caption ;Text60 }
}
KEYS
{
{ ;Table No.,Field No.,Option Value,Language Code;
Clustered=Yes }
{ ;Table Name,Field Name,Option Value,Language Code }
}
CODE
{
PROCEDURE FillTable@1140000();
VAR
OptionCaption@1140008 : Record 50100;
Field@1140000 : Record 2000000041;
WindowsLanguage@1140015 : Record 2000000045;
RecRef@1140006 : RecordRef;
FldRef@1140007 : FieldRef;
StatusDialog@1140001 : Dialog;
TempText@1140012 : Text[1024];
TempText2@1140013 : Text[1024];
OptionStringArray@1140010 : ARRAY [100] OF Text[60];
OptionCaptionArray@1140014 : ARRAY [100] OF Text[60];
OldLangID@1140016 : Integer;
Now@1140002 : Integer;
Max@1140003 : Integer;
c_StatusDialog@1140004 : TextConst
'DEU=Fuelle Tabelle...\@1@@@@@@@@@@@@@@@@@@@@@@@@@@@@',
'ENU=Filling table...\@1@@@@@@@@@@@@@@@@@@@@@@@@@@@@';
c_ConfirmFillTable@1140005 : TextConst
'DEU=Soll die Tabelle neu gefuellt werden?',
'ENU=Refill table?';
i@1140011 : Integer;
NumOptions@1140009 : Integer;
BEGIN
IF NOT CONFIRM(c_ConfirmFillTable, FALSE) THEN
EXIT;
OptionCaption.RESET;
OptionCaption.DELETEALL;
OldLangID := GLOBALLANGUAGE;
IF GUIALLOWED THEN BEGIN
StatusDialog.OPEN(c_StatusDialog);
END;
WindowsLanguage.RESET;
WindowsLanguage.SETRANGE("STX File Exist", TRUE);
IF WindowsLanguage.FINDSET THEN REPEAT
GLOBALLANGUAGE(WindowsLanguage."Language ID");
Field.SETRANGE(TableNo, 0, DATABASE::Object - 1);
Now := 0;
Max := Field.COUNT;
IF Field.FINDSET THEN REPEAT
Now := Now + 1;
IF Now MOD 50 = 0 THEN BEGIN
StatusDialog.UPDATE(1, ROUND(Now / Max * 10000, 1));
END;
IF Field.Type = Field.Type::Option THEN BEGIN
RecRef.OPEN(Field.TableNo);
IF RecRef.FIELDEXIST(Field."No.") THEN BEGIN
FldRef := RecRef.FIELD(Field."No.");
TempText := FldRef.OPTIONSTRING;
TempText2 := FldRef.OPTIONCAPTION;
NumOptions := GetOptionArray(TempText, OptionStringArray);
GetOptionArray(TempText2, OptionCaptionArray);
FOR i := 1 TO NumOptions DO BEGIN
CLEAR(OptionCaption);
OptionCaption."Table No." := Field.TableNo;
OptionCaption."Field No." := Field."No.";
OptionCaption."Option Value" := i - 1;
OptionCaption."Language Code" := WindowsLanguage."Abbreviated Name";
OptionCaption."Table Name" := RecRef.NAME;
OptionCaption."Field Name" := Field.FieldName;
OptionCaption."Option Name" := OptionStringArray[i];
OptionCaption."Option Caption" := OptionCaptionArray[i];
OptionCaption.INSERT;
END;
END;
RecRef.CLOSE();
END;
UNTIL Field.NEXT = 0;
UNTIL WindowsLanguage.NEXT = 0;
IF GUIALLOWED THEN BEGIN
StatusDialog.CLOSE();
END;
GLOBALLANGUAGE(OldLangID);
END;
PROCEDURE GetOptionArray@1140002(OptionText@1140000 : Text[1024];VAR OptionArray@1140001 : ARRAY [100] OF Text[60]) : Integer;
VAR
Pos@1140002 : Integer;
ArrayPos@1140003 : Integer;
BEGIN
ArrayPos := 0;
REPEAT
Pos := STRPOS(OptionText, ',');
IF Pos > 0 THEN BEGIN
ArrayPos := ArrayPos + 1;
OptionArray[ArrayPos] := COPYSTR(OptionText, 1, Pos - 1);
OptionText := COPYSTR(OptionText, Pos + 1);
END;
UNTIL Pos <= 0;
ArrayPos := ArrayPos + 1;
OptionArray[ArrayPos] := OptionText;
EXIT(ArrayPos);
END;
BEGIN
END.
}
}
5. August 2008 15:58