-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Write support for Excel's SpreadsheetML format -- -- Output XML in the SpreadsheetML namespace. This allows you to generate -- XLS file for excel. Binary compressed Office Open Document format not -- yet supported, but you can take this xml output and name it -- .xls and Excel will be able to open the document as a -- spreadsheet. @package SpreadsheetML @version 0.1 module Text.XML.SpreadsheetML.Types -- | Only implement what we need data Workbook Workbook :: Maybe DocumentProperties -> [Worksheet] -> Workbook workbookDocumentProperties :: Workbook -> Maybe DocumentProperties workbookWorksheets :: Workbook -> [Worksheet] data DocumentProperties DocumentProperties :: Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Word64 -> Maybe String -> Maybe String -> DocumentProperties documentPropertiesTitle :: DocumentProperties -> Maybe String documentPropertiesSubject :: DocumentProperties -> Maybe String documentPropertiesKeywords :: DocumentProperties -> Maybe String documentPropertiesDescription :: DocumentProperties -> Maybe String documentPropertiesRevision :: DocumentProperties -> Maybe Word64 documentPropertiesAppName :: DocumentProperties -> Maybe String -- | Actually, this should be a date time documentPropertiesCreated :: DocumentProperties -> Maybe String data Worksheet Worksheet :: Maybe Table -> Name -> Worksheet worksheetTable :: Worksheet -> Maybe Table worksheetName :: Worksheet -> Name data Table Table :: [Column] -> [Row] -> Maybe Double -> Maybe Double -> Maybe Word64 -> Maybe Word64 -> Maybe Word64 -> Maybe Word64 -> Maybe Bool -> Maybe Bool -> Table tableColumns :: Table -> [Column] tableRows :: Table -> [Row] -- | Default is 48 tableDefaultColumnWidth :: Table -> Maybe Double -- | Default is 12.75 tableDefaultRowHeight :: Table -> Maybe Double tableExpandedColumnCount :: Table -> Maybe Word64 tableExpandedRowCount :: Table -> Maybe Word64 -- | Default is 1 tableLeftCell :: Table -> Maybe Word64 -- | Default is 1 tableTopCell :: Table -> Maybe Word64 tableFullColumns :: Table -> Maybe Bool tableFullRows :: Table -> Maybe Bool data Column Column :: Maybe Caption -> Maybe AutoFitWidth -> Maybe Hidden -> Maybe Word64 -> Maybe Word64 -> Maybe Double -> Column columnCaption :: Column -> Maybe Caption columnAutoFitWidth :: Column -> Maybe AutoFitWidth columnHidden :: Column -> Maybe Hidden columnIndex :: Column -> Maybe Word64 columnSpan :: Column -> Maybe Word64 columnWidth :: Column -> Maybe Double data Row Row :: [Cell] -> Maybe Caption -> Maybe AutoFitHeight -> Maybe Double -> Maybe Hidden -> Maybe Word64 -> Maybe Word64 -> Row rowCells :: Row -> [Cell] rowCaption :: Row -> Maybe Caption rowAutoFitHeight :: Row -> Maybe AutoFitHeight rowHeight :: Row -> Maybe Double rowHidden :: Row -> Maybe Hidden rowIndex :: Row -> Maybe Word64 rowSpan :: Row -> Maybe Word64 data Cell Cell :: Maybe ExcelValue -> Maybe Formula -> Maybe Word64 -> Maybe Word64 -> Maybe Word64 -> Cell cellData :: Cell -> Maybe ExcelValue cellFormula :: Cell -> Maybe Formula cellIndex :: Cell -> Maybe Word64 cellMergeAcross :: Cell -> Maybe Word64 cellMergeDown :: Cell -> Maybe Word64 data ExcelValue Number :: Double -> ExcelValue Boolean :: Bool -> ExcelValue StringType :: String -> ExcelValue -- | TODO: Currently just a string, but we could model excel formulas and -- use that type here instead. newtype Formula Formula :: String -> Formula data AutoFitWidth AutoFitWidth :: AutoFitWidth DoNotAutoFitWidth :: AutoFitWidth data AutoFitHeight AutoFitHeight :: AutoFitHeight DoNotAutoFitHeight :: AutoFitHeight -- | Attribute for hidden things data Hidden Shown :: Hidden Hidden :: Hidden -- | For now this is just a string, but we could model excel's names newtype Name Name :: String -> Name newtype Caption Caption :: String -> Caption instance Read DocumentProperties instance Show DocumentProperties instance Read ExcelValue instance Show ExcelValue instance Read Formula instance Show Formula instance Read Cell instance Show Cell instance Read AutoFitWidth instance Show AutoFitWidth instance Read AutoFitHeight instance Show AutoFitHeight instance Read Hidden instance Show Hidden instance Read Name instance Show Name instance Read Caption instance Show Caption instance Read Row instance Show Row instance Read Column instance Show Column instance Read Table instance Show Table instance Read Worksheet instance Show Worksheet instance Read Workbook instance Show Workbook module Text.XML.SpreadsheetML.Writer -- | Convert a workbook to a string. Write this string to a .xls -- file and Excel will know how to open it. showSpreadsheet :: Workbook -> String -- | Namespaces namespace :: QName oNamespace :: QName xNamespace :: QName ssNamespace :: QName htmlNamespace :: QName -- | Empty Elements emptyWorkbook :: Element emptyDocumentProperties :: Element emptyWorksheet :: Name -> Element emptyTable :: Element emptyRow :: Element emptyColumn :: Element emptyCell :: Element mkData :: ExcelValue -> Element -- | XML Conversion Class class ToElement a toElement :: ToElement a => a -> Element showBoolean :: Bool -> [Char] showCaption :: Caption -> String showHidden :: Hidden -> String instance ToElement ExcelValue instance ToElement Cell instance ToElement Column instance ToElement Row instance ToElement Table instance ToElement Worksheet instance ToElement DocumentProperties instance ToElement Workbook module Text.XML.SpreadsheetML.Builder -- | Construct empty values emptyWorkbook :: Workbook emptyDocumentProperties :: DocumentProperties emptyWorksheet :: Name -> Worksheet emptyTable :: Table emptyColumn :: Column emptyRow :: Row emptyCell :: Cell -- | Convenience constructors number :: Double -> Cell string :: String -> Cell bool :: Bool -> Cell -- | This function may change in future versions, if a real formula type is -- created. formula :: String -> Cell mkWorkbook :: [Worksheet] -> Workbook mkWorksheet :: Name -> Table -> Worksheet mkTable :: [Row] -> Table mkRow :: [Cell] -> Row -- | Most of the time this is the easiest way to make a table tableFromCells :: [[Cell]] -> Table