Prikazi cijelu temu 02.11.2010 09:56
miro35 Van mreze
Clan
Registrovan od:05.01.2009
Lokacija:-


Predmet:Re: Fiskalizacija u FBiH
Konkretno može li se napravit i kako xml funkcija za ovaj xml fajl,ali da podatke uzima iz neke tabele ili querija preko recordset-a.Ja sam uspio nešto dobit.Ovako treba da izgleda xml fajl za Tremol printer:
Primjer 1:
<TremolFpServer Command="Receipt" Description="*** DEMO RAČUN ***">
<Item Code="1" Quantity="1.905" Discount="2.5%" />
<Item Code="2" Quantity="2.98" Surcharge="1%" />
<Payment Type="Virman" Amount="1" />
<Payment Type="Gotovina" Amount="100.95" />
<AdditionalLine Message="Linija sa proizvoljnim tekstom 1" />
<AdditionalLine Message="Linija sa proizvoljnim tekstom 2" />
</TremolFpServer>
Primjer 2:
<TremolFpServer Command="Receipt" Description="*** DEMO RAČUN ***">
<Item Description="Test new item" Quantity="4" Price="2.95" VatInfo="1" Department="4" UnitName="kg" />
<Payment Type="Virman" Amount="1" />
<Payment Type="Gotovina" Amount="100.95" />
<AdditionalLine Message="Linija sa proizvoljnim tekstom 1" />
<AdditionalLine Message="Linija sa proizvoljnim tekstom 2" />
</TremolFpServer>
Ovo sam dobio ja:
<TremolFpServer Command="Receipt" Description="*** DEMO RAČUN ***">
<Item>Description=" AMAY TUÅ  GEL"</Item>
<Payment Type="Virman" Amount="1"/>
<Item>Description="ŽVAKE,LIZE OD1"</Item>
<Payment Type="Virman" Amount="1"/>
<Item>Description="ŽVAKE,LIZE OD1"</Item>
<Payment Type="Virman" Amount="1"/>
<Item>Description="ŽVAKE,LIZE OD1"</Item>
<Payment Type="Virman" Amount="1"/>
<Item>Description="ŽVAKE,LIZE OD1"</Item>
<Payment Type="Virman" Amount="1"/>
<Item>Description="ŽVAKE,LIZE OD1"</Item>
<Payment Type="Virman" Amount="1"/>
</TremolFpServer>
Ovo je moj code koji sam započeo:
PreuzmiIzvorni kôd (Text):
  1. Dim RS2
  2. Dim Db As Database
  3. Set Tekst = New Stream
  4. Tekst.Open
  5. Tekst.Position = 0
  6. Tekst.Charset = "UTF-8"
  7. Tekst.WriteText "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
  8. Tekst.WriteText "<TremolFpServer Command=""Receipt"" Description=""*** DEMO RA UN ***"">" & vbCrLf
  9.  
  10. Set Db = CurrentDb()
  11. Set RS2 = Db.OpenRecordset("SELECT * FROM qryIZLAZMP", dbOpenDynaset)
  12.     Do While Not RS2.EOF
  13. 'Tekst.WriteText "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
  14. 'Tekst = "<Item Description>" & RS2!ArtNaz & "</Item Description>"
  15.  'Tekst.WriteText "<" & "Item" & ">" & "Description" & "=" & RS2!ArtNaz & "</" & "Item" & ">" & vbCrLf
  16. Tekst.WriteText "<" & "Item" & ">" & "Description" & "=" & RS2!ArtNaz1 & "</" & "Item" & ">" & vbCrLf
  17. RS2.MoveNext
  18. Tekst.WriteText "<Payment Type=""Virman"" Amount=""1""/>" & vbCrLf
  19. 'Tekst.WriteText "<Payment Type=""Gotovina"" Amount=""100.95""/>" & vbCrLf
  20. 'Tekst.WriteText "<AdditionalLine Message=""Linija sa proizvoljnim tekstom 1""/>" & vbCrLf
  21. 'Tekst.WriteText "<AdditionalLine Message=""Linija sa proizvoljnim tekstom 2""/>" & vbCrLf
  22. 'Tekst.WriteText "</Item Description>" & vbCrLf
  23.  
  24.  
  25.     Loop
  26.    
  27.       RS2.Close
  28.     Tekst.WriteText "</TremolFpServer>" & vbCrLf
  29.      
  30.  
  31.    
  32.     Set Db = Nothing
  33. Tekst.SaveToFile "C:\Prodaja\Miro.xml", adSaveCreateOverWrite
  34.  Tekst.Close

Miro