Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Birt Report Execution Time
Mr_Data
<p>Hi,</p>
<p> </p>
<p>I try to show Report Execution Time on the report.</p>
<p> </p>
<p>How can I show that? Do you have any example report?</p>
<p> </p>
<p>I have used below beforeFactory but It print unrecognized characters as the attachment.</p>
<p> </p>
<p>reportContext.getTimeZone( );</p>
<p> </p>
<p>Best Regards,</p>
Find more posts tagged with
Comments
micajblock
<p>Just use an expression with this:</p>
<pre class="_prettyXprint">
new Date();</pre>
Mr_Data
<p>Hi,</p>
<p> </p>
<p>I have written below function and assigned to "a" variable. This will be report starting time.</p>
<p> </p>
<p> a = new Date();</p>
<p> </p>
<p>But I got error when I wrote new Date Function and assign to "b" variable in afterFactory or other parts. This will be my report finished time.</p>
<p> </p>
<p>b = new Date();</p>
<p> </p>
<p>As a result, I should be able to show "b - a" as my report excution time.</p>
<p> </p>
<p>Is there any comment please?</p>
<p> </p>
<p>Best Regards,</p>
micajblock
<p>This what I do. I have a parameter for a log file name. In my beforeFactory I have this:</p>
<div>
<pre class="_prettyXprint">
importPackage(Packages.java.io);
var log = new FileWriter("c:\\tmp\\" + params["logFileName"] + ".log", false);
log.write(new Date().getTime() + " -- beforeFactory\r\n");
reportContext.setGlobalVariable("logWriter", log);</pre>
</div>
<div>and in my afterFactory I have this.</div>
<div>
<div>
<pre class="_prettyXprint">
importPackage(Packages.java.io);
var log = reportContext.getGlobalVariable("logWriter");
log.write(new Date().getTime() + " -- afterFactory\r\n");
log.flush();
log.close();</pre>
</div>
<div>I use getTime as it returns data in milliseconds.I can add similar code to any report item or data source.</div>
</div>
Mr_Data
<p>Hi,</p>
<p> </p>
<p>I implemented your java code in beforeFactory and afterFactory bu I got error. I am working on OS BIRT version, may be for its reason codes did not work.</p>
<p> </p>
<p>I have solved my will like below.</p>
<p> </p>
<p>1- I chose DataSet and wrote "<strong><em>a = new Date();</em></strong>" in "<strong><em>beforeOpen</em></strong>" and "<strong><em>b = new Date();</em></strong>" in "<strong><em>afterOpen</em></strong>".</p>
<p>2- Then I put <strong><em><value-of>"["+Math.round((b-a)/1000)+" seconds]"</value-of></em></strong> to <strong>MasterPage Header</strong>.</p>
<p> </p>
<p>Note: I do not know why but I could not write new Date function into other script like afterClose etc, afterFactory etc..</p>
<p> </p>
<p>Best Regards,</p>