Erro de conversão - Incompatible types: string and System.TArray<System.Byte>
06/02/2013
0
Uso delphi XE2
Tenha a função
Obtenho os seguintes erros ao compilar
[DCC Error] Relatorio.pas(122): E2010 Incompatible types: 'string' and 'System.TArray<System.Byte>'
[DCC Error] Relatorio.pas(138): E2250 There is no overloaded version of 'Format' that can be called with these arguments
[DCC Error] Relatorio.pas(140): E2010 Incompatible types: 'System.TArray<System.Byte>' and 'string'
Dois erros são a mesma coisa é este erro de conversão
ou é esta função FORMAT
Desde já agradeço a ajuda de vocês
Tenha a função
function TFormRelatorio.DBGridToHtmlTable(mDBGrid: TDBGrid; mStrings: TStrings; mCaption: TCaption): Boolean; const cAlignText: array[TAlignment] of string = ('LEFT', 'RIGHT', 'CENTER'); var vColFormat: string; vColText: string; vAllWidth: Integer; vWidths: array of Integer; vBookmark: string; I, J: Integer; begin Result := False; if not Assigned(mStrings) then Exit; if not Assigned(mDBGrid) then Exit; if not Assigned(mDBGrid.DataSource) then Exit; if not Assigned(mDBGrid.DataSource.DataSet) then Exit; if not mDBGrid.DataSource.DataSet.Active then Exit; vBookmark := mDBGrid.DataSource.DataSet.Bookmark; // Esta Linha dá erro 1 mDBGrid.DataSource.DataSet.DisableControls; try J := 0; vAllWidth := 0; for I := 0 to mDBGrid.Columns.Count - 1 do if mDBGrid.Columns[I].Visible then begin Inc(J); SetLength(vWidths, J); vWidths[J - 1] := mDBGrid.Columns[I].Width; Inc(vAllWidth, mDBGrid.Columns[I].Width); end; if J <= 0 then Exit; mStrings.Clear; // mStrings.Add(''); mStrings.Add(Format('')); // Esta Linha dá erro 2 este erro é mais tranquilo nunca usei esta função Format ainda finally mDBGrid.DataSource.DataSet.Bookmark := vBookmark; // Esta Linha dá erro 1 mesmo lá de cima mDBGrid.DataSource.DataSet.EnableControls; vWidths := nil; end; Result := True; end;
Obtenho os seguintes erros ao compilar
[DCC Error] Relatorio.pas(122): E2010 Incompatible types: 'string' and 'System.TArray<System.Byte>'
[DCC Error] Relatorio.pas(138): E2250 There is no overloaded version of 'Format' that can be called with these arguments
[DCC Error] Relatorio.pas(140): E2010 Incompatible types: 'System.TArray<System.Byte>' and 'string'
Dois erros são a mesma coisa é este erro de conversão
ou é esta função FORMAT
Desde já agradeço a ajuda de vocês
Ewerton Rodrigues
Curtir tópico
+ 0
Responder
Post mais votado
15/07/2014
Vamos postar a solução aí!! Ajuda quem tem o mesmo problema.
Carlos Junior
Responder
Mais Posts
07/02/2013
Bruno Leandro
tenta usar o recno ao inves de bookmark, o recno é integer e representa o indice do registro.
Responder
07/02/2013
Ewerton Rodrigues
Eu conseguir fazer com outra função melhor pois usei melhor os elementos html na outra valeu.
Responder
Clique aqui para fazer login e interagir na Comunidade :)