Search the Community
Showing results for tags 'export'.
-
Hi, As the title says, I converted a library that Mike Heydon made to export a DataSet to old format Excel file (xls) without OLE or Excel installed. This library now converts an UniDBGrid to Excel. Sample of usage. // Add uses UExportExcel procedure TMainForm.UniButton1Click(Sender: TObject); var url, filename, reportname : String; exportExcel: TDataSetToExcel; i: integer; begin reportname := 'ExcelReport'; url := UniServerModule.LocalCacheURL+name+'.xls'; filename := UniServerModule.NewCacheFileUrl(false, 'xls', reportname, '', url); exportExcel := TDataSetToExcel.Create(filename); exportExcel.Grid := UniDBGrid1; exportExcel.WriteFile; FreeAndNil(exportExcel); UniSession.SendFile(filename, reportname+'.xls'); end; Hope it helps everyone. UExportExcel.zip
-
Hello friends I would like information if there is any way to export information in a query, grid or dataset to excel in unigui. I have a report generation screen that is viewed in Fast Report and the client wants to export to excel, but the native delphi options that work with error unit COMobj. If someone has an example I thank you very much Hello friends I would like information if there is any way to export information in a query, grid or dataset to excel in unigui. I have a report generation screen that is viewed in Fast Report and the client wants to export to excel, but the native delphi options that work with error unit COMobj. If someone has an example I thank you very much
-
Hi there, Could anyone help me with exporting data to MSWord? I have a procedure that works on desktop but doesn't work when on ISAPI. It works on unigui exe too. CoInitialize(NULL); try { Variant vMSWord; Variant vWDocuments, vWDocument; vMSWord = Variant::CreateObject("Word.Application"); String vNomeArq = ""; try { vMSWord.OlePropertySet("Visible", true); vNomeArq = UniServerInstance()->StartPath + "modelo.doc"; vWDocuments = vMSWord.OlePropertyGet("Documents"); OleVariant vFileName = vNomeArq; Variant vLink = Unassigned; Variant vReadOnly = false; Variant vFormat = Unassigned; vWDocument = vWDocuments.OleFunction("Open", vFileName, vLink, vReadOnly, vFormat); OleVariant vTxtOld = "<NOME>"; OleVariant vTxtNew = "FULANO DA SILVA"; vMSWord.OlePropertyGet("Selection").OleFunction("HomeKey", 6); vMSWord.OlePropertyGet("Selection").OlePropertyGet("Find").OleFunction("Execute", vTxtOld, false, true, false, false, false, true, false, false, vTxtNew, 2, false, false, false, false); vWDocument.OleProcedure("Save"); vWDocuments.OleFunction("Close"); vMSWord.OleFunction("Quit"); } catch (Exception &erro) { ShowMessage("Erro: " + vNomeArq + " - " + erro.Message); } } __finally { CoUninitialize; }
-
I am trying to implement uniGUI into some of my projects but get frustrated when I cannot export grids or lists (I assume I can export images as jpg - I have not got that far yet). Yes I know I can add a fudge DevExpress invisible grid and clone the data in order to export as a work around but to be frank, this is not good coding. Can we please have Export capabilities such as Excel, PDF, JPG with many of the uniGUI components.
-
uses JvDBGridExport, DBGrids; // Activex; for Word/Excel var mygrid : TDBGrid; myexport : TJvDBGridCSVExport; // myexport : TJvDBGridExcelExport; // myexport : TJvDBGridWordExport; // myexport : TJvDBGridHTMLExport; begin mygrid := TDBGrid.Create(nil); mygrid.DataSource := unimainmodule.myexportdatasource; // CoInitialize(nil); // call only if export to Word/Excel myexport := TJvDBGridCSVExport.Create(nil); // myexport := TJvDBGridExcelExport.Create(nil); // myexport := TJvDBGridWordExport.Create(nil); // myexport := TJvDBGridHTMLExport.Create(nil); myexport.FileName := 'c:\myexport.csv'; myexport.ExportSeparator := esSemiColon; // estab, esComma, esSemiColon myexport.Grid := mygrid; myexport.ExportGrid; // read exceptions in: myexport.LastExceptionMessage; myexport.Free; mygrid.Free; end; If you want to export to Word/Excel, then you have to have Office installed on the Server. Excel can easily read CSV files. You need to have JVCL in your Delphi.
-
Hello! I'm working with the tools of http://www.telerik.com/(Kendo UI) where the graphics are generated within the uniHTMLFrame. Topic Forum I would like to know a procedure to save the graph created in the frame as a PNG image. Thank you Wait. olá! Eu estou trabalhando com as ferramentas da http://www.telerik.com/(Kendo UI) onde os gráficos são gerados dentro do uniHTMLFrame. Eu gostaria de saber um procedimento para salvar o gráfico criado no frame como imagem PNG. Obrigado Aguardo.
- 2 replies
-
- TUniHTMLFrame
- image
-
(and 2 more)
Tagged with:
-
Good Morning! I wonder how do (send to) print the contents of a UniHTMLFrame. I can export the contents of UniHTMLFrame to a PDF? How? Can someone help me? Grateful!
- 6 replies
-
- UniHTMLFrame
-
(and 2 more)
Tagged with:
-
Hello everybody, I would like to know how to import and export the TUniTreewView content to TXT file? Thank you. ---------------------------------------- Olá pessoal, eu gostaria de saber como importar e exportar o conteúdo do TUniTreewView para arquivo TXT? Obrigado,.
-
Hi; I was successfully to export and download a datasource content using ZEXMLSS Download XML file and open with excel it works very nice for me. Used Component : ZEXMLSS and ZColorStringGrid from http://avemey.com/index.php?lang=en Turbo power tpabbrevia from http://sourceforge.net/projects/tpabbrevia/?source=dlp You must install a zip component and zcolorstring for exporting. I need some modification ZEXMLSS compatiblity for tpabbrevia manually during installation. Here is sample code which was tested via XE2 PS : sorry for big capital. I am always using big capital writting a program. // Tdosyaver is uniform formname // RAPORHAZIRLA(XFILENAME:STRING); // Prepare data and export it using ZEXMLSS. QLIST is a datasource and opened before this proc. PROCEDURE TDOSYAVER.RAPORHAZIRLA(XFILENAME:STRING); //uses zexmlss, zeodfs, zexmlssutils, zeformula, zsspxml, zexlsx; var XMLSS: TZEXMLSS; i, j: integer; TextConverter: TAnsiToCPConverter; sEOL: string; XSAYI : INTEGER; XSATIR : INTEGER; XCOL : INTEGER; begin TextConverter := nil; {$IFNDEF FPC} {$IF CompilerVersion < 20} // < RAD Studio 2009 TextConverter := @AnsiToUtf8; {$IFEND} {$ENDIF} {$IFDEF FPC} sEOL := LineEnding; {$ELSE} sEOL := sLineBreak; {$ENDIF} XMLSS := TZEXMLSS.Create(nil); try //There are 1 pages in this document XMLSS.Sheets.Count := 1; XMLSS.Sheets[0].Title := 'Sayfa1'; // EXCEL SHEET NAME //Add styles XMLSS.Styles.Count := 1; XMLSS.Styles[0].Font.Size := 10; XMLSS.Styles[0].Font.Name := 'Arial'; XMLSS.Styles[0].Alignment.Horizontal := ZHCenter; // This parameters are optional and some styles options too (line backcolor, text oriantation etc). XMLSS.Styles[0].Alignment.Vertical := ZVCenter; XMLSS.Styles[0].Alignment.WrapText := true; with XMLSS.Sheets[0] do begin //the count of rows and columns // ZEXMLSS must know how many contain rows and cols. You must set this properties before beginging exporting. RowCount := 50; // ColCount := 20; // All Field Names FOR XSAYI:=0 TO QLIST.FIELDS.COUNT-1 DO BEGIN CELL[XSAYI,1].CellStyle:=1; CELL[XSAYI,1].DATA:=QLIST.FIELDS[XSAYI].FIELDNAME; END; // XSATIR:=2; // row. First row contain field XCOL:=0; // we transfer to all records to ZEXMLSS WHILE NOT QLIST.EOF DO BEGIN FOR XCOL:=0 TO QLIST.FIELDS.COUNT-1 DO BEGIN CELL[XCOL,XSATIR].CellStyle:=1; CELL[XCOL,XSATIR].DATA:=QLIST.FIELDS[XCOL].ASSTRING; END; QLIST.NEXT; INC(XSATIR); END; end; finally FreeAndNil(XMLSS); end; end; procedure TDOSYAVER.BTNEXCELClick(Sender: TObject); VAR XFILENAME : STRING; begin XFILENAME:='Report.XML'; XFILENAME:=UniServerModule.LocalCachePath+XFILENAME; RAPORHAZIRLA(XFILENAME); UniSession.sendFile(XFILENAME); end;