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):Dim RS2
Dim Db As Database
Set Tekst = New Stream
Tekst.Open
Tekst.Position = 0
Tekst.Charset = "UTF-8"
Tekst.WriteText "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
Tekst.WriteText "<TremolFpServer Command=""Receipt"" Description=""*** DEMO RAUN ***"">" & vbCrLf
Set Db = CurrentDb()
Set RS2 = Db.OpenRecordset("SELECT * FROM qryIZLAZMP", dbOpenDynaset)
Do While Not RS2.EOF
'Tekst.WriteText "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
'Tekst = "<Item Description>" & RS2!ArtNaz & "</Item Description>"
'Tekst.WriteText "<" & "Item" & ">" & "Description" & "=" & RS2!ArtNaz & "</" & "Item" & ">" & vbCrLf
Tekst.WriteText "<" & "Item" & ">" & "Description" & "=" & RS2!ArtNaz1 & "</" & "Item" & ">" & vbCrLf
RS2.MoveNext
Tekst.WriteText "<Payment Type=""Virman"" Amount=""1""/>" & vbCrLf
'Tekst.WriteText "<Payment Type=""Gotovina"" Amount=""100.95""/>" & vbCrLf
'Tekst.WriteText "<AdditionalLine Message=""Linija sa proizvoljnim tekstom 1""/>" & vbCrLf
'Tekst.WriteText "<AdditionalLine Message=""Linija sa proizvoljnim tekstom 2""/>" & vbCrLf
'Tekst.WriteText "</Item Description>" & vbCrLf
Loop
RS2.Close
Tekst.WriteText "</TremolFpServer>" & vbCrLf
Set Db = Nothing
Tekst.SaveToFile "C:\Prodaja\Miro.xml", adSaveCreateOverWrite
Tekst.Close
Miro