Précédent   Forum des professionnels en informatique > PHP > PHP & SGBD > PHP & Oracle
PHP & Oracle Forum d'entraide sur Oracle avec PHP. Avant de poster -> FAQ Oracle et Cours Oracle
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 03/05/2007, 11h36   #1
Invité de passage
 
Inscription : avril 2007
Messages : 3
Détails du profil
Informations forums :
Inscription : avril 2007
Messages : 3
Points : 1
Points : 1
Par défaut exportation oracle php vers Excel

je veut exportée les données de la base oracle vers un fichier Excel à travers PHP.
atef83 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/05/2007, 23h07   #2
Nouveau Membre du Club
 
Inscription : mai 2005
Messages : 40
Détails du profil
Informations personnelles :
Âge : 32
Localisation : France, Rhône (Rhône Alpes)

Informations forums :
Inscription : mai 2005
Messages : 40
Points : 36
Points : 36
Par défaut fichier excel

Je ne sais pas si le pb est le fait que se soit oracle ou qu'il faille créer un fichier excel.
Pour le fichier excel, voici un exemple
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 
//=============================================================
// Création du fichier Excel
//=============================================================
$date = date("YmdHis", mktime());
$filename = "./path/" . $logon_user . "_" . $date;
$sheetname = $logon_user . "_" . $date;
$fp = fopen($filename . ".xls", "a");
 
//--- un peu de xml pour la mise en page (orientation, figer les volets)
fwrite($fp, "
<html xmlns:o=\"urn:schemas-microsoft-com:office:office\"
xmlns:x=\"urn:schemas-microsoft-com:office:excel\"
xmlns=\"http://www.w3.org/TR/REC-html40\">
<head>
<meta http-equiv=Content-Type content=\"text/html; charset=windows-1252\">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content='" . $app_name . "'>
<style>
<!--table
	{mso-displayed-decimal-separator:\"\,\";
	mso-displayed-thousand-separator:\" \";}
@page
	{margin:.39in .39in .39in .39in;
	mso-header-margin:.39in;
	mso-footer-margin:.39in;
	mso-page-orientation:landscape;}
-->
</style>
<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>" . $sheetname . "</x:Name>
    <x:WorksheetOptions>
     <x:DefaultColWidth>10</x:DefaultColWidth>
     <x:Print>
      <x:ValidPrinterInfo/>
      <x:PaperSizeIndex>9</x:PaperSizeIndex>
      <x:HorizontalResolution>600</x:HorizontalResolution>
      <x:VerticalResolution>600</x:VerticalResolution>
     </x:Print>
     <x:Selected/>
     <x:DoNotDisplayGridlines/>
     <x:FreezePanes/>
     <x:FrozenNoSplit/>
     <x:SplitHorizontal>1</x:SplitHorizontal>
     <x:TopRowBottomPane>1</x:TopRowBottomPane>
     <x:SplitVertical>1</x:SplitVertical>
     <x:LeftColumnRightPane>1</x:LeftColumnRightPane>
     <x:ActivePane>0</x:ActivePane>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
  <x:WindowHeight>9780</x:WindowHeight>
  <x:WindowWidth>15240</x:WindowWidth>
  <x:WindowTopX>0</x:WindowTopX>
  <x:WindowTopY>1230</x:WindowTopY>
  <x:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
 </x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple>
   ");
//=============================================================
// Affichage de la table
//=============================================================
<table>......
</table>
//=============================================================
// Ouverture du fichier Excel
//=============================================================
echo "<script>$n";
echo "  window.open('http:" . $filename . ".xls','','left=0,top=0,width=screen.width,height=screen.height,resizable,scrollbars=1,menubar=1,toolbar=1,location=0,status=0');$n";
echo "  history.back();$n";
echo "</script>$n";
deruyter est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/05/2007, 10h59   #3
Membre habitué
 
Avatar de scorpking
 
Inscription : avril 2006
Messages : 207
Détails du profil
Informations personnelles :
Âge : 25

Informations forums :
Inscription : avril 2006
Messages : 207
Points : 113
Points : 113
heu je n'ai pas compris si tu veux creerune base exel a partir d'une base oracle ou alor exporter sous forme de tableau exel les reponses à ta requete (méthode de deruy si j'ai bien compris son source)
scorpking est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 02h57.


 
 
 
 
Partenaires

Hébergement Web