Search  
Friday, November 15, 2019 ..:: Forum ::.. Register  Login
 Forum Minimize
Pentru a putea posta mesaje trebuie să vă înregistraţi.
Notă: Mesajele cu conţinut jignitor sau ilegal (inclusiv cereri de soft piratat) nu sunt acceptate şi vor fi şterse imediat .

Pentru a primi raspunsuri rapide si corecte, scrieti in mesaj ce intentionati sa faceti, ce mesaj de eroare primiti, in ce context si in urma caror actiuni. De asemenea, mentionati versiunea de FoxPro in care lucrati!
Dacă nu specificați versiunea, se consideră VFP 9.0 SP2.

SearchForum Home
  Visual FoxPro  Baze de date, tabele, view-uri si indecsi  import in Excel...
 import in Excel (sau OpenOffice) din Vfp
 
 4/23/2012 2:36:49 PM
User is offlineovi_anghel
15 posts


import in Excel (sau OpenOffice) din Vfp
 (N/A)
Buna ziua!
Va rog sa-mi spuneti, daca se poate , cum import in Excel o baza de date (sau tabela) creata in Visual Foxpro, pe un format prestabilit, care sa se pastreze luna de luna, doar continutul celulelor sa fie actualizat cu datele din baza de date.
Am incercat deschidere din Excel, direct cu Open din meniul File, a fisierului din VFP, dar de fiecare data trebuie sa umblu la formatarea celulelor, la denumiri cap tabel, fonturi, formule, etc. Ma gandesc ca poate exista o metoda prin care sa ramana fix formatul prestabilit (inclusiv formulele atasate coloanelor) si sa-l populez doar cu datele din VFP. Multumesc anticipat .

ovi_anghel
 8/6/2012 5:43:58 PM
User is offlineSilviu
211 posts
4th


Re: import in Excel (sau OpenOffice) din Vfp
 (N/A)
******************Fac XLS*****************************
v_titlu="c:\AUSTRIA_"+STRTRAN(DTOC(a_data),"/","_")+".xls"
EXPORT TO &v_titlu TYPE XLS FIELDS produs,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20,m21,totalm
exl=CREATEOBJECT("excel.application")
exl.workbooks.open('&v_titlu')
exl.visible=.T.
EXL.activesheet.name="Livrare - "+STRTRAN(DTOC(a_data),"/","_")
EXL.activesheet.tab.color=RGB(255,0,0)

ox=exl.ActiveSheet

***latimea coloanelor
ox.Columns("a:a").ColumnWidth=32
ox.Columns("b:b").ColumnWidth=5
ox.Columns("c:c").ColumnWidth=5
ox.Columns("d:d").ColumnWidth=5
ox.Columns("e:e").ColumnWidth=5
ox.Columns("f:f").ColumnWidth=5
ox.Columns("g:g").ColumnWidth=5
ox.Columns("h:h").ColumnWidth=5
ox.Columns("i:i").ColumnWidth=5
ox.Columns("j:j").ColumnWidth=5
ox.Columns("k:k").ColumnWidth=5
ox.Columns("l:l").ColumnWidth=5
ox.Columns("m:m").ColumnWidth=5
ox.Columns("n:n").ColumnWidth=7
ox.Columns("a:a").HorizontalAlignment=3
ox.Columns("n:n").Font.Bold ='True'
******headerul
ox.Range("A1:N1").FONT.color=RGB(0,0,0)
ox.Range("A1:N1").Font.Bold ='True'
ox.Range("A1:N1").FONT.size=10
ox.Range("A1:N1").borders.LineStyle=1
ox.Range("A1:N1").interior.colorindex=35
ox.Range("A1:I1").font.Name = "Courier New"

ox.Range("A1:N1").HorizontalAlignment=3

exl.cells(1,1).Value="Artikelbezechnung"
exl.cells(1,2).Value="10"
exl.cells(1,3).Value="11"
exl.cells(1,4).Value="12"
exl.cells(1,5).Value="13"
exl.cells(1,6).Value="14"
exl.cells(1,7).Value="15"
exl.cells(1,8).Value="16"
exl.cells(1,9).Value="17"
exl.cells(1,10).Value="18"
exl.cells(1,11).Value="19"
exl.cells(1,12).Value="20"
exl.cells(1,13).Value="21"
exl.cells(1,14).Value="TOTAL"
ox.rows(1).Insert(.t.)
exl.cells(1,2).Value="GM"
exl.cells(1,3).Value="GM"
exl.cells(1,4).Value="GM"
exl.cells(1,5).Value="GM"
exl.cells(1,6).Value="GM"
exl.cells(1,7).Value="GM"
exl.cells(1,8).Value="GM"
exl.cells(1,9).Value="GM"
exl.cells(1,10).Value="GM"
exl.cells(1,11).Value="GM"
exl.cells(1,12).Value="GM"
exl.cells(1,13).Value="GM"
ox.Range("A1:N1").HorizontalAlignment=3
*** aflu ultima celula si fac liniatura
lcLastCell=exl.ActiveCell.SpecialCells(11).Address()
lcLastCol=STREXTRACT(lclastCell,'$','$',1)
lcLastRow=STREXTRACT(lclastCell,'$','$',2,2)

rand_tot=VAL(lcLastRow)+1
exl.cells(rand_tot,1).value="TOTAL"
exl.cells(rand_tot,1).Font.Bold ='True'
exl.cells(rand_tot,2).value=ALLTRIM(STR(tm10,15))
exl.cells(rand_tot,2).Font.Bold ='True'
exl.cells(rand_tot,3).value=ALLTRIM(STR(tm11,15))
exl.cells(rand_tot,3).Font.Bold ='True'
exl.cells(rand_tot,4).value=ALLTRIM(STR(tm12,15))
exl.cells(rand_tot,4).Font.Bold ='True'
exl.cells(rand_tot,5).value=ALLTRIM(STR(tm13,15))
exl.cells(rand_tot,5).Font.Bold ='True'
exl.cells(rand_tot,6).value=ALLTRIM(STR(tm14,15))
exl.cells(rand_tot,6).Font.Bold ='True'
exl.cells(rand_tot,7).value=ALLTRIM(STR(tm15,15))
exl.cells(rand_tot,7).Font.Bold ='True'
exl.cells(rand_tot,8).value=ALLTRIM(STR(tm16,15))
exl.cells(rand_tot,8).Font.Bold ='True'
exl.cells(rand_tot,9).value=ALLTRIM(STR(tm17,15))
exl.cells(rand_tot,9).Font.Bold ='True'
exl.cells(rand_tot,10).value=ALLTRIM(STR(tm18,15))
exl.cells(rand_tot,10).Font.Bold ='True'
exl.cells(rand_tot,11).value=ALLTRIM(STR(tm19,15))
exl.cells(rand_tot,11).Font.Bold ='True'
exl.cells(rand_tot,12).value=ALLTRIM(STR(tm20,15))
exl.cells(rand_tot,12).Font.Bold ='True'
exl.cells(rand_tot,13).value=ALLTRIM(STR(tm21,15))
exl.cells(rand_tot,13).Font.Bold ='True'
exl.cells(rand_tot,14).value=ALLTRIM(STR(ttotalm,15))
exl.cells(rand_tot,14).Font.Bold ='True'
lcLastCell=exl.ActiveCell.SpecialCells(11).Address()
ox.Range('A2',lcLastCell).borders.LineStyle=1

ox.rows(1).Insert(.t.)
ox.rows(1).Insert(.t.)
ox.rows(1).Insert(.t.)
ox.rows(1).Insert(.t.)

exl.cells(1,1).Value="Incarcare "+DTOC(a_data)
exl.cells(1,1).font.bold='TRUE'
exl.cells(1,1).HorizontalAlignment=3
ox.PageSetup.PaperSize=1
******************************************************

Faci export la tabelul tau in XLS si apoi formatezi XLS-UL. Formule nu am pus (inca)
  Visual FoxPro  Baze de date, tabele, view-uri si indecsi  import in Excel...

Search  Forum Home         

 Google Ads Minimize

    

Copyright 2002-2013 Profox   Terms Of Use  Privacy Statement