|  | 
| StringGriddeki Verilerin Html Formatına Çevrilmesi | 
| Yanıt Yaz   | 
| Yazar | |
| turknetyazilim   Üye Profili Özel Mesaj Yolla Bu kullanıcıya ait mesajları bul Üyenin Web Sitesie Git Arkadaş Listeme Ekle Moderator Group     Kayıt Tarihi: 18.Ocak.2008 Bulundugu Yer: Balıkesir Online: Sitede Değil Gönderilenler: 214 |  Alıntı  Cevapla  Konu: StringGriddeki Verilerin Html Formatına Çevrilmesi Gönderim Zamanı: 07.Kasim.2008 Saat 11:37 | 
| StringGriddeki Verilerin Html Formatına Çevrilmesi { The SGridToHtml() function converts a Stringgrid to a HTML Code.    Parameters: SG: TStringGrid to convert                Dest: TMemo to show the HTML Code                BorderSize: Size of border (0 = show no border)  {    Mit der Funktion SGridToHtml() können StringGrids in HTML Code umgewandelt werden.    SG bezieht sich auf das TStringGrid, welches codiert werden soll.    in Dest (vom Typ TMemo) wird der HTML Code erzeugt.    BorderSize bestimmt, wie dick der Tabellenrahmen sein soll. 0 = kein Rahmen  }  procedure SGridToHtml(SG: TStringgrid; Dest: TMemo; BorderSize: Integer);  var     i, p: integer;    SStyle1, SStyle2, Text: string;  begin    Dest.Clear;    Dest.Lines.Add('<html>');    Dest.Lines.Add('<body>');    Dest.Lines.Add('  <table border="' + IntToStr(BorderSize) + '" width="' +      IntToStr(SG.Width) + '" height="' + IntToStr(SG.Width) + '">');    for i := 0 to SG.RowCount - 1 do    begin      Dest.Lines.Add('  <tr>');      for p := 0 to SG.ColCount - 1 do      begin        SStyle1 := '';        SStyle2 := '';        if fsbold in SG.Font.Style then        begin          SStyle1 := SStyle1 + '<b>';          SStyle2 := SStyle2 + '</b>';        end;        if fsitalic in SG.Font.Style then        begin          SStyle1 := SStyle1 + '<i>';          SStyle2 := SStyle2 + '</i>';        end;        if fsunderline in SG.Font.Style then        begin          SStyle1 := SStyle1 + '<u>';          SStyle2 := SStyle2 + '</u>';        end;        Text := sg.Cells[p, i];        if Text = '' then Text := ' ';        Dest.Lines.Add('    <td width="' + IntToStr(sg.ColWidths[p]) +          '" height="' + IntToStr(sg.RowHeights[p]) +          '"><font color="#' + IntToHex(sg.Font.Color, 6) +          '" face="' + SG.Font.Name + '">' + SStyle1 +          Text + SStyle2 + '</font></td>');      end;      Dest.Lines.Add('  </tr>');    end;    Dest.Lines.Add('  </table>');    Dest.Lines.Add('</body>');;    Dest.Lines.Add('</html>');  end;  // Example, Beispiel  procedure TFormCSVInport.Button6Click(Sender: TObject);  begin    SGridToHtml(StringGrid1, Memo1, 1);    Memo1.Lines.SaveToFile('c:\test.html');  end; Not : Alıntıdır. | |
|  | |
| Yanıt Yaz   | 
| Forum Atla | Forum İzinleri   Kapalı Foruma Yeni Konu Gönderme Kapalı Forumdaki Konulara Cevap Yazma Kapalı Forumda Cevapları Silme Kapalı Forumdaki Cevapları Düzenleme Kapalı Forumda Anket Açma Kapalı Forumda Anketlerde Oy Kullanma |