Jump to content

Eden

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by Eden

  1. Great!

     

    Thanks your answer!!

     

    Thank you!

    Hi,

     

    Try:

    procedure TMainForm.UniButton1Click(Sender: TObject);
    var
      DBGridJSName: string;
      FieldIndx: Integer;
    begin
      DBGridJSName := UniDBGrid1.JSName;
      FieldIndx := 2;
    
      UniSession.AddJS(DBGridJSName + '.getSelectionModel().select({row: '+ DBGridJSName +'.uniRow, column: '+ IntToStr(FieldIndx) +'});');
    end;
    

    Best regards

  2. No, it is normal. Just make sure you have an Excel installed on the server where you suppose to run your unigui application.

    I've made a demo for you, it works fine on my Win7x64 with Office 2003 (I hate ribbon interface).

     

    Yes!

    You are right!

     

    This test project can running in my PC! Very nice!!! :lol:

     

    Just because "ServerModule.AutoCoInitialize = True"?

     

    I will try it! Thank you!

  3. My original workflow (Win32):

    1. Client open excel file.

    2. Import the excel file to database(dbx).

    3. over.

     

    I want convert the project to Unigui.

    My Unigui workflow:

    1. Client upload Excel file to Server.

    2. Server will prcess excel import to Database(dbx);

    3. Delete the Excel file in Server

     

    Below my simple code:

     

    procedure TfmMain.UniFileUpload1Completed(Sender: TObject;

    AStream: TFileStream);

    var

    DestName : string;

    DestFolder : string;

    begin

    DestFolder:=UniServerModule.StartPath+'UploadFolder\';

    DestName:=DestFolder+ExtractFileName(UniFileUpload1.FileName);

    CopyFile(PChar(AStream.FileName), PChar(DestName), False);

    edtFilePath.Text := DestFolder + UniFileUpload1.FileName;

    end;

     

    procedure TfmMain.UniBtnFileUpload(Sender:TObject);

    begin

    UniFileUpload1.Filter := 'Excel files (*.xls)|*.xls';

    UniFileUpload1.Execute;

    end;

     

    procedure TfmMain.UniBtnFileProcessClick(Sender: TObject);

    var

    MsExcel, MsExcelWorkBook, MsExcelWorkSheet: Variant;

    begin

    try

    MsExcel := CreateOleObject('Excel.Application');

    except

    ShowMessage('Not Found Excel');

    Exit;

    end;

     

    MsExcelWorkBook := msExcel.Workbooks.Open(edtFilePath.Text,0,EmptyParam,EmptyParam,

    EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,

    EmptyParam,EmptyParam,EmptyParam,1,0);

    MsExcelWorkSheet := MsExcelWorkBook.WorkSheets[5];

    ProcedureExcel(MsExcelWorkSheet);

    end;

     

    >>You can embebbed Excel into your application...

    I try embebbed Excel(NativeExcel) in my project.

    But, it don't work.

     

    My workflow is abnormal?

     

    Please, Help me! Thank you!

  4. My sample code in TUniButton.OnClick:

    var ExcelApp: Variant;

    try

    ExcelApp := CreateOleObject('Excel.Application');

    except

    ShowMessage('Not Found Excel!');

    end;

     

    I have install Excel in my PC.

    But, always show except in Run-Time. Why?

×
×
  • Create New...