Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ff69c908
Kaydet (Commit)
ff69c908
authored
Haz 05, 2003
tarafından
Duncan Foster
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added new JavaScript example script
üst
87afd2fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
exportsheetstohtml.js
...mples/javascript/ExportSheetsToHTML/exportsheetstohtml.js
+54
-0
parcel-descriptor.xml
...mples/javascript/ExportSheetsToHTML/parcel-descriptor.xml
+16
-0
No files found.
scripting/examples/javascript/ExportSheetsToHTML/exportsheetstohtml.js
0 → 100644
Dosyayı görüntüle @
ff69c908
importClass
(
Packages
.
com
.
sun
.
star
.
uno
.
UnoRuntime
);
importClass
(
Packages
.
com
.
sun
.
star
.
sheet
.
XSpreadsheetDocument
);
importClass
(
Packages
.
com
.
sun
.
star
.
container
.
XIndexAccess
);
importClass
(
Packages
.
com
.
sun
.
star
.
beans
.
XPropertySet
);
importClass
(
Packages
.
com
.
sun
.
star
.
beans
.
PropertyValue
);
importClass
(
Packages
.
com
.
sun
.
star
.
util
.
XModifiable
);
importClass
(
Packages
.
com
.
sun
.
star
.
frame
.
XStorable
);
importClass
(
Packages
.
com
.
sun
.
star
.
frame
.
XModel
);
importClass
(
Packages
.
com
.
sun
.
star
.
uno
.
AnyConverter
);
importClass
(
Packages
.
com
.
sun
.
star
.
uno
.
Type
);
importClass
(
java
.
lang
.
System
);
oDoc
=
XSCRIPTCONTEXT
.
getDocument
();
xSDoc
=
UnoRuntime
.
queryInterface
(
XSpreadsheetDocument
,
oDoc
);
xModel
=
UnoRuntime
.
queryInterface
(
XModel
,
oDoc
);
xSheetsIndexAccess
=
UnoRuntime
.
queryInterface
(
XIndexAccess
,
xSDoc
.
getSheets
());
xStorable
=
UnoRuntime
.
queryInterface
(
XStorable
,
xSDoc
);
xModifiable
=
UnoRuntime
.
queryInterface
(
XModifiable
,
xSDoc
);
storeProps
=
new
Array
;
//PropertyValue[1];
storeProps
[
0
]
=
new
PropertyValue
();
storeProps
[
0
].
Name
=
"FilterName"
;
storeProps
[
0
].
Value
=
"HTML (StarCalc)"
;
storeUrl
=
xModel
.
getURL
();
storeUrl
=
storeUrl
.
substring
(
0
,
storeUrl
.
lastIndexOf
(
'.'
));
//set only one sheet visible, and store to HTML doc
for
(
var
i
=
0
;
i
<
xSheetsIndexAccess
.
getCount
();
i
++
)
{
setAllButOneHidden
(
xSheetsIndexAccess
,
i
);
xModifiable
.
setModified
(
false
);
xStorable
.
storeToURL
(
storeUrl
+
"_sheet"
+
(
i
+
1
)
+
".html"
,
storeProps
);
}
// now set all visible again
for
(
var
i
=
0
;
i
<
xSheetsIndexAccess
.
getCount
();
i
++
)
{
xPropSet
=
AnyConverter
.
toObject
(
new
Type
(
XPropertySet
),
xSheetsIndexAccess
.
getByIndex
(
i
));
xPropSet
.
setPropertyValue
(
"IsVisible"
,
true
);
}
function
setAllButOneHidden
(
xSheetsIndexAccess
,
vis
)
{
//System.err.println("count="+xSheetsIndexAccess.getCount());
xPropSet
=
AnyConverter
.
toObject
(
new
Type
(
XPropertySet
),
xSheetsIndexAccess
.
getByIndex
(
vis
));
xPropSet
.
setPropertyValue
(
"IsVisible"
,
true
);
for
(
var
i
=
0
;
i
<
xSheetsIndexAccess
.
getCount
();
i
++
)
{
xPropSet
=
AnyConverter
.
toObject
(
new
Type
(
XPropertySet
),
xSheetsIndexAccess
.
getByIndex
(
i
));
if
(
i
!=
vis
)
{
xPropSet
.
setPropertyValue
(
"IsVisible"
,
false
);
}
}
}
scripting/examples/javascript/ExportSheetsToHTML/parcel-descriptor.xml
0 → 100755
Dosyayı görüntüle @
ff69c908
<?xml version="1.0" encoding="UTF-8"?>
<parcel
language=
"JavaScript"
xmlns:parcel=
"scripting.dtd"
>
<script
language=
"JavaScript"
>
<locale
lang=
"en"
>
<displayname
value=
"ExportSheetsToHTML"
/>
<description>
Saves each sheet in the current Calc document as a separate HTML file in the same directory as the original Calc document.
</description>
</locale>
<functionname
value=
"ExportSheetsToHTML.js"
/>
<logicalname
value=
"ExportSheetsToHTML.JavaScript"
/>
</script>
</parcel>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment