Changeset 997
- Timestamp:
- 05/13/07 19:22:34 (2 years ago)
- Files:
-
- ruport-www/cheatsheets/formatting.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ruport-www/cheatsheets/formatting.html
r996 r997 206 206 requires a few simple lines, hiding all formatting complexity.</p> 207 207 208 <p>The output for this report is shown below</p> 209 <pre> 210 *************************************************************************** 211 December Sales Figures 212 *************************************************************************** 213 214 isbn |title |author |sales 215 ########################################################################### 216 978111111111 |Book Number One |me |10 217 978222222222 |Two is better than one |you |267 218 978333333333 |Three Blind Mice |John Howard |1 219 978444444444 |The number 4 |George Bush |1829 220 ########################################################################### 221 </pre> 208 222 209 223 <h3>Adding <span class="caps">PDF</span></h3> … … 245 259 246 260 def build_document_body 247 draw_table titles, :maximum_width => 500248 :column_order => %w[isbn title author sales]261 draw_table Table(:column_names => %w[isbn title author sales], 262 :data => titles), :maximum_width => 500 249 263 end 250 264 251 265 def finalize_document 252 output << pdf_writer.render266 render_pdf 253 267 end 254 268 end … … 306 320 File.open("dec_sales.pdf", "w") { |f| f.write report } 307 321 </code></pre> 322 323 We end up with pretty output like this: 324 325 308 326 309 327 <p>Switching output formats within your app according to user preference or
