![]() |
|
#6
|
|||
|
|||
![]() ставь Rave 5 мона скачать, там патчи новые и т.д., всё поддерживают, или юзай Ole и делай отчет в Excel, заюзай там парочку макросов, чтоб красиво отформатировать текст и усё будет гут, вот пример с макросом :
excel := CreateOleObject('excel.application'); Screen.Cursor := crSQLWait; try Excel.workbooks.add; // Excel.WorkBooks[1].WorkSheets[1].Cells[1, 1] := uppercase(); Excel.WorkBooks[1].WorkSheets[1].Cells[2, 1] := uppercase(); .... Adoquery1.First; i := 2; while not Adoquery1.Eof do begin Excel.WorkBooks[1].WorkSheets[1].Cells[i, 1] := qselecttmp.FieldValues['Ndoc']; Excel.WorkBooks[1].WorkSheets[1].Cells[i, 2] := qselecttmp.FieldValues['Summa']; ..... inc(i); qselecttmp.Next; end; Excel.ActiveSheet.Range['A1:N'+inttostr(i)].Select; Excel.Selection.Columns.AutoFit; Excel.WorkBooks[1].vbproject.vbcomponents.add(1).name := 'Reys'; Excel.WorkBooks[1].vbproject.vbcomponents.item('Reys').codemodule.ad dfromstring( 'Public Sub PrintReys()'#10 + #9+ 'With ActiveSheet.PageSetup'#10 + '.LeftHeader = ""'#10 + '.CenterHeader = ""'#10 + '.RightHeader = ""'#10 + '.LeftFooter = ""'#10 + '.CenterFooter = ""'#10 + '.RightFooter = ""'#10 + '.LeftMargin = Application.InchesToPoints(0.787401575)'#10 + '.RightMargin = Application.InchesToPoints(0.787401575) '#10 + '.TopMargin = Application.InchesToPoints(0.984251969) '#10 + '.BottomMargin = Application.InchesToPoints(0.984251969)'#10 + '.HeaderMargin = Application.InchesToPoints(0.5)'#10 + '.FooterMargin = Application.InchesToPoints(0.5)'#10 + '.PrintHeadings = False'#10 + '.PrintGridlines = False'#10 + '.PrintComments = xlPrintNoComments'#10 + '.PrintQuality = 600'#10 + '.CenterHorizontally = False'#10 + '.CenterVertically = False'#10 + '.Orientation = xlLandscape'#10 + '.Draft = False'#10 + '.PaperSize = xlPaperA4'#10 + '.FirstPageNumber = xlAutomatic'#10 + '.Order = xlDownThenOver'#10 + '.BlackAndWhite = False'#10 + '.Zoom = 35'#10 + '.FitToPagesWide = 1'#10 + '.FitToPagesTall = 1'#10 + '.PrintErrors = xlPrintErrorsDisplayed'#10 + 'End With'#10 + //предварительно перед печатью //'ActiveWindow.SelectedSheets.PrintPreview'#10+ //печать 'ActiveWindow.SelectedSheets.PrintOut'#10+ #9#9#10+'End Sub'); Excel.run('PrintReys'); excel.ActiveWorkbook.SaveAs(seansParams.FolderSave Report+'\'+FormatDateTime('dd.mm.yyyy',dtSaveReysS howReys.Date)+'-'+inttostr(cbTypes.KeyValue)+'.xls'); end; //сохранение excel.ActiveWorkbook.SaveAs(path+'\'+FormatDateTim e('dd.mm.yyyy',dtSaveReysShowReys.Date)+'-'+inttostr(cbTypes.KeyValue) +'.xls'); finally excel.quit; excel := Unassigned; Screen.Cursor := crDefault; qSelectTmp.Free; end; могут юыть ошибки, я просто кусок кода отрезал из своей прожки |