GpStructuredStorage file  7  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~sqli.vtd# sqliForm.vtdsqliFormName.vtd. sqliStep.vtdsqliStepFile.vtd 8sqliStepStr.vtdKsqliStepStrEvent.vtd sqliVar.vtd sqliVer.vtdsqliReports.vtdsqliTranslation.vtdracKeyacNamed acIsDebugacType acVarInINI acAutoStart acAutoClose acEndMessageacLocalization2acFormNameAuthoracActive anVersion acLogType acInstCoded anUserChg anUserIns adTimeChg adTimeIns acIsLocalizedacRunOnInstall acRunOnUpdate acRunOnDelete anOldVersion acCryptPassacCompiledScriptacNote acAresLite acUseCompiled acAutoCompile100005Retrtletna bilancaFAFFFTRT0ʳNBQYBFFFFFFF acKey acFormName2 acDocType acObjectName2acType acKeyShortCut2acTabSheetName2 anUserChg anUserIns adTimeChg adTimeIns acFormType acFormName2acName2 acKeyanNoacViewacSetOfacDescracReportacFileCreateTableanFileDelimiter acFileNameacFileTableName acFileDest acFileType acFileTypeXML acShowIfEmptyacTitleButtons anTitleLinesanBeginFromRecord anUserChg anUserIns adTimeChg adTimeIns acCharSet2 acStyleSheet acUnitNamed acNewThreadacDFMacPAS acSQLExport2acSQLExpacNoteacPCU acCompiled100005RGPFAENF$ B,}]B windows-1250Odprte postavke - izvoz v XMLFuprogram AresProject; uses SysUtils, Classes, Forms, Dialogs, XMLExport; begin XMLExport.ExportXML; end. 100005RGUFAENFʳNB>B windows-1250 XMLExportFKunit XMLExport; interface uses Forms, Controls, StdCtrls, SysUtils, Classes, Graphics, dlComponents, Dialogs, dlDataBase, dlGLCommon, Variants; procedure ExportXML; implementation function RightStr (Const Str: String; Size: Word): String; begin if Size > Length(Str) then Size := Length(Str) ; RightStr := Copy(Str, Length(Str)-Size+1, Size) end; procedure ExportXML; var XMLExp: TdlXMLBase; ds: TdlDataSet; cFileName, cOurCompany, cOurCode, cResponsible, cTelNum, cYYYYMM: string; cNo, cOldNo: string; i: integer; lNoDS: boolean; saveDialog: TSaveDialog; begin cResponsible:= Ares.Variables.asString['cResponsible']; cTelNum:= Ares.Variables.asString['cTelNum']; cYYYYMM:= Ares.Variables.asString['cYYYYMM']; lNoDS:= False; ds:= TdlDataSet.Create(nil); try ds.sql.Text:= 'select S.acSubject, S.acRegNo ' + 'from tPA_SysParam SP ' + ' join tHE_SetSubj S on S.acSubject = SP.acOurCompany '; ds.Open; if ds.eof then exit; cOurCompany:= ds.FieldByName('acSubject').asString; cOurCode:= trim(ds.FieldByName('acRegNo').asString); finally ds.Free; end; ds:= TdlDataSet.Create(nil); XMLExp := TdlXMLBase.Create('1.0', 'windows-1250'); try ds.sql.Text:= 'select anNo, anValue1, anValue2 ' + 'from #lHE_BalancePrtXML ' + 'where anNo < 10000 ' + 'order by anNo asc'; ds.Open; if ds.eof then exit; if cOurCode = '' then lNoDS:= True else cOurCode:= copy(cOurCode+ '0000000000', 1, 10); //header of xml file XMLExp.ValueWrite('AjpesDokument'); XMLExp.DeclareNamespace('AjpesDokument','xsi','http://www.w3.org/2001/XMLSchema-instance'); XMLExp.ValueWrite('AjpesDokument', 'http://www.ajpes.si/XML_sheme/cpp.xsd','xsi:noNamespaceSchemaLocation'); XMLExp.ValueWrite('AjpesDokument.Ident', 'CPPS', 'vrsta'); XMLExp.ValueWrite('AjpesDokument.Ident.Datum', FormatDateTime('yyyy-mm-dd', now())); XMLExp.ValueWrite('AjpesDokument.Ident.Ura', FormatDateTime('hh:mm:ss', now())); XMLExp.ValueWrite('AjpesDokument.Ident.NacinPredlozitve', 'XML Datoteka'); XMLExp.ValueWrite('AjpesDokument.Ident.VsePravice', 'Vse pravice Ajpes 2011'); XMLExp.ValueWrite('AjpesDokument.OsnovniPodatki.Mesec', copy(cYYYYMM,5,2)); XMLExp.ValueWrite('AjpesDokument.OsnovniPodatki.Leto', copy(cYYYYMM,1,4)); XMLExp.ValueWrite('AjpesDokument.OsnovniPodatki.MaticnaStevilka', cOurCode); XMLExp.ValueWrite('AjpesDokument.OsnovniPodatki.OdgovornaOseba', cResponsible); XMLExp.ValueWrite('AjpesDokument.OsnovniPodatki.TelefonskaStevilka', cTelNum); XMLExp.ValueWrite('AjpesDokument.OsnovniPodatki.Status', '10'); cOldNo := '0'; while not ds.eof do begin if ds.FieldByName('anNo').asInteger < 100 then cNo:= '1' else if ds.FieldByName('anNo').asInteger < 200 then cNo:= '2' else if ds.FieldByName('anNo').asInteger < 400 then cNo:= '3' else if ds.FieldByName('anNo').asInteger < 500 then cNo:= '4' else cNo:= '5'; if cNo <> cOldNo then begin XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec'); XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec', 'Tabela '+cNo, 'id'); cOldNo:= cNo; i:= 0; end; XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec.Aop'); XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec.Aop', RightStr('000' + ds.FieldByName('anNo').asString, 3), 'id'); XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec.Aop.P', StringReplace(FormatFloat('#0.00', ds.FieldByName('anValue1').asCurrency), ',', '.', [])); XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec.Aop.P', '1', 'col'); XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec.Aop.P', StringReplace(FormatFloat('#0.00', ds.FieldByName('anValue2').asCurrency), ',', '.', [])); XMLExp.ValueWrite('AjpesDokument.Obrazci.Obrazec.Aop.P', '2', 'col'); i:= i+1; ds.Next; end; if lNoDS = False then // if errors exist do not save begin saveDialog := TSaveDialog.Create(nil); try saveDialog.FilterIndex := 1; saveDialog.FileName := 'AjpesCetrtletnoPorocilo.XML'; saveDialog.Filter := 'Extensible Markup Language (*.xml)|*.xml'; if saveDialog.Execute then begin cFileName := SaveDialog.FileName; XMLExp.SaveToFile(cFileName); dlMessageDlg('Shranjeno v ' + cFileName, mtInformation, [mbOK], 0); end; finally saveDialog.Free; end; end; finally ds.Free; XMLExp.Free; end; end; end. acKeyanNoanSeqNoacHField2acHType anHLengthanHDecacPField2acPTypeanPLegthanPDec acPFormat acPSeparator anUserChg anUserIns adTimeChg adTimeIns acKeyanNoanSeqNo acFieldName2 anFieldSize acFieldTitleacFieldReadOnly acEditType acFieldConst anUserChg anUserIns adTimeIns adTimeChg acFieldFormatacFieldDefault acLookupSQL acKeyanNo acDataEventacDataReturnValue acKeyAndNo anUserChg anUserIns adTimeChg adTimeIns acKey acWhereKeyanNo acFieldName acParamVar acFieldType acFieldREQacFieldCaption2 acDefaultExpacDefaultValue acLookUpSQL acOperator acVarHint2 acAddApostrof anUserChg anUserIns adTimeChg adTimeIns acPrtCrit ACKEY ANVERSIONANNOACSQLEXPACNOTE ADTIMECHG ANUSERCHG ADTIMEINS ANUSERINSACREPORTACLANGIDACLOCALIZATION2 ACFORMNAMEdACNAMEdACDEFAULTPRINTER ACPREVIEWANMAXPRSTLEVELACSUBSTITUTESIGNACPRINTIFEMPTY ACPRINTTOTEXT ANNOOFCOPY ACORDERBY ACREGUSERCODEACACTIVE ACKEYSHORTCUT2 ANUSERINS ADTIMEINS ANUSERCHG ADTIMECHG ACTEXT1ACTEXT2ACTEXT3ACNOTE ACREPORTDATAacKey acUnitName acObjectName acTranslationacLocalisation