We have a large codebase with multiple languages and are trying to standardize the metric via which code coverage is measured currently. We're wondering if it is possible to have our code coverage tool create a custom HTML output that would be the same across tools. The one we are testing with right now is JaCoCo and we're trying to see if JaCoCo can create an HTML file of code coverage. Does anyone know if this is possible or if there is another tool that might suit our needs? We initially tried looking for a code coverage tool that works with multiple languages (python, java, nodejs, etc). Thanks in advance!
Edit: Looks like SonarQube might be exactly what we're looking for! Thanks
Jacoco can create a bunch of formats, html, xml, json, pdf. What I would recommend in your case is to retrieve the generated Jacoco Reports, store your data in any mechanism you seem suitable and then build your own custom UI from the data you have.
I'm a newbie to Java.
Could you help me understand how to construct printing of a rather complicated report. The report is a table with a lot of fields about a services rendered to a client (date, client, service, signatures etc.). The layout of this table may change in time if the boss orders.
Printing of the report may be done from many computers to many printers.
What I can't think of is how to cope with this: to pseudographics is outdated and complicated if the layout changes.
The other approach is to use Excel workbooks (or something similar). In this case all I need is putting information in the right cell. This is good because Excell will be responsible for correct printing. But this is a bit more burdensome for the computer and slow for the user: to launch Excell, maybe the user will have to check the borders or something.
Well, could you recommend me anything?
We use JasperReports to generate PDF files. It's an open source Java library and comes with a report designer that easily plugs into Eclipse. A stand-alone version of the report designer is available, if you use a different IDE.
From watching the 2-part YouTube videos and perusing the BIRT manual, my understanding of it is the the worflow goes something like this:
Create a new Report in Eclipse
Use the BIRT Report Designer (Eclipse plug-in) to design a report
Populate the report with Data Sources (JDBC drivers & databases) and Data Sets (specific tables)
Generate/export/print the report
As cool as this tool seems to be, I cannot find any documentation that leads me to believe that this is a Java tool and not an Eclipse-only tool (meaning, it has a Java API and can interact with Java apps, as opposed to a pure Eclipe plug-in which requires manual/human interaction from the Eclipse IDE.
Specifically, I want to confirm that BIRT either can or cannot do the following:
Configure a report (layout, UI widget placement, data sources/sets, etc.) programmatically; i.e. in the same way that JasperReport API has the iReport designer that generates JRXML, is the same true for BIRT?
Kick off a report "generation" through a Java API whereby data gets read-in realtime and populates the report and the report can be sent out or stored on a file system
Create HTML and PDF versions of the same report
Answers to your questions:
Yes. BIRT may not be as powerful as JasperReports, but it can achieve most of the common needs.
BIRT designer generates a .rptdesign file similar to JRXML in JasperReports.
About your question: almost everything is possible to achieve programmatically in BIRT. BIRT Report Engine APIs is the best source for you to get started with all the functionalities you have mentioned. It has good examples given for every functionality.
Not sure. BIRT usually fetches pre-saved data from DB and generates the report. You could though see the real time data representation (in the form of a flash chart may be) with the help of some external libraries (See if this thread and this example helps). But I am not aware of a direct way of converting the real time data to PDF/HTML report. You will have to find some hack(s).
Yes of course. Refer the APIs. To be specific, irendertask.
Sources to get more information/answers:
There are several example reports given on the website. A quick glance through them might give you more insights.
For discussions and troubleshooting, refer eclipse community forum and BIRTExchange (heavily used by BIRT users).
BIRT: A Field Guide to Reporting is an excellent book. I've used it myself from time to time.
I can confirm that the two BIRT components you are interested in using (BIRT Design Engine and Report Engine) will work in a pure-Java context and are deployable without Eclipse. I have deployed BIRT reports to run out of standalone Tomcat servers as well as Pentaho BI Server, and have exercised report definitions at the command line using shell scripts (no Eclipse involved).
Answers to your questions:
Configure a report programmatically: use the Design Engine API. I am not familiar with the Jasper Reports API so cannot comment on whether the BIRT method is similar, but the example code provides a good illustration. In particular, note lines 120-133 which add and manipulate widgets in the report, and how line 136 calls saveAs to save the report design file.
Generate a report in realtime: use the Report Engine. The sample code for the IRunAndRenderTask may be the most useful for you at first, but the engine has the ability to separate the data processing (extract and aggregate) of the report from the rendering and paging. I believe the examples focus on running reports from a Servlet, but it is easy to extract that logic from the servlet container logic.
Create both HTML and PDF versions: easily handled in the Report Engine via the IRenderTask. Once you've been through all the other setup work, changing the output format to produce PDF vs HTML is something of a joy. In my experience, it just works.
I found it useful to start out with a very simple Java class (adapted from the very old code here) to run a test report, called from the command line.
you can use the report engine API to configure reports:
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#ireportrunnable
You can create HTML or PDF versions of a report by setting a variable in the url to generate the report or if using the report engine programmatically:
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#irendertask
We use Eclipse to build and design reports. The report engine is deployed as part of a reports_war, the war has its own connection to the database. Our Java based web application uses urls to interact with the report templates (variables are set in the urls).
The BIRT Exchange is a good place for more information
There is not much difference between Birt and jasper as designing point of view except birt have eclipse plugin.
1)yes,you can configure it by java program or methods.
2)yes,this is possible.
3)yes again for export your report in different formats is easy for birt report by java
BIRT is a good and easy tool fro report generating.
you can design your pages in BIRT.
-
Create datasets and can pass the values from your web pages to your BIRT design using jsp tag lib.
BIRT fulfills all your requirement. Its so easy to use. first i use jasper, then tried crystal atlast Birt gies the output.
tag lib
i refer this link to view BIRTVIEWVER in my web page. PDF creation is so perfect in BIRT. You can generate PDF, DOC, HTML also.
you can pass values to your birt . while creating dataset there is option for passing params.
to do all this you have to install BIRTREPORT inyour eclipse BIRT Report designer
Ok, So I have to generate very complex reports from my DB.
If I am to do it with SQL the query themselves will be complex, and I will have to do some more manipulation on the results later, code level.
How do libraries like Jasper Reports/ Crystal Reports and friends save me time when developing such reports?
What will they give me?
These tools may not necessarily save you that much time writing the SQL, but they will give you a nice clean presentation of the data for your customers.
When it comes to writing the query, they won't give you much. Some of the Business Intelligence tools out there (although none of the open source ones I know of) give you infrastructure for point and click queries. A developer still has to do the hard work of setting them up, especially for complex queries, to provide a view of the data that is simple enough for the user.
What these tools do give you is an engine to take care of a lot of the presentation issues, such as formatting, page breaks, converting to multiple formats (HTML, PDF, etc), running, storing and retrieving the reports and other things in that area.
What ever tool you are using to generate reports, you got to write your complex SQL or define the views out of your data to generate the reports. The benefit of using the tools is
Can generate multiple type of report formats (PDF, EXCEL, TEXT..)
Eliminates a lot of routine chores like setting date/time stamps, header formatting..
Maintains consistency across multiple report pages which is generally a bit hard to acheive
Creates a template layout which can be reused and some fancy functions like sub reports and easy type conversions in some cases..
etc...
If I am to do it with SQL the query themselves will be complex, and I will have to do some more manipulation on the results later, code level.
Jasper could be very effective in manipulating the data before/during generating the report. By design, every variable, parameter or field in JasperReports could be a Java expression, imagine the possibilities.
How do libraries like Jasper Reports/ Crystal Reports and friends save me time when developing such reports?
Both Jasper and Crystal give you the ability to extract the fields from the query, Jasper also gives you abilities like extracting fields from XML or JavaBeans. (i dont know about Crystal)
What will they give me?
Those two are very good tools for making reports, i have made very complicated reports on Jasper, so the tools themselves are very advanced, its how you will use them that counts.
As others have said, what these tools give you is an link between your data and how you want to display it - be that a listing, chart, cross tab (grid of summarized values) etc, with options for your own parameters, calculations and queries.
If you are embedding your reports in your application, I'd say your selection of a reporting platform gets down to what technology are you comfortable with. For Microsoft, look at Crystal. For Java, look at JasperReports and iReport.
JasperReports does have sub reports.
Sherman
Jaspersoft (company behind JasperReports)
If you mean complex as in the data and manipulation, then code-level systems like Jasper and Docmosis will let you manipulate the data in code as well as in the query. You can combine the best of SQL with the best of code algorithms to get your report data ready. This will save you time if maintaining simple SQL + simple code is better in your environment than maintaining complex SQL.
It depends on your company and your skills. If you're in a small environment where you control everything, have access to anything, can download and install whatever you want, and you are a programmer and Reporting is more of an annoyance, Jasper has a lot of options. You need to do the hard work yourself, but you have the capabilities to do it.
But if you are in a company, like many people are, where the DBA controls the database, the SysAdmin controls the servers, you can't download and install whatever you want, things need to be checked in, tested, approved, etc, Reporting is something people need now, not after you figure out a way to code something that Jasper Doesn't offer, and your job is more a part of Reporting and Analysis over programming, then Jasper is a horrible tool.
Plus, like it or not, the other tools have far more support and help. Jasper is a bit useless when it comes to simple help. Search all the Jasper Forums. Look at any other forum about Jasper. Most questions go unanswered. And if you post something, it's very likely your question will never be answered. Or the answer isn't close to what you need.
It's a double edged sword. Jasper gives you a lot of freedom, but a lot of it is a bad tool to use for the real corporate world. Unless you have a job where you don't do much all day, Jasper takes too long for simple things to get done. If it's about getting reports to the right people at the right time, stay away from Jasper. Nobody really has the time or understanding to sit and figure out a work around and write up some code if a report needs to be done yesterday. End users don't care. It's the age old problem. It's built for techies, not for users. And the Reporting world is more about the users than the techies.
It's hard to say with the not so detailed info you provided, but I have 14 years experience with Crystal Reports and can tell you that it's very powerful. You can manipulate the resulting dataset in Crystal Reports in many ways. Crystal Report has a very decent internal program language to do this. And then you'll have subreports, which will save your day if it get hard.
I never found a report builder that can math Crystal Reports, especially looking at it's low price. If money isn't the problem then you can also look at List & Labels, www.combit.net.
One major thing Crystal Reports gives you is the ability to do Subreports--that is, multiple, related queries that return nested result sets. This can really simplify the individual queries your write. Take a look at http://vb.net-informations.com/crystal-report/vb.net_crystal_report_subreport.htm
Are there any open source tools that automate the functionality of finding the number of usages of a Java API? I can figure out this information for one class at a time in my IDE. I want to use this information to create a rudimentary report on the speed of adoption of a particular library. I would create a daily report on the number of usages of dozens of classes, and I would report on several code bases.
I'd go with one of those tools for analyzing dependencies in Java code. Let it work on your source tree, a package or a single class and see if you can export the results to XML or something like that. I've used Dependency Finder in a project about two years ago and I think it should do what you want. Not sure about the export to XML, though.
In Eclipse you can right click on a method name or class and go to the References menu and from there you can choose the scope of where you want to search for classes that reference that item.
Is that what you need?
I'm going to try Macker. Its style is to report references to configured classes as errors, but that's fine. It can be run from an automated build. Thanks Robert.