Birt page headers and footers - java

Is it possible to add headers and footers to a birt report programmaticly? I need to add page numbers, page count, page n of m, date, and file name and things like this. I know how to do this in the eclipse report designer, but I need to do this in java. Is this possible?

This is entirely possible using Java. Although this is a much more overall tutorial, please take a look at the link below. Also note that you can find more references online for how to create BIRT tutorials using Java.
https://wiki.eclipse.org/Java_-_Build_Dynamic_Table_(BIRT)

Related

How can i extract a dynamic string/word from a website using Java

Hello everyone here is my problem.
I want to extract 2 words from a website, the words are "won" or "loss". If i can find those 2 words on the website i will be able to write the program i am working on.The problems i have are...
When i write a java program to get the html code from the site it only gives me the html code that is not changing ie: it doesnt giving the dynamic php code parts.
When i "inspect elements" on the website it gives me exactly what i want. It says i either won or loss in the html tags . However if i simply view source it doesn't show me that dynamic php code that u would see when inspecting elements.
Is there a way for me to write code that looks at "inspect elements" for the website and keep track of the part of the html code that is changing between "win" or "loss"?
I've had trouble with something like this before and since you lack details I will give you the best answer I can...
More information that will be helpful to know maybe if you edit include,
Code... Show me what you got
The html code
APIs or frameworks used in you application
So the issue seems like when you request the site the information is not there. Normally this doesn't happen since most webpage display information at load time.
These days we do a lot of stuff with Javascript so therefore that is probably the part you are having problems with. Javascript can load information onto the page dynamically at anytime. It need not me at load time and even if it looks like it by eye that its there when the page loads it may not be since it's too fast to notice.
Look into the javascript code and see if you can find a get, post, or put action and see if you can follow that to where it loads the page. Then mimic the request in your program.

Can Jodd provide functionality like apache tiles framework?

I am using jodd in my project. I am using lots of functionality jodd like madvoc , petite. I am looking functionality like apache tiles framework I have seen and read the post http://jodd.org/doc/decora/ but I don't get to much. Can any one provide working example of decora.
Ok, this is not short question - so please be a bit more concrete here on StackOverflow :)
Decora is quite simple and somewhat different then Apache Tiles. It reminds on old, good SiteMesh. Now, let me explain how it works:
with your business logic, create an design-free html page. Generate the content right in the <body>.
Now, create a template with design, colors, images... Choose where you want your content to be injected; like inside certain div.
After you apply Decora, the body content from the page will be decorated with the template, by inserting it into this div.
This is how it works in a nutshell. You have working example in Uphea but just note that is a bit older version of Jodd used. Also, there is quickstart project, that has Decora configured.
Decora is more powerful then above - you may have more regions on one page, set the header tags like title and so on. You may use html tags for marking the regions, or JSP tags, etc.

how can i create reports in a java web project?

I need to have a preview&print option on some of my pages in order to print some tables containing information.
Is it possible to create a template page containing headers and footers and the information contained in the html table? It's the first time i'm doing this.
I've used once Crystal Reports in c#. Are there any similar plug-ins / sdks available for Java? If so, how can i accomplish this?
Of course Jasper Reports will do.
If you already have the data displayed in the page and need it only style differently, you can do it using only CSS - just define appropriate style for media type print.
I think http://jasperforge.org/projects/jasperreports will be fine for this.

Is it possible to use flashvars with JBoss?

I'm part of a team developing a product using JSF 2.0 and I was asked to investigate the possibility of including FusionCharts free in the app. I have tried different ways of inserting a simple chart in a JSF page but with no luck.
On of the methods involves using the elements OBJECT and EMBED but hhen I try to use them I get a "null source" error from JBoss. From what I could find online (through Google), I am under the impression that 'flashvars' isn't quite compatible with JBoss. Is anyone here able to confirm this? If this is the case, what workaround would you suggest me?
Other ways I also found online didn't show the chart not even an error message.
Thanks in advance.
It is hard to tell what the other methods quoted were, but the preferred way of embedding flash is to use swfobject, a javascript library that does not require any special tags (nor server-side support).
It boils down to preparing a div for your flash content, giving it an id, and then calling a single function that takes the swf file url, size of the clip, flasvars and so. The javascript could easily contain EL expressions.
You might want to read this:
http://www.adobe.com/devnet/flashplayer/articles/swfobject.html
but skip to the Under the hood: dynamic publishing section, you will not be using the static publishing nor GUI.
The probable solution might be to pass the value of the flashvars as querystring of the user loading the chart swf file.
e.g.,
Column3D.swf?debugMode=1&dataURL=mydata.xml&registerWithJS=1&chartWidth=200&chartHeight=300

Is there an equivent library to Java's DisplayTag in PHP?

For a long time in the Java/JSP world I used to use the Display Tag library to generate a table that would allow you to sort a table, and export the table as a CSV file.
Is there anything like this in a PHP library that I could use?
The answer, from my searching, appears to be no. I wanted one too--love displaytag.
If you want a php only solution, Structures_DataGrid seems to be the best solution. Here's an article about it. This handles paging and sorting, but no exporting. Not sure how supported it is, either.
Another answer appears to be to use javascript to do paging and sorting, and roll your own php export functionality.
The state of the web is significantly different than it was when displaytag was created (ie, AJAX supported with a rich toolset), so I'm not sure there ever will be a full replacement. Why do sorting and paging with a call to the server when you can do it on the client?
Here's a jquery plugin that supports paging and sorting, and here's another one--all you need to do is have your php generate the table correctly.
As far as CSV exporting, there are tons of snippets out there. Here's one that looked good to me.
As far as I know PHP can't dynamically change the page (for sorting the table etc). You'd probably need to use something like javascript. I know that jquery has a table sort library.
PHP could do the CSV output. Make a link to a page that queries the database and uses the header() function to output a csv file - like this. Stackoverflow also has a couple similar solutions.
Good luck!
I think there is a method to deal with CSV in PHP. It is fputcsv(). It doesnt sort a table or anything like that it just converts an array into one line of csv.
Here is a link to it on the PHP website:
http://us.php.net/manual/en/function.fputcsv.php
You could try a scaffolder like -- http://www.aaronharp.com/2008/08/30/php-scaffold-class/ or -- cakephp. I don't think there is an included function that does that though.

Categories

Resources