نمایش نتایج 1 تا 4 از 4

نام تاپیک: کامپوننت کار با Excel

  1. #1

    Tick کامپوننت کار با Excel

    سلام
    یه کامپوننت می خوام که بتونم اطلاعات رو از یه
    جدول یا یهQuery و یا یهDBGridداخل excel ببرم
    خودم چندتا دارم اما مال دلفی 5و6 هستش
    برای دلفی 7 می خوام
    ممنون

  2. #2
    کاربر دائمی آواتار اَرژنگ
    تاریخ عضویت
    آبان 1384
    محل زندگی
    arjang8000@gmail.com
    پست
    2,736
    اگر سورس کمپوننت‌ها را دارید در دلفی ۷ ریکمپیلش کنید.
    دلفی ۷ خودش کتمقداری کمپوننت برایه کار با کسل داره.

  3. #3
    function Xls_To_StringGrid(AGrid: TStringGrid; AXLSFile: string): Boolean;
    const
    xlCellTypeLastCell = $0000000B;
    var
    XLApp, Sheet: OLEVariant;
    RangeMatrix: Variant;
    x, y, k, r: Integer;
    begin
    Result := False;
    // Create Excel-OLE Object
    XLApp := CreateOleObject('Excel.Application');
    try
    // Hide Excel
    XLApp.Visible := False;
    // Open the Workbook
    XLApp.Workbooks.Open(AXLSFile);
    // Sheet := XLApp.Workbooks[1].WorkSheets[1];
    Sheet := XLApp.Workbooks[ExtractFileName(AXLSFile)].WorkSheets[1];
    // In order to know the dimension of the WorkSheet, i.e the number of rows
    // and the number of columns, we activate the last non-empty cell of it
    Sheet.Cells.SpecialCells(xlCellTypeLastCell, EmptyParam).Activate;
    // Get the value of the last row
    x := XLApp.ActiveCell.Row;
    // Get the value of the last column
    y := XLApp.ActiveCell.Column;
    // Set Stringgrid's row &col dimensions.
    AGrid.RowCount := x;
    AGrid.ColCount := y;
    // Assign the Variant associated with the WorkSheet to the Delphi Variant
    RangeMatrix := XLApp.Range['A1', XLApp.Cells.Item[X, Y]].Value;
    // Define the loop for filling in the TStringGrid
    k := 1;
    repeat
    for r := 1 to y do
    AGrid.Cells[(r - 1), (k - 1)] := RangeMatrix[K, R];
    Inc(k, 1);
    AGrid.RowCount := k + 1;
    until k > x;
    // Unassign the Delphi Variant Matrix
    RangeMatrix := Unassigned;
    finally
    // Quit Excel
    if not VarIsEmpty(XLApp) then
    begin
    // XLApp.DisplayAlerts := False;
    XLApp.Quit;
    XLAPP := Unassigned;
    Sheet := Unassigned;
    Result := True;
    end;
    end;
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    if Xls_To_StringGrid(StringGrid1, 'C:\Table1.xls') then
    ShowMessage('Table has been exported!');
    end;

  4. #4
    کاربر دائمی آواتار hamide_kh
    تاریخ عضویت
    مرداد 1386
    محل زندگی
    روبروی مانیتور
    پست
    202
    سلام
    یه کامپوننت به اسم SMExport_Suite هست که خیلی عالیه و کارمن را که خیلی راه انداخت

تاپیک های مشابه

  1. خواندن رکوردهای فایل excel
    نوشته شده توسط mahboob در بخش بانک های اطلاعاتی در Delphi
    پاسخ: 10
    آخرین پست: یک شنبه 15 دی 1387, 15:37 عصر
  2. excel
    نوشته شده توسط shahzamanian در بخش C#‎‎
    پاسخ: 2
    آخرین پست: سه شنبه 23 بهمن 1386, 12:27 عصر
  3. باز کردن و ثبت اطلاعات در EXCEL
    نوشته شده توسط vb study در بخش VB.NET
    پاسخ: 1
    آخرین پست: دوشنبه 09 مرداد 1385, 10:43 صبح
  4. ویرایش فایل excel در دلفی
    نوشته شده توسط fata263 در بخش برنامه نویسی در Delphi
    پاسخ: 0
    آخرین پست: سه شنبه 09 خرداد 1385, 09:58 صبح
  5. نمایش excel در دیتا گرید
    نوشته شده توسط gole_maryam در بخش ASP.NET Web Forms
    پاسخ: 1
    آخرین پست: یک شنبه 29 آبان 1384, 23:00 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •