home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / TEXPLIST.ZIP / Delphi 4 / ExportLVReg.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-02-01  |  16.0 KB  |  227 lines

  1. {------------------------------------------------------------------------------}
  2. { TExportListView v2.00 (c) 1998-99 Y-Tech Corporation      January 31st, 1999 }
  3. {------------------------------------------------------------------------------}
  4. { TExportListView prints or exports the contents of any TListView to 8 Formats }
  5. { (incl. HTML, Microsoft Word & Excel!). Exports to Screen or to File. Can     }
  6. { Export even if the target App is not installed! Also Shows Progress.         }
  7. { Supports Brad Stower's TExtListView & TEnhListView (Registered Version Only).}
  8. { (Source w/Registration)                                                      }
  9. {                                                                              }
  10. { Please visit our Web Site: http://www.igather.com/components to try out the  }
  11. { many other components available there.                                       }
  12. {------------------------------------------------------------------------------}
  13.  
  14. {------------------------------------------------------------------------------}
  15. { Installation                                                                 }
  16. {------------------------------------------------------------------------------}
  17. { Please register ExportLVReg.pas                                              }
  18. {                                                                              }
  19. { Important! Since many Y-Tech Components (ie. those made by Y-Tech Corp.)     }
  20. { share the same units, you must put all code files (.dcu, .pas, .dfm,         }
  21. { .dcr, etc...) for all Y-Tech Components into the same directory. Otherwise   }
  22. { Delphi will not compile the library/package properly.                        }
  23. {------------------------------------------------------------------------------}
  24.  
  25. {------------------------------------------------------------------------------}
  26. { Important! Compatibility Issues with v1.10 and earlier                       }
  27. {------------------------------------------------------------------------------}
  28. { + ShowProgress has been moved inside of the Options property. This           }
  29. {   means you might get an error when loading a form that contained the        }
  30. {   old TExportListView component (v1.10 and earlier). Just ignore it.         }
  31. { + PopulateStrings no longer exists. Support for it is gone, Choose           }
  32. {   Dialog (TExportListView.Choose) is the way of the future. Sorry.           }
  33. {   It's obsolete really.                                                      }
  34. { + All ExportTypes now have an 'x' in front. For instance HTML is now         }
  35. {   xHTML. This was done to prevent any potential problems.                    }
  36. {------------------------------------------------------------------------------}
  37.  
  38. {------------------------------------------------------------------------------}
  39. { Questions & Comments                                                         }
  40. {------------------------------------------------------------------------------}
  41. { All questions and comments should be sent to ycomp@hotpop.com                }
  42. {------------------------------------------------------------------------------}
  43.  
  44. {------------------------------------------------------------------------------}
  45. { Usage                                                                        }
  46. {------------------------------------------------------------------------------}
  47. { - Always read "readme.txt"                                                   }
  48. { - Please look at "info.htm"                                                  }
  49. { - Please refer to the help file.                                             }
  50. { - To create your own export formats pleased read "TCustomExportListView.htm" }
  51. {------------------------------------------------------------------------------}
  52.  
  53. {------------------------------------------------------------------------------}
  54. { License Agreement & Disclaimer                                               }
  55. {------------------------------------------------------------------------------}
  56. { By use of this component, you have agreed to the following:                  }
  57. {                                                                              }
  58. { You may not distribute any files for this component except the unregistered  }
  59. { version's .Zip File. You may definately not distribute the source, it is for }
  60. { your eyes only. Anyone else wishing to see the source must purchase it at    }
  61. { http://www.igather.com/components                                            }
  62. {                                                                              }
  63. { The unregistered version's .Zip file can be included on any kind of media or }
  64. { distributed through any kind of medium.                                      }
  65. {                                                                              }
  66. { Although this component has been thoroughly tested and documented, neither   }
  67. { Y-Tech Corporation nor any of it's employees nor the author will be held     }
  68. { responsible for any damage arising from it's use or misuse.                  }
  69. {------------------------------------------------------------------------------}
  70.  
  71. {------------------------------------------------------------------------------}
  72. { International Language Support                                               }
  73. {------------------------------------------------------------------------------}
  74. { There are 2 ways of implementing support for your own language:              }
  75. {                                                                              }
  76. { 1. Get the ELV_Strings.pas file for your language and follow the             }
  77. {    installation instructions that come with it. Try downloading it from the  }
  78. {    Y-Tech Components web site (http://www.igather.com/components).           }
  79. {                                                                              }
  80. { 2. Translate it yourself. (if there is no ELV_Strings.pas for your language, }
  81. {    you must do it this way). It's simple really, just find the               }
  82. {    ELV_Strings.pas unit that came with TExportListView and translate the     }
  83. {    strings inside. There's not that many, so it's not a big job. Then        }
  84. {    recompile the package/component library that your component is installed  }
  85. {    in. Finally, if you think you made a half-decent translation, please      }
  86. {    e-mail it to Y-Tech at ycomp@hotpop.com                                   }
  87. {------------------------------------------------------------------------------}
  88.  
  89. {------------------------------------------------------------------------------}
  90. { TExportListView FAQ                                                          }
  91. {------------------------------------------------------------------------------}
  92. { Q: When I try to use TExportListView with Delphi's Virtual ListView demo I   }
  93. {    get an "Invalid Floating Point Operation" exception. Why don't you fix    }
  94. {    this bug?                                                                 }
  95. { A: I would love to but this is not a bug with TExportListView, it's a bug    }
  96. {    with Delphi's Virtual ListView demo in the TListView.OnData event. You    }
  97. {    can see this bug in action for yourself without even putting              }
  98. {    a TExportListView on the form. Here's how to replicate the bug:           }
  99. {        1. Put a button on the form of the Virtual ListView demo.             }
  100. {        2. Put this code in it's OnClick event handler:                       }
  101. {                with ListView do                                              }
  102. {                  for i := 0 to Items.Count - 1 do                            }
  103. {                    Self.Caption := Items[i].Caption;                         }
  104. {        3. Run the demo and go to your C:\Windows directory                   }
  105. {           (I suggest the Windows dir because you need quite a few files for  }
  106. {            this bug to work)                                                 }
  107. {        4. Click the button. You should get an exception.                     }
  108. {------------------------------------------------------------------------------}
  109.  
  110. {------------------------------------------------------------------------------}
  111. { Revision History                                                             }
  112. {------------------------------------------------------------------------------}
  113. { 1.00: + Initial Release                                                      }
  114. {                                                                              }
  115. { 1.10: + Fixed various minor bugs, added Print Method!                        }
  116. {       + Excel Code dramatically improved. A simple test with 150 ListView    }
  117. {         entries showed an increase in speed of over 300%!                    }
  118. {                                                                              }
  119. { 2.00: This is a - major - upgrade, much has been fixed, improved & added.    }
  120. {       Here's a list:                                                         }
  121. {                                                                              }
  122. {       Removed & Changed Drastically:                                         }
  123. {         + See "Compatibility Issues" Section of this file.                   }
  124. {                                                                              }
  125. {       Bug Fixes:                                                             }
  126. {         + Fixed various minor bugs.                                          }
  127. {         + Fixes bug where ExportFile property was cleared automatically      }
  128. {           sometimes.                                                         }
  129. {         + Fixed bug that caused App to stay on top of the Viewer Program     }
  130. {           when exporting to some formats (like MS-Word, and Excel sometimes) }
  131. {         + Fixed minor bug: Clipboard property used to modify the ViewOnly    }
  132. {           property after exporting the Clipboard.                            }
  133. {         + Fixed ProgressBar "Overspill".                                     }
  134. {                                                                              }
  135. {       Internationalization:                                                  }
  136. {         + Moved all English Message Constants to the ELV_Strings unit. You   }
  137. {           can translate the strings in that unit to your own language.       }
  138. {           (If you do, please e-mail it to me so I can include language       }
  139. {            strings files with future versions)                               }
  140. {                                                                              }
  141. {       Improvements:                                                          }
  142. {         + Added support for Column Dragging of ListViews. Previous versions  }
  143. {           did not support this simply because Delphi 4 does not support it   }
  144. {           properly.                                                          }
  145. {         + Deletes all Temporary Files when the application terminates.       }
  146. {           (Unless they have a lock on them or are otherwise un-deleteable.   }
  147. {         + Can now export to file even when the application is not installed. }
  148. {         + Improved Error-Checking.                                           }
  149. {         + Choose method now remembers the Last-Used Export Type.             }
  150. {         + The value of the ExportType property is now used by the Choose     }
  151. {           Dialog box the first time it is displayed in order to set the      }
  152. {           Default Export Type.                                               }
  153. {         + Improved Formatting. Exported Documents now look much better and   }
  154. {           look professionally formatted in Microsoft Word & Excel.           }
  155. {                                                                              }
  156. {       Additions:                                                             }
  157. {         + Added Captions property, so you can specify different captions     }
  158. {           than in the listview's column header.                              }
  159. {         + Added AllowedTypes property so you can specify which types the     }
  160. {           user is allowed to export to.                                      }
  161. {         + Added RichText Export Type.                                        }
  162. {         + Added capability for User to select exporting to Screen or to File }
  163. {           to the Choose Dialog. If Viewer not installed, the View button is  }
  164. {           disabled.                                                          }
  165. {                                                                              }
  166. {       Added Options Property:                                                }
  167. {         + ExportInvisibleCols: If True, all columns are exported even if     }
  168. {           their width is 0 (invisible)                                       }
  169. {         + SelectedRowsOnly: If True, only exports selected rows.             }
  170. {         + NumberRows: If True, numbers each item exported.                   }
  171. {         + ShowClipboardMsg: If True, displays a dialog after the data has    }
  172. {           been successfully exported to clipboard informing the user that    }
  173. {           the operation is complete.                                         }
  174. {         + ShowProgress: ShowProgress has been moved to here.                 }
  175. {         + TimeStamp: If True, puts a time stamp in the exported file         }
  176. {                                                                              }
  177. {       MS-Word Improvements:                                                  }
  178. {         + Word Exporting is incredibly fast now. I don't think Word can get  }
  179. {           any faster and I'm only ashamed that it was not this fast in v1    }
  180. {           of TExportListView.                                                }
  181. {         + All 32-bit versions of Word Supported ('95, '97 and future         }
  182. {           versions). Word 6 (the latest 16-bit version) also supported.      }
  183. {           Earlier versions might also work as well.                          }
  184. {         + When Exporting to Word, output is directed to the current instance }
  185. {           of Word (if there is one), in prior versions a New instance of     }
  186. {           Word was always created.                                           }
  187. {                                                                              }
  188. {       Excel Improvements:                                                    }
  189. {         + Even faster! This is about as fast as it gets.                     }
  190. {         + Previous versions could have had problems with using too much      }
  191. {           memory while exporting large TListViews. This is no longer a       }
  192. {           problem. TExportListView v2 uses very little memory.               }
  193. {         + Now compatible with Excel v3.0 and higher!                         }
  194. {         + When Exporting to Excel, output is directed to the current instance}
  195. {           of Excel (if there is one), in prior versions a New instance of    }
  196. {           Excel was always created.                                          }
  197. {                                                                              }
  198. {      Other:                                                                  }
  199. {         + In previous versions, if you compiled with Delphi 5 or later it    }
  200. {           would be treated as Delphi 2 and you would not be taking advantage }
  201. {           of some of the newer compiler features. This release eradicates    }
  202. {           those problems. Which means: You shouldn't have to get new source  }
  203. {           code if you've registered when Delphi 5 is released.               }
  204. {------------------------------------------------------------------------------}
  205.  
  206. unit ExportLVReg;
  207.  
  208. interface
  209.  
  210. uses ELV_Main;
  211.  
  212. const
  213.   {$I CompConstants.inc} // Component Constants & Conditional Defines
  214.  
  215. procedure Register;
  216.  
  217. implementation
  218.  
  219. uses Classes;
  220.  
  221. procedure Register;
  222. begin
  223.   RegisterComponents(cComponentTab, [TExportListView]);
  224. end;
  225.  
  226. end.
  227.