Unigui Import and Export data

Source: Internet
Author: User

Import: First use Tunifileupload to upload the file from the client to the server, and then complete the import.

Tunifileupload Demo code for uploading files:

Unifileupload1.execute;
UniFileUpload1.ScreenMask.Target: = self;
UniFileUpload1.ScreenMask.Enabled: = True;

Use Tqimport3xls to import the demo code to upload a file:

Map the relationship between a dataset field and an Excel column:

QImport3XLS1.Map.Clear;
QIMPORT3XLS1.MAP.ADD (' empid=a2-colfinish ');
QIMPORT3XLS1.MAP.ADD (' empname=b2-colfinish ');

To perform an import:

Procedure tfrmemployee.unifileupload1completed (Sender:tobject;
Astream:tfilestream);
Begin
inherited;
Qimport3xls1.filename: = Unifileupload1.filename;
Qimport3xls1.execute;
End

Export: First export the data to a file, then download the file from the server to the client, and then open the file on the client.

Demo code to export data using Tqexport4xls:

Procedure Tfrmemployee.btnexportclick (Sender:tobject);
Var
f:string;
Begin
inherited;
F: = ' staff file. xls ';
Qexport4xls1.filename: = f;
Try
Qexport4xls1.execute;
Except
Qexport4xls1.execute;
End
MainForm.uniApplication.UniSession.SendFile (F, f);
End

Unigui Import and Export data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.