new best gmail lab feature
Tuesday, February 3rd, 2009Single send & archive button. Grrrrrrrrreat.
(more…)Single send & archive button. Grrrrrrrrreat.
(more…)This is list-matching-lines that I’m always looking after in my feeds
So they renamed their tags as folders. But they still act as tags. Don’t people get confused by the “change folders” behavior?
Downloading gmail mac notifier brings a dmg file (ok) which only contains a shell script (wt?) which opens another URL to download the notifier (W-T-F-F?!). What’s wrong with you, people, seriously?
Please, follow your gmail friends and add lab features. And add the custom colors feature, kthxbye.
Assuming that you have some way to get your source data, and that you already have followed instructions to do sparklines with JRuby and JFreeChart, you must first declare an image inside your report:
<field name="Spark" class="net.sf.jasperreports.engine.JRRenderable"/>
[...]
<image scaleImage="Clip" hAlign="Center" hyperlinkType="Reference">
<reportElement x="200" y="0" width="150" height="30"/>
<graphicElement/>
<imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[$F{Spark}]]></imageExpression>
</image>
And then, from JRuby, you must implement the JRDataSource interface (that is, a basic iterator over your data) to provide the corresponding field encapsulated in a JCommonDrawableRenderer:
class MySparkLine
import "net.sf.jasperreports.engine.JRDataSource"
include JRDataSource
def getFieldValue( field )
case field.getName()
when "Spark"
return JCommonDrawableRenderer.new( chartObject )
end
end
end
And that’s as easy as it gets.
“mark as read” button. ‘nuff said.
Really, I love JRuby.
report = JasperCompileManager.compileReport( "myreport.jrxml" ) ds = RDataProvider.new( "mydata.csv" ) File.open( "myreport.pdf", "w" ) do |f| pdf = JasperRunManager.runReportToPdf( report, nil, ds ) out_str = String.from_java_bytes( pdf ) f.write( out_str ) end
And that’s about it. This is almost all that is required to generate a PDF file for a given report from data stored in a CSV file, using the Java libraries from JasperReports and JRuby.
The file extension passed as parameter should be lowercase, even if you plan to import files in .JPG or .GIF (more…)