Looking for an alternative to JasperReports [closed] - reporting

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Some day ago my boss asked me that he wanted invoices in PDFs from out web application. Given that everybody uses JasperReports and iReport for design I tried it. My web app is based on Java+Hibernate and Spring. At the beginning Jasper seemed fine and iReport too. Anyway I've been stopped by two things:
iReport is the slowest thing I've ever seen in my life.
More seriously, I've certain beans that have some class hierarchy and it is very complicated to handle this in Jasper. Everybody in my office uses Jasper with SQL queries, and that way it is an easy and handy tool, but I spent my entire day trying to map my beans to reports and subreports and very little works.
I've seen DynamicJasper, but, it seems that I can't design reports with it. What do you think? Are there easier to use alternatives?

If time is of the essence (as is usually the case when your boss hands you something) I would recommend checking out iText (main site is here).
It is very, very simple to learn (you can have it up, running, and generating simple "Hello, PDF!" examples in 20 minutes) and can export just about anything into PDF: tables, lists, charts, images, hypertext, etc.
By my own admission, JasperReports implementing its JRBeanCollectionDataSource is a more elegant, flexible, permanent solution for you. But if you need a quick-n-dirty library to just produce PDFs, and looming deadlines are drawing nigh, I would download the iText JAR and have at it.
The site is loaded with practical code examples for just about anything you would want to accomplish.
Unlike JasperReports, iText is not a report generator. Its just a PDF generator (which, from what I can tell in your question, sounds like all you need). So, for any particular Bean, you would just select the properties you want exported to the PDF invoice, and use the Chunk, Paragraph, etc. classes to append them to the document as you need:
// Your POJO/Bean/VO
Employee oEmp = new Employee();
Document oInvoicePdf = new Document();
PdfWriter.getInstance(document, new FileOutputStream("/invoices/2011/Invoice201.pdf"));
document.open();
document.add(new Chunk("Employee's name is : " + oEmp.getName()));
document.close();
Even if this is not what you're looking for, at all costs I would recommend you steer clear of Apache PdfBox. In my humble opinion, it is pure evil and will only break your heart.
Hope this helps, and best of luck!

As an alternative to iReport you can try JasperWave designer for JasperReports.
To address the second issue why not to write some helper java code that translate beans structure to report structure? In any case it is always not easy to map java objects to some kind of flat structure. Create some java interface that will hide the complexity of underlying beans structure. Not sure that the second issue is the the reason to look for alternative reporting solution.

Related

Can I create a flow chart (no tree chart) using D3.js [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
can I create a flowchart like this one:
starting form a json object using the D3.js library?
What should the json structure look like?
Have you got any example I can analyse?
Thank you very much.
can I create a flowchart like this one?
D3 is capable of doing it.
starting form a json object using the D3.js library?
Yes
What should the json structure look like?
Depends on how you approach the project. I'm using force layout and removing the force, so my JSON is
{node:
[{
id: 1,
title: 'title'
}],
link:
[{
source: 0,
target: 1
}]
}
Have you got any example I can analyse?
For your inspiration
http://marvl.infotech.monash.edu/webcola/
http://www.coppelia.io/2014/07/an-a-to-z-of-extra-features-for-the-d3-force-layout/
Starting point https://github.com/mbostock/d3/wiki/Force-Layout
how to wrap your text in block http://bl.ocks.org/mbostock/7555321
D3.js is not suited very well for this kind of visualization. The visualization is just too complex to do a simple mapping from data to SVG
Not sure why, but IMO flowcharts are one of the simplest types of diagrams, blocks and lines that connect them. D3 has built-in means to draw nodes and connectors. Yes that is not out of the box, ready to use solution. But all you need to do is learn and customize.
In my humble opinion D3.js is not suited very well for this kind of visualization. The visualization is just too complex to do a simple mapping from data to SVG (and that's what D3.js is mainly for: generating DOM (documents) from Data through concise mappings).
You can work around those limitations by introducing more logic in between so that data is not directly being displayed, but rather a model is being created, some calculations are being done and then the result is transformed to SVG by D3. This is what dagre is trying to do and it works rather well.
However your graph has some special constraints that are currently not supported by simpler implementations of that layout algorithm: In the last layer you get a fork-like rendering. In the "decision"-layer you assign constraints to the edges so that they leave at the left and right of the nodes, you also constrain the decision nodes to be on the same layer.
All of this information is not visible in the graph structure itself. Therefor you need to annotate that information into your model and tell the layout algorithm to honor these constraints. To the best of my knowledge, only commercial graph drawing library implementations currently support these advanced layout features.
yFiles for HTML is such a library: In this demo you can use the following JSON to get a result like this:
Switch to the combobox entry at the top: "5 - Complex Objects + Edge Labels"
And modify the JSON in the Nodes Sources, Edges Source and Node Template sections as follows:
Nodes Source
{
0:{'name':'Start',color:'green'},
1:{'name':'Read A,B,C',color:'yellow'},
2:{'name':'Is B>C?',color:'green'},
3:{'name':'Is A>B?',color:'green'},
4:{'name':'Is A>C?',color:'green'},
5:{'name':'Print B',color:'green'},
6:{'name':'Print C',color:'green'},
7:{'name':'Print C',color:'green'},
8:{'name':'Print A',color:'green'},
9:{'name':'End',color:'red'}
}
Edge Source
[
{from:'0', to:'1', label:''},
{from:'1', to:'3', label:''},
{from:'3', to:'2', label:'No'},
{from:'3', to:'4', label:'Yes'},
{from:'2', to:'5', label:'Yes'},
{from:'2', to:'6', label:'No'},
{from:'4', to:'7', label:'No'},
{from:'4', to:'8', label:'Yes'},
{from:'5', to:'9', label:''},
{from:'6', to:'9', label:''},
{from:'7', to:'9', label:''},
{from:'8', to:'9', label:''}
]
Template
<rect fill='{Binding color}' stroke='LightBlue' stroke-width='2'
width='{TemplateBinding width}'
height='{TemplateBinding height}'></rect>
<text transform='translate(10 20)' data-content='{Binding name}'
style='font-size:18px; font-family:Arial; fill:#000; text-anchor: left;
dominant-baseline: central;'></text>
Note that using a different kind of JSON is possible, too (as the demo shows). I don't believe that the JSON format is going to be a problem in any way at all and as you can see you get a decent result, but still the constraints I mentioned have not been considered and added to the JSON. Unfortunately adding these constraints cannot be done through the demo interface I'm using above right now, but needs to be done by adding more code to the actual source code of the demo. You can see how these constraints work in another demo (though without the JSON) in this interactive layout demo.
Putting all the bits and pieces together you can easily achieve this kind of result, automatically:
The same example can be found and tried out interactively in this interactive flowchart layout demo.
Disclaimer: I work for the company that creates the yFiles (commercial, price range: 0k to ~104k USD at the time of writing) library, however on SO/SE I do not represent my employer. My posts, thoughts, and recommendations are my own. This is not an ad. Feel free to use a different solution. I've been researching this topic for almost 25 years and that's because I am here. I feel this is the best solution and answer to the OP's question.
I have been looking into this today and flowchart.js looks promising. It supports start and end points, operations, and conditions. You can control which side of the drawn elements the lines come out of, etc.
http://adrai.github.io/flowchart.js/

How to read the contents of a PDF file?

I'm currently working on my thesis, and the application is going to use natural language question answering. I've read about several ideas and followed discussions about natural language question answering, but I can't seem to find good answers.
Question: How do I get answers from PDF, plain text, or MS Word file?
If I want to search for a topic in a PDF file I would use Ctrl+F to find the topic/idea, but it wouldn't return all the details; just like a table of contents, it would give the starting page and end page of a chapter. That's what I want for the logic. It would determine where the chapter ends without using pages or numbers. Is there any algorithm capable of doing that?
I have used iTextPDF to read PDF file Contents.

#! (hashbang) and Google SEO [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 12 months ago.
Improve this question
I've read over the Google specification for crawling AJAX-enabled pages. Since part of Google's indexing method uses the URL itself, will converting to !# negatively effect SEO?
For instance, if I have a page at www.mysite.com/surfing, Google will be likely to rate it highly if a user searches for "surfing" because it has "surfing" in the URL. Would the same be true for www.mysite.com/#!surfing or does it ignore the hash fragments for the purposes of weighting the URL itself?
Perhaps you have already read in the google Ajax-crawling instructions that the !# is actually transformed into ?_escaped_fragment_ by the google crawler. So let's use your example:
www.mysite.com/#!surfing , the google crawler will see the link as www.mysite.com/?_escaped_fragment_=surfing . So it comes to the question : what is better for google SEO a link with a paremeter ?_escaped_fragment_=surfing or without one /surfing ?
Search engineer representatives have confirmed on numerous occasions that URLs with more than 2 dynamic parameters may not be spidered unless they are perceived as significantly important (i.e. have many, many links pointing to them). So unless you're using too many parameters in the url, you don't have much to worry about. If you haven't done it already, you can always read the detailed google documentation https://developers.google.com/webmasters/ajax-crawling/docs/getting-started . Now, just an advice - don't rely on # in your AJAX website. Use history.pushState() to change your url to whatever you wish. I use #! only on browsers that don't support history.pushState() like IE. The problem with the SEO with #! doesn't come form the url but from the difficulties in the Server Side processing of the information needed to provide HTML snapshot for the crawler.
The question is old.
Now Google not supports AJAX-Crawling anymore:
https://webmasters.googleblog.com/2015/10/deprecating-our-ajax-crawling-scheme.html
And this document officially deprecated:
https://developers.google.com/search/docs/ajax-crawling/docs/getting-started
So don't use hashbangs in URLs.
Traditionally, from SEO perspective, hash tag (#) is used to avoid the following issues
-Cannibalization issues
-Affiliate URLs (Here is a good article about how to use hash for tracking purpose instead of using question mark in the URL)
-Show limited content on the page (pagination issues)
The usage you are refering to is what Google recommends on how to make AJAX pages being able to be read by Google - https://support.google.com/webmasters/answer/174992?hl=en
For more info about hash tag and its SEO benefits, check this blog post - https://digitalreadymarketing.com/adding-hash-in-urls-seo-benefits/
In My personal opinion and 8 years in SEO & development It won't harm but it depends more on the site other parameters so adding the !# won't do harm...
Do you have the site URL so I can take a more in-depth Look ?
That could cause a problem if Google's crawler thought that there could be an infinite number of possibilities. Like with a ? in the url. But the answer beyond that is clear.
website.com/oreo-cookies
is more semantic and easier to understand for both people and crawlers than
website.com/#!oreo-cookies
But is this going to have a major impact? If you were a client paying me for SEO, I would tell you that your incoming text links with relevant keyword phrases from relevant related websites is far more important. I would also say that if you are submitting an xml sitemap for google to digest, and lots of popular websites are using the #! google will figure it out and ignore it.
So bottom line, if my content was worth linking to, and I made sure google was finding all my pages and indexing them, I would not worry about it.
I think that it will not harm your SEO in any way I am in SEO for last 5 years and haven't experienced such problem yet so don't worry about it. So my opinion is you can do it by adding the !# no harm !!

Need to create a "choose your own adventure" type guide - best approach to use

Basically need to ask user a set of questions and gather information along the way. Each question could have impacts on different questions down the road. Another example would be turbo tax's web interface, answering yes on some ?s may trigger future questions.
Seems like this would be a fairly common problem in software so I guess I'm asking if there are any existing solutions/Design Patterns out there that could help. Kind of seems like a state machine, but I think that is an oversimplification.
State pattern
Look at this picture which helps with choosing correct fonts which is called So You Need a Typeface (big image there!).
It asks you numerous questions and at some point suggest you one or several answers.
As I understand you want to create something similar but interactive and about another domain.
So, you need to construct similar graph with branching-nodes and leaf-nodes. It can be done very conveniently with the Composite pattern. If you already have (know) all possible questions (or if you know that at some point you will know all of them and will be able to add them manually to the system) then it's the way to go.
If you want something more dynamic and intelligent then the solution can highly vary from case to case.

Free alternative(s) to PowerGREP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 11 months ago.
Improve this question
First of all, great praise goes out to PowerGREP. It's a great program.
But it's not free. Some of its options I'm looking for:
Being able to use .NET regexp's (or similar) to find things in a filtered list of files through subdirectories.
Replacing that stuff with other regexps.
Being able to jump to that part of the file in some sort of editor.
Non commandline.
Being able to copy the results / filename and occurrences of the text.
Low overhead would also be nice, so not too many dependencies, etc.
And I need it on Windows.
I would suggest trying the new dnGrep. It's a .NET application that provides grep-like functionality and has almost all the features you specified.
Here are the features and a sample screenshot:
Shell integration (ability to search from Windows Explorer)
Plain text/regex/XPath search (including case-insensitive search)
Phonetic search (using Bitap and Needleman-Wunch algorithms)
File move/copy/delete actions
Search inside archives (via plug-ins)
Search Microsoft Word documents (via plug-ins)
Search PDF documents (via plug-ins)
Undo functionality
Optional integration with a text editor (like Notepad++)
Bookmarks (ability to save regex searches for the future)
Pattern test form
Search result highlighting
Search result preview
Does not require installation (can be run from a USB drive)
Feature-wise nothing even comes close to PowerGREP, so the question is, how many compromises are you willing to make? I agree that PowerGREP's price tag is a bit steep (not that I have ever regretted a single penny I spent on it), so perhaps something cheaper might do?
UltraEdit is an excellent text editor with very good regex support. It supports Perl-style regular expressions, and you can do find/replace operations in multiple (optionally pre-filtered) files with it. I'd say it can do everything you want to do according to your question.
RegexBuddy, apart from being the best regex editor/debugger on the market, also has a limited GREP functionality, allowing search/replace in (pre-filtered) subdirectories. It's also not free, but considerably less expensive than PowerGREP, and its regex engine has all the features you could ask for (the current version even introduced recursive regexes, and the extremely useful ability to translate regexes between flavors). Big pluses here are the ability to do a non-desctructive preview for all operations, and to have backups automatically be created of all files that are modified during a grep.
I use GrepWin extensively during development and on production servers - it doesn't support all the features you specify, but it gets the job done (your mileage may vary).
For a fast loading, fast executing program used to only find (no search and replace) then I've found Baregrep to be pretty good. It does subdirectories.
You might have a look on this:
Open Source PowerGREP Alternatives
Currently there're six alternatives to PowerGREP.
Get Cygwin for a bunch of free alternatives!
grep, sed, awk, perl, python... goes on.
But, oops! you want to stick to GUI.
I always wonder at how people wrap GUI around things like grep and get cash for that!
WinGrep seems to be free though and, yet comes with quite a punch.
Windows Grep is designed for searching plain-ASCII text files, such as program source, HTML, RTF and batch files, but it can also search binary files such as word processor documents, databases, spreadsheets and executables.
I do not know PowerGREP, but grepWin lets you search regexes in directories.
You can get GNU grep or Gawk.

Resources