모둔분들 건강 하시죠. 이젠 정말 겨울이 올려나봐요.
제가 DBGRID에서 MEMO 필드를 표시하려고 하는데 아무리 해도 MEMO라는 메세지만 나오고
실제 데이타는 칼럼에 나타나지 않더군요.
알고 계신분 정말 부탁 드려요.
참고로 전 델파이3을 쓰고요 DB는 SQL Server6.5입니다.
글구 어디에서 자료를 구해서 보니깐 다음과 같이 하면 된다는데 아무런 효과가 없네요
아~~(억창 무너지는 소리)
-------------------------------------
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
var
P : array [0..50] of char; {array size is number of characters needed}
BS : tBlobStream; {from the memo field}
S : String;
begin
If Field is TMemoField then begin
with (Sender as TDBGrid).Canvas do
begin
{Table1Notes is the TMemoField}
BS := tBlobStream.Create(StudInfoDiary, bmRead);
{StudInfoDiary는 TTable에 있는 memo형식의 필드명입니다.}
FillChar(P,SizeOf(P),#0); {terminate the null string}
BS.Read(P, 50); {read 50 chars from memo into blobStream}
BS.Free;
S := StrPas(P);
while Pos(#13, S) > 0 do {remove carriage returns and}
S[Pos(#13, S)] := ' '; {line feeds}
While Pos(#10, S) > 0 do
S[Pos(#10, S)] := ' ';
FillRect(Rect); {clear the cell}
TextOut(Rect.Left, Rect.Top, S); {fill cell with memo data}
end;
end;
end;
--------------------------------
메모뿐 아니라 그림까지 나오는....
XPower라는 컴포넌트를 사용하세요.... 상용이지만 그만한 값어치는 있습니다.
곧 가격을 올릴예정이라고 하는군요...
나이렉스 아시죠? (http://www.nliex.net)
그곳에 있습니다.
대열입니다 wrote:
> 모둔분들 건강 하시죠. 이젠 정말 겨울이 올려나봐요.
>
> 제가 DBGRID에서 MEMO 필드를 표시하려고 하는데 아무리 해도 MEMO라는 메세지만 나오고
> 실제 데이타는 칼럼에 나타나지 않더군요.
> 알고 계신분 정말 부탁 드려요.
>
> 참고로 전 델파이3을 쓰고요 DB는 SQL Server6.5입니다.
> 글구 어디에서 자료를 구해서 보니깐 다음과 같이 하면 된다는데 아무런 효과가 없네요
> 아~~(억창 무너지는 소리)
>
> -------------------------------------
> procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
> Field: TField; State: TGridDrawState);
>
>
> var
> P : array [0..50] of char; {array size is number of characters needed}
> BS : tBlobStream; {from the memo field}
> S : String;
> begin
> If Field is TMemoField then begin
> with (Sender as TDBGrid).Canvas do
> begin
> {Table1Notes is the TMemoField}
> BS := tBlobStream.Create(StudInfoDiary, bmRead);
> {StudInfoDiary는 TTable에 있는 memo형식의 필드명입니다.}
> FillChar(P,SizeOf(P),#0); {terminate the null string}
> BS.Read(P, 50); {read 50 chars from memo into blobStream}
> BS.Free;
> S := StrPas(P);
> while Pos(#13, S) > 0 do {remove carriage returns and}
> S[Pos(#13, S)] := ' '; {line feeds}
> While Pos(#10, S) > 0 do
> S[Pos(#10, S)] := ' ';
> FillRect(Rect); {clear the cell}
> TextOut(Rect.Left, Rect.Top, S); {fill cell with memo data}
> end;
> end;
> end;
> --------------------------------
>