BIRT, Android and reports - android

We have an IBM Maximo system that has BIRT reports built in. We are also in the process of writing an Andriod app that needs to be able to run a report (on the server) and get the PDF version back into the app (or at bare minimum, the HTML version of the report). Is there any built-in functionality for this with BIRT or Maximo??

My team have something similar, but we scrapped the idea of using the .rptdesign files stored on the maximo server, and solved it by setting up the BIRT runtime: (Download here).
If you have direct access to the DB you can setup the runtime with the report(s) you need and play around with the parameters.
Say that one have a report called "report1" stored on "localhost:8080" and the report contained 2 parameters called "StartDate" and "EndDate" this is how one would do it:
Instead of using the standard URL with the frameset servlet mapping: "localhost:8080/birt/frameset?__report=report1.rptdesign" and let the user run the report them self, change the servlet mapping to run.
To just run the report, without getting the parameter dialog to provide values for the two parameters, one just have to parse the parameters to the end of the URL - &StartDate=2011-01-01&EndDate=2011-01-02.
To download the file in PDF format append the viewer command option "__format=PDF" to the end of the URL.
So the end result will look like this:
localhost:8080/birt/run?_report=report1.rptdesign&StartDate=2011-01-01&EndDate=2011-01-02&_format=PDF
This will download the file in PDF format without any interactions to the actual BIRT runtime.
Hope this gives you some ideas anyways, I know it's not an optimal solution. But at least it's something.

Related

Android app - generate a non-editable report

I am new to Android development and would like some advice from some more experience developers.
The app I am developing is effectively a form for servicing products (i.e. does x work, does y work etc.. ). Once the form has been completed a "report" of some kind needs to be generated in a non-editable format! Initially I was thinking to display a confirmation page and when confirmed by the user simply screenshot the report, however I realise this is a hacky solution and would be rather limiting! So basically I would like some input on what options I have to implement such a feature! To be clear the output file MUST be non-editable... i.e. an image file or pdf!
Also FYI - the report file will be uploaded to a dropbox/a specified folder.
PDF files seem to be a good solution for you. I would rather create a Web Service to deliver the pdf, because some devices will be really slow creating a pdf, but if you decide to take a client approach, take a look at:
http://code.google.com/p/droidtext/
http://sourceforge.net/p/itext/code/5420/tree/tags/iText_2_1_7

Can't download cilent generated file in Android Chrome

Ok, there's a long history behind this one, but the gist is that we need to create and download a little bit of text CLIENT side, into a file called "test.lbl". Assume we can't access the server side.
The following code (coffeescript) does this by creating a Blob, converting it to a data url, and then clicking the link. This works GREAT in a desktop Chrome browser. However, in Android Chrome (not sure what version exactly, but I just installed it as of 3/5/13 from Google App Store) this simply won't work. In Android Chrome, the file starts to download and then just spins. (In fact, it shows in your "Ongoing" for quite some time, even after the browser is closed.)
Anyone know why this might not work in Android? Perhaps a different mime type will make it allow the file to be downloaded? We're dealing with internal tablets so we can relax any site specific security settings we need to.
Or, is there a better way to go about this entirely? (client-side generated text file download)
Thanks
$("#get-label").on 'click', (e) ->
e.preventDefault()
bb = new Blob(['test test test'], {type:'text/plain'})
evt = document.createEvent("HTMLEvents")
evt.initEvent("click")
$("<a>", {download: 'test.lbl', href: webkitURL.createObjectURL(bb)}).get(0).dispatchEvent(evt)
This is a known issue in Chrome for Android. I have raised an issue https://code.google.com/p/chromium/issues/detail?id=181032 - if you star that you will be able to see all the updates for it.

Downloading fails much more frequently on iOS than on Android?

In my iOS project, I use NSURLConnection to download files. My code is just like the http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html document.
In my team's Android project, we use Android's API to download the same files. Nothing special either.
Both the iOS and Android project have the same fail-retry mechanism, and both of them send the same statistic data to server.
The files they trying to download is between 1M to 10M.
The statistic server shows that for the same URL, download failure is 2% on android, but 20% on iOS! Since they are trying to download the same URL, it seems not the server's problem but more like a client issue.
Why iOS download would fail so frequently? Is there any special APIs I should use for iOS, to make the download robust? Currently I'm using NSURLConnection, and I've just found NSURLDownloader which is more convenient to write files. Will they be different for download success percentage?
P.S. the error I got by -
(void) connection: (NSURLConnection *) connection didFailWithError: (NSError *) , is usually -1005, NSURLErrorNetworkConnectionLost.
I'd suggest looking more into why you're getting NSURLErrorNetworkConnectionLost. Even if your device says it's connected, sometimes it could lose the connection and be attempting to regain it before the indicators update accordingly.
This is a good starting point for more information on better dealing with reachability. Checking For Internet Connectivity in Objective C
Otherwise, I recommend you post your download-related code so others can look for possible issues.

Creating an MS Word document in an Android App

I am working on a client project for an android app and wanted to confirm if the designed solution appears to be utilizing the most appropriate technology and resources.
The application gathers data from the user via a series of questions, compiles the data into a single human-readable document, then sends the document out via email. My client requires the delivered doc to be in MS Word format. I am currently building my doc in the app using xml, setting the extension type as ".doc", then sending. Since the latest versions of MS Word seem to have no problem handling these types of files, this seems to be the most appropriate solution.
Is there anything obvious that I am missing? Should I be handling this another way?
You aren't writing DOC files correctly. If really need to save .DOC files I suggest you read this .pdf regarding thd DOC file format put out by the OpenOffice team.
As you are already writing the file in XML consider using Microsoft's Office XML format instead of writing the XML to a .DOC file.

Read/write files on server from Android

I'm working on a small project for fun, which involves Android and a web server.
I want some suggestion on the protocol/model to use that is best suited for the following scenario.
Server side
I have setup the following 5 components:
A config file rule.csv which contains 6 columns and about 20 rows. Each row in that file a rule.
A "switch" file RUN.on or RUN.off
A Java program that runs according to those rules, if RUN.on exists
A cronjob that runs the Java program every 5min.
A PHP page. control.php?run=on will rename RUN.off to RUN.on
control.php?run=off will set RUN.off
On Android
An app that submits to control.php to change the running status.
Goal
Now I want to add a feature to that android app, such that I can view and add/remove the rule in rule.csv. That requires a Android <--> Server <--> File communication. However, getting the whole file using PHP, and transfer it back after editing does not seem to be a good way in this case.
Since this is a project just for fun, getting it to work is not my priority; I'd like to look for a good model that handles this kind of task and I'm willing to learn other languages if necessary. Any advise?
I'm guessing the rule file is kinda big or you would just transfer it.
Adding a new rule seems pretty simple - enter the data on the Android and send the rule to the server. But how do you want the Android user to pick the rule to remove? Can you just transfer the names of all of the rules, let the user choose the rule, and then just send the rule name back?

Categories

Resources