18. August 2006 17:00
18. August 2006 17:20
18. August 2006 17:26
18. August 2006 18:01
IF DocuObject.FIND('-') THEN BEGIN
TempExcelBuffer.DELETEALL;
TempExcelBuffer.CreateBook;
REPEAT
... füllen von ExcelBuffer...
TempExcelBuffer.CreateNewSheet(FORMAT(DocuObject.ID) +' - '+ DocuObject.Name,
FORMAT(DocuObject.ID) +' - '+ DocuObject.Name,
COMPANYNAME,
USERID);
UNTIL DocuObject.NEXT = 0;
END;
TempExcelBuffer.GiveUserControl;
XlWrkSht := XlWrkBk.Worksheets.Add;
CreateSheet(SheetName, '', CompanyName, UserID2);
19. August 2006 01:22
rotsch hat geschrieben:Was auch nicht klappt, ist der Aufruf CreateBook am Anfang. Da motzt er mit einer fehlenden Instanz, und wenn ich CreateBook in die Schleife nehme, erhalte ich pro Durchgang ein neues Excel-File.
19. August 2006 08:35
19. August 2006 09:06
DocuObject.SETRANGE(Type, DocuObject.Type::Table);
IF DocuObject.FIND('-') THEN BEGIN
Line := 1;
TempExcelBuffer.DELETEALL;
TempExcelBuffer.CreateBook;
REPEAT
DocuObject.CALCFIELDS(Name);
EnterCell(Line, 1, FORMAT(DocuObject.ID) +' - '+ DocuObject.Name, true, italic, false);
Line := Line + 2;
EnterCell(Line, 1, 'Fieldlist', true, italic, false);
Line := Line + 2;
TempExcelBuffer.CreateNewSheet(FORMAT(DocuObject.ID) +' - '+ DocuObject.Name,
'Objectdocumeantion (Table)',
COMPANYNAME,
USERID);
TempExcelBuffer.DELETEALL;
Line := 1;
UNTIL DocuObject.NEXT = 0;
END;
TempExcelBuffer.GiveUserControl;
XlWrkSht := XlWrkBk.Worksheets.Add;
CreateSheet(SheetName, '', CompanyName, UserID2);
XlWrkSht.Activate;
21. August 2006 07:49
21. August 2006 13:18
22. August 2006 15:44
rotsch hat geschrieben:Eine kleine Unschönheit habe ich noch festgestellt.
Im erstellten Workbook befinden sich am Schluss jeweils 4 leere Sheets in der Reihenfolge Tabelle 4, Tabelle 1, Tabelle 2, Tabelle 3.
1 - 3 werden ja durch Excel automatisch erstellt, wenn man ein neues Workbook erstellt. Lässt sich das vermeiden?
22. August 2006 16:39
23. August 2006 23:09
rotsch hat geschrieben:Gibt es eine Möglichkeit festzustellen, ob und wieviel leere Sheets vorhanden sind und diese dann explizit zu aktivieren, sodass diese zuerst gefüllt werden, bevor neue angelegt werden?
25. August 2006 10:07
26. August 2006 13:28
IF Record.FIND('+') THEN BEGIN
FirstSheet := true;
TempExcelBuffer.DELETEALL;
TempExcelBuffer.CreateBook;
REPEAT
SheetName := 'Irgendwas';
... TempExcelBuffer füllen...
if FirstSheet then begin
// Standard aus ExcelBuffer
TempExcelBuffer.CreateSheet(SheetName, ReportHeader, COMPANYNAME, USERID);
FirstSheet := false;
end
else begin
// Eigene Routine
TempExcelBuffer.CreateSheet(SheetName, ReportHeader, COMPANYNAME, USERID);
end;
TempExcelBuffer.DELETEALL;
Line := 1;
UNTIL Record.NEXT(-1) = 0;
END;
TempExcelBuffer.GiveUserControl;
28. August 2006 14:53
if FirstSheet then begin
Sheet := Excel.ActiveSheet;
Sheet.Name := companyname;
FirstSheet := false;
// Eigene Routine
end else begin
// Eigene Routine
TempExcelBuffer.CreateSheet(SheetName, ReportHeader, COMPANYNAME, USERID);
end;
16. November 2006 15:12
XlWrkSht := XlWrkBk.Worksheets.Add;
CreateSheet(SheetName, '', CompanyName, UserID2);
XlWrkSht.Activate;
16. November 2006 17:40
DocuObject.SETRANGE(Version, _ActVersion);
DocuObject.SETRANGE(Type, _ActType);
IF DocuObject.FIND('+') THEN BEGIN
Line := 1;
FirstObject := TRUE;
TempExcelBuffer.DELETEALL;
TempExcelBuffer.CreateBook;
REPEAT
DocuObject.CALCFIELDS(Name);
// Excel-Sheetname
SheetName := DELCHR(DocuObject.Name, '=', '/');
SheetName := DELCHR(SheetName, '=', '\');
SheetName := DELCHR(SheetName, '=', '*');
SheetName := DELCHR(SheetName, '=', '?');
SheetName := DELCHR(SheetName, '=', '[');
SheetName := DELCHR(SheetName, '=', ']');
SheetName := DELCHR(SheetName, '=', ':');
SheetName := FORMAT(DocuObject.ID) +' - '+ SheetName;
SheetName := COPYSTR(SheetName, 1, 31);
EnterCell(Line, 1, FORMAT(DocuObject.ID) +' - '+ DocuObject.Name, TRUE, FALSE, FALSE);
EnterCell(Line, 2, 'Version' +' '+ _ActVersion, TRUE, FALSE, FALSE);
Line := Line + 2;
// Generelle Bemerkungen ausgeben
DocuGeneralDesc.SETRANGE(Version, _ActVersion);
DocuGeneralDesc.SETRANGE(Type, DocuObject.Type);
DocuGeneralDesc.SETRANGE(ID, DocuObject.ID);
IF DocuGeneralDesc.FIND('-') THEN BEGIN
// Überschrift über Bemerkungen
EnterCell(Line, 1, 'Comments', TRUE, FALSE, FALSE);
Line := Line + 1;
REPEAT
EnterCell(Line, 1, DocuGeneralDesc.Description, FALSE, FALSE, FALSE);
Line := Line + 1;
UNTIL DocuGeneralDesc.NEXT = 0;
Line := Line + 1;
END;
// Felder ausgeben
DocuTableKey.SETRANGE(Version, _ActVersion);
DocuTableKey.SETRANGE(Type, DocuObject.Type);
DocuTableKey.SETRANGE(ID, DocuObject.ID);
IF DocuTableField.FIND('-') THEN BEGIN
// Überschrift über Keyliste
EnterCell(Line, 1, 'Keylist', TRUE, FALSE, FALSE);
Line := Line + 1;
// Titel für Keyliste
EnterCell(Line, 1, DocuTableKey.FIELDNAME("Creation Time"), TRUE, FALSE, FALSE);
EnterCell(Line, 2, DocuTableKey.FIELDNAME(Activity), TRUE, FALSE, FALSE);
EnterCell(Line, 3, DocuTableKey.FIELDNAME(Responsible), TRUE, FALSE, FALSE);
EnterCell(Line, 4, DocuTableKey.FIELDNAME("Key Fields"), TRUE, FALSE, FALSE);
EnterCell(Line, 5, DocuTableKey.FIELDNAME(SumIndexFields), TRUE, FALSE, FALSE);
Line := Line + 1;
REPEAT
EnterCell(Line, 1, FORMAT(DocuTableKey."Creation Time"), FALSE, FALSE, FALSE);
EnterCell(Line, 2, FORMAT(DocuTableKey.Activity), FALSE, FALSE, FALSE);
EnterCell(Line, 3, FORMAT(DocuTableKey.Responsible), FALSE, FALSE, FALSE);
EnterCell(Line, 4, FORMAT(DocuTableKey."Key Fields"), FALSE, FALSE, FALSE);
EnterCell(Line, 5, FORMAT(DocuTableKey.SumIndexFields), FALSE, FALSE, FALSE);
Line := Line + 1;
UNTIL DocuTableKey.NEXT = 0;
Line := Line + 1;
END;
// Keys ausgeben
DocuTableField.SETRANGE(Version, _ActVersion);
DocuTableField.SETRANGE(Type, DocuObject.Type);
DocuTableField.SETRANGE(ID, DocuObject.ID);
IF DocuTableField.FIND('-') THEN BEGIN
// Überschrift über Feldliste
EnterCell(Line, 1, 'Fieldlist', TRUE, FALSE, FALSE);
Line := Line + 1;
// Titel für Feldliste
EnterCell(Line, 1, DocuTableField.FIELDNAME("Creation Time"), TRUE, FALSE, FALSE);
EnterCell(Line, 2, DocuTableField.FIELDNAME(Activity), TRUE, FALSE, FALSE);
EnterCell(Line, 3, DocuTableField.FIELDNAME("Field No."), TRUE, FALSE, FALSE);
EnterCell(Line, 4, DocuTableField.FIELDNAME("Field Name"), TRUE, FALSE, FALSE);
EnterCell(Line, 5, DocuTableField.FIELDNAME(Responsible), TRUE, FALSE, FALSE);
EnterCell(Line, 6, DocuTableField.FIELDNAME(Description), TRUE, FALSE, FALSE);
EnterCell(Line, 7, DocuTableField.FIELDNAME("Data Type"), TRUE, FALSE, FALSE);
EnterCell(Line, 8, DocuTableField.FIELDNAME("Field Classe"), TRUE, FALSE, FALSE);
Line := Line + 1;
REPEAT
DocuTableField.CALCFIELDS("Field Name",
Caption,
"Data Type",
"Field Classe");
EnterCell(Line, 1, FORMAT(DocuTableField."Creation Time"), FALSE, FALSE, FALSE);
EnterCell(Line, 2, FORMAT(DocuTableField.Activity), FALSE, FALSE, FALSE);
EnterCell(Line, 3, FORMAT(DocuTableField."Field No."), FALSE, FALSE, FALSE);
EnterCell(Line, 4, DocuTableField."Field Name", FALSE, FALSE, FALSE);
EnterCell(Line, 5, DocuTableField.Responsible, FALSE, FALSE, FALSE);
EnterCell(Line, 6, DocuTableField.Description, FALSE, FALSE, FALSE);
EnterCell(Line, 7, DocuTableField."Data Type", FALSE, FALSE, FALSE);
EnterCell(Line, 8, FORMAT(DocuTableField."Field Classe"), FALSE, FALSE, FALSE);
Line := Line + 1;
UNTIL DocuTableField.NEXT = 0;
Line := Line + 1;
END;
// Globals ausgeben
ExportGlobals(DocuObject, _ActVersion);
// Textkonstanten ausgeben
ExportTextContants(DocuObject, _ActVersion);
// Funktionen ausgeben
ExportFunctions(DocuObject, _ActVersion);
// Trigger ausgeben
ExportTriggers(DocuObject, _ActVersion);
IF FirstObject THEN BEGIN
TempExcelBuffer.CreateSheet(SheetName,
'Documentation ('+ FORMAT(_ActType) +')',
COMPANYNAME,
USERID);
FirstObject := FALSE;
END
ELSE BEGIN
TempExcelBuffer.CreateNewSheet(SheetName,
'Documentation ('+ FORMAT(_ActType) +')',
COMPANYNAME,
USERID);
END;
TempExcelBuffer.DELETEALL;
Line := 1;
UNTIL DocuObject.NEXT(-1) = 0;
END;
TempExcelBuffer.GiveUserControl;
13. September 2007 12:42