Posted By

khalidpeace on 08/17/10


Tagged

FlexCel


Versions (?)

FlexCel Ref


 / Published in: Delphi
 

  1. Report Variables
  2. FlexCelReport.Value #.ReportVarName#.
  3. FlexCelReport.Values['message'] := 'Hello World';
  4. FlexCelReport.Run;
  5.  
  6. User defined functions
  7. published functions
  8. NumberToString(number: integer) #.NumberToString#.2
  9.  
  10. published property
  11. #.NumberToString#.
  12.  
  13.  
  14. DataSets
  15. ##dataset##field,
  16.  
  17. if used without named range, then current record values will be used
  18.  
  19. TFlxMemTable
  20. normal mode, virtual mode
  21.  
  22.  
  23. Named Range
  24. __dataset__
  25.  
  26.  
  27.  
  28. ...delete row...
  29. ...page break...
  30.  
  31.  
  32. more than one variable in cell
  33. Name <##dataset##firstname><##dataset##lastname>
  34.  
  35.  
  36.  
  37. Fixed Bands
  38. to create fixed band like Grand total after certain rows number, record will not be inserted, use
  39. FlexCelReport.ReportModeRows := frm_DontCopyAndDontInsert
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. procedure TDataModule.ButtonOpenClick(Sender: TObject);
  48. begin
  49. FlexCelImport.OpenFile('c:\test.xls');
  50. try
  51. DoSomething(FlexCelImport);
  52. FlexCelImport.Save('c:\result.xls');
  53. finally
  54. FlexCelImport.CloseFile;
  55. end;
  56. end;
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. By default FlexCel never overwrites an existing file. So, before saving you
  65. always have to call
  66. File.Delete
  67. , or set
  68. XlsAdapter.AllowOverWriteFiles := true
  69.  
  70.  
  71.  
  72.  
  73.  
  74. creating new file
  75. FlexCelImport.NewFile
  76.  
  77.  
  78.  
  79. Making the sheet fit in one page of width.
  80. FlexCelImport.PrintToFit := true;
  81. FlexCelImport.PrintNumberOfHorizontalPages := 1;
  82. FlexCelImport.PrintNumberOfVerticalPages := 0;
  83.  
  84. or Go to the File Menu, select “Page Setup”, and then in the “Scaling” section make it fit in one page wide, Make the “tall” combobox empty
  85.  
  86.  
  87.  
  88. Repeating Rows and Columns at the top
  89. XlsFile.PrintHeadings := true;
  90. XlsFile.PrintGridLines := true;
  91.  
  92. or
  93.  
  94. InitializeNamedRange(NamedRange);
  95. NamedRange.Name := InternalNameRange_Print_Titles;
  96. NamedRange.RangeFormula := '=1:2,A:B';
  97. //While this normally should be 0, In the case of
  98. //Print_Titles, the sheetindex must be specified.
  99. NamedRange.NameSheetIndex := 1;
  100. FlexCelImport.SetNamedRange(NamedRange);
  101.  
  102.  
  103.  
  104.  
  105. Using Page Headers/Footers
  106. XlsFile.PageHeader and PageFooter
  107.  
  108. or from excell

Report this snippet  

You need to login to post a comment.