-
-
Notifications
You must be signed in to change notification settings - Fork 18
Class uOpenOffice_calc
Para o Delphi acima do 7, está classe é para o uso basico de interação com o Calc. Leitura e Escrita. esta classe herda de TOpenOffice, e se especializa para trabalhar com Calc.
procedure startSheet;
Inicia o serviço do libre office e a planilha.
procedure positionSheetByName(const aSheetName: string);
Se posiciona na aba da planilha pelo nome da aba passada por parametro
procedure addNewSheet(const aSheetName: string; aPosition: integer);
Adiciona uma nova aba para planilha, passando o nome da aba como parametro.
function setFormula(aCellNumber: integer; const aCollName: string; const aFormula: string): TOpenOffice_calc;
Define uma formula passando a coluna e linha e a formula para gravar
function SetValue(aCellNumber: integer; const aCollName: string; aValue: variant; TypeValue: TTypeValue = ftString; Wrapped: boolean = false): TOpenOffice_calc;
inclui o valor na planilha, passando os parâmetros, numero da linha, Nome da coluna, o Valor a ser gravado, o tipo do valor, se é numerico ou texto, para usar os gráficos deve-se forçar o valor como numérico, e se o valor vai ter quebra de linha(Wrapped).
function GetValue(aCellNumber: integer; const aCollName: String) : TOpenOffice_calc;
Busca o valor na célula da planilha, na aba que se está posicionado, passando por paramento o numero da linha e o nome da coluna.
procedure DataSetToSheet(const aCds : TClientDataSet);
Converte um Dataset para planilha. As fields do dataSet na propriedade DisplayName, serão o cabeçalho da planilha.
procedure CallConversorPDFTOSheet;
Ainda não implementado
function SheetToDataSet(const TabSheetName: String): TClientDataSet;
Converte a planilha em Dataset, converte apenas a aba atual, a primeira linha da planilha é considerada como o cabeçalho, e essa linha 0 até a ultima coluna com valor serão os fields do dataset.
procedure ExeThread(pProc : Tproc);
Executa alguma procedure via thread
Utilizar as funções após o setValue, pois o setValue, posiciona a célula.
procedure addChart(aSettingsChart: TSettingsChart);
Adiciona graficos utilizando o record TSettingsChart
function setBorder(borderPosition: TBoderSheet; opColor: TOpenColor; RemoveBorder: boolean = false) : TOpenOffice_calc;
Adiciona a borda na celula
function changeFont(aNameFont: string; aHeight: Integer): TOpenOffice_calc;
Altera a fonte, tanto o tipo quanto o tamanho.
function changeJustify(aTypeHori: THoriJustify; aTypeVert: TVertJustify) : TOpenOffice_calc;
Altera a justificativa do texto, alinhando na horizontal ou vertical.
function setColor(aFontColor, aBackgroud: TOpenColor): TOpenOffice_calc;
Modifica a cor da fonte e do fundo da celula.
function setCellWidth(const aWidth: integer): TOpenOffice_calc;
Altera a largura da celula.
function setBold(aBold: boolean): TOpenOffice_calc;
Define a fonte com Negrito.
function SetUnderline(aUnderline: boolean): TOpenOffice_calc;
Define a fonte com sublinhado.
function CountRow: Integer;
Contador de linhas. Pega apenas com valor, mesmo que haja intervalo de linhas em branco e com valor
function CountCell: Integer;
Contador de colunas, pega apenas com valor, mesmo que haja intervalo de colunas em branco e com valor.
For Delphi above 7, this class is for basic usage of interacting with Calc. Reading and writing. this class inherits from TOpenOffice, and is specialized to work with Calc.
procedure startSheet;
Starts the libre office service and spreadsheet.
procedure positionSheetByName(const aSheetName: string);
It is positioned on the worksheet tab by the name of the tab passed by parameter
procedure addNewSheet(const aSheetName: string; aPosition: integer);
Adds a new tab to the worksheet, passing the name of the tab as a parameter.
function setFormula(aCellNumber: integer; const aCollName: string; const aFormula: string): TOpenOffice_calc;
Define a formula passing the column and line and the formula to record
function SetValue(aCellNumber: integer; const aCollName: string; aValue: variant; TypeValue: TTypeValue = ftString; Wrapped: boolean = false): TOpenOffice_calc;
includes the value in the worksheet, passing the parameters, line number, column name, the value to be recorded, the value type, if it is numeric or text, to use the graphics you must force the value as numeric, and whether the value will have a line break (Wrapped).
function GetValue(aCellNumber: integer; const aCollName: String) : TOpenOffice_calc;
Searches the value in the worksheet cell, in the tab that is positioned, passing the line number and column name as a parameter.
procedure DataSetToSheet(const aCds : TClientDataSet);
Convert a Dataset to a spreadsheet. Like the fields of the dataSet in the DisplayName property, it will be the header of the worksheet.
procedure CallConversorPDFTOSheet;
Not implemented yet
function SheetToDataSet(const TabSheetName: String): TClientDataSet;
Convert the worksheet into a Dataset, convert only the current tab, the first row of the worksheet is considered as the header, and this row 0 to the last column with value will be the fields of the dataset.
procedure ExeThread(pProc : Tproc);
Execute some procedure via thread
Using the functions after the setValue, as the setValue, positions the cell.
procedure addChart(aSettingsChart: TSettingsChart);
Add charts using TSettingsChart registry
function setBorder(borderPosition: TBoderSheet; opColor: TOpenColor; RemoveBorder: boolean = false) : TOpenOffice_calc;
Add border to cell
function changeFont(aNameFont: string; aHeight: Integer): TOpenOffice_calc;
Change the font, both type and size.
function changeJustify(aTypeHori: THoriJustify; aTypeVert: TVertJustify): TOpenOffice_calc;
Changes the justification of the text, aligning it horizontally or vertically.
function setColor(aFontColor, aBackgroud: TOpenColor): TOpenOffice_calc;
Modify the font and background color of the cell.
function setCellWidth(const aWidth: integer): TOpenOffice_calc;
Changes the cell width.
function setBold(aBold: boolean): TOpenOffice_calc;
Sets the font to Bold.
function SetUnderline(aUnderline: boolean): TOpenOffice_calc;
Set font with underline.
function CountRow: Integer;
Line counter. Get only with value, even if there is a range of blank lines and with value
function CountCell: Integer;
Column counter, get only with value, even if there is a range of blank columns and with value.