Enabling Cache in Jasper Server - jasperserver

I am having a few reports in Jasper Server. I am accessing the reports on another server using rest-api for Jasper. The report is loaded there successfully.
My Problem
The report fetches data from the database every time and fills it. When there is too much data, it takes a lot of time to build and fill the report.
What I want to do?
I want to know whether there is any kind of cache option in Jasper Server which downloads the report image to the server for the first time when it is loaded for the first time. When it is loaded for the second time, it should load the downloaded report rather than fetching the data and loading the report again. Is there any option for this in Jasper?
Update
Can the adHoc cache be used for this purpose?

If you for example converted the image to a BufferedImage and pass it in as a parameter, you have to option to set
isUsingCache = true
for these elements. This will load them from the cache rather than fetching them again. For this to work you will have to configure a cache on your Jasper Server.
To cache report jobs and OLAP connections see here and for querys see your mentioned adhoc cache here.

Related

TABLEAU FILTERS AND SERVERS

There is an automated report on Tableau server set to run each business day. When we open the report, the filters are still present, but there are no results (no data, no viz). There are also no errors. What are some of the possible explanations for why there would not be data present in the report? How to Describe to check for each possible explanation?
2.Tableau reports that connect to multiple servers. Assume that one of the servers went down, it’s unclear when it will be back online, and that this server is the most widely used data source. What to do immediately to minimize the impact on business customers?
You are lucky that question is not closed normally these type of questions are not entertained in SO
There are no errors and no data
Since filters are present in reports possible reason would be filters are active on the report are not fetching any data to report hence you are getting blank report and no errors. For E.g if you run the report for emp ID 100 and there is no emp id with number 100 then no data is fetched from database and report will be black.
So possible debug way would be check the applied filters and check in database if there is any data for those filters and if database access is not provided then provided different values for the same report and check data.
one of the servers went down, it’s unclear when it will be back online
Normally in a live scenario there will be back up servers when primary server is down you need to connect to the back server and minimize the impact and check for the solution for primary server to back online ASAP

Scheduled instance of report sending stale data

I have a scheduled instance emailing to a user. The instance works fine and user gets email. But the data in the report attached to the email is stale. It is missing item codes that do show up in the report if you go view it directly in web browser at BO server.
If I create a new instance scheduled to send to me - data looks up to date and good to go. If I add myself on the instance sending stale report and re-run the instance, I also get the stale version.
I'm worried about how whatever this is could be impacting other reports/users in the company without our knowledge. And also want to fix this one instance.
Is there some caching or other options that could be causing this? Why is the instance sending stale data?
Thanks!!
I figured this out. Turns out someone added record select formulas to the base report but did not re-create the scheduled instance. I looked at meta data from CI_INFOOBJECTS etc to see the record select formula on the instance. It does not match the updated record select on the base report.
This highlights a great best practice to keep in mind in this environment. KEEP YOUR FILTERS OUT OF CRYSTAL REPORTS! Keep your record selection and data transform logic inside SQL server in stored procs or views. That way you can update your report filter criterias without have to re create every scheduled report instance after every little report change :)

How can I integrate BIRT in GWT?

I need to integrate a BIRT chart engine in one of my app. Birt can generate an image as the chart output. My idea is to generate this chart image and then send it to the client side for display. Perhaps in a RemoteServiceServlet on the server. Is this the best way to do it ? or are there other techniques for doing it right ?
thanks in advance,
The most robust way to generate a "report," be it an image, a PDF, or any sequence of bytes that needs to be downloaded by the browser in response to a user action, is to make the client's RPC call return immediately with a URL, or token, at which the contents of the report will be available later. Later, in this context, just means that a subsequent request will be necessary to retrieve the contents of the report, but the pattern scales well to use cases where it may take a non-trivial amount of time to create the report.
The client sends an RPC request to the server with the parameters of the report.
The server adds the parameters to a report queue and responds with some token that can be used to retrieve the contents of the report later on.
The contents of the report are generated in a separate thread or perhaps on a separate machine if the report is computationally expensive.
If the report is guaranteed to only take a short amount of time to complete, it could be generated immediately, but in any case, the contents of the report must be written to a storage mechanism to be retrieved later.
(Optionally) The client polls some service to determine if the report is ready.
The client presents the report to the user.
In your case, the presentation would consist of creating an Image widget, perhaps with a URL pattern http://example.com/getReportImage/<Generated Token>. This request could simply block until the report is finished.
If the choice of the report identifier is a function of the report parameters and has stable semantics, you can get caching and de-duplication of work with little extra effort.
As for the choice of using data: URLs, it only makes sense if your users are using modern browsers and the image size is tiny. It's not appropriate for the general case.
Make the client send an RPC and let the server do all BIRT rendering. Once the server has finished, stream the resulting HTML (or image) back to the client. See http://www.birt-exchange.org/org/forum/index.php/topic/15515-build-birt-report-engine-with-gwt/
myServiceImpl.getReport(
"monthlySales",
"2013-02-01",
"includeGST",
new AsyncCallback<String>() {
public void onSuccess(String serverGeneratedBirtHtml) {
myVerticalPanel.add(new HTML(serverGeneratedBirtHtml));
}
}
);

Crystal Reports 9 Database Connection Issue

Crystal Reports 9 seems to save the database connection information inside the report file itself. I am having an issue changing that connection. I work with a team of developers who all have their own copy of a database on the same server. We are using Trusted Connections to the db. When we need to make changes to a crystal report, and we click the lightning bolt to execute the report, Crystal does not ask for login information to the database. It actually ends up connecting to the last database that was used when the report was saved last.
We came up with 2 workarounds:
Take the database that crystal thinks it should connect to offline, then crystal will ask for login info.
Remove permissions for the username that is making the crystal change.
Neither of these are acceptable for us. Does anyone know how to remove the crystal connection from the report file?
We have tried Log Off Datasource Location and all of the settings in the Database Expert.
UPDATE
I still have not found a solution that fits my case. But our newest workaround is to load up a crystal report and just before you click the lightning bolt (to run report against the database), unplug your ethernet cable. Then when Crystal cannot find the database, plug the ethernet cable back in and it will allow you to choose a different database server and name.
You could use a .dsn datasource file in a user-specific location (i.e. the same path for every user, but a different physical location) and point Crystal Reports at that. For example, on everyone's C drive: C:\DSNs\db.dsn, or on a network drive that is mapped to a different location for each user.
You can get more info on .dsn files on MSDN:
http://msdn.microsoft.com/en-us/library/ms710900(VS.85).aspx
We are using such way (using sql authentication however):
open report
database - log on server
database - set datasource location
refresh/preview
You may disable your [domain user] access to dev database, should help too :)
I am probably answering too late to have any chance at the bounty, but I'll offer an answer anyway.
If you are running the Crystal Report directly or with Crystal Enterprise then the only way I can think of to do this is by using a dsn as paulmorriss mentions. The drawback to this is that you'd be using ODBC which I believe is generally slower and thought of as outdated.
If you are using this in an application then you can simply change the database connection settings in code. Then, everyone can develop the report against their own test database and you can point it to the production database at runtime (assuming the developers database is up to date and contain the same fields as the production database).
To do this you should be able to use a function like the following:
private void SetDBLogonForReport(CrystalDecisions.Shared.ConnectionInfo connectionInfo, CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument)
{
CrystalDecisions.CrystalReports.Engine.Tables tables = reportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
CrystalDecisions.Shared.TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogonInfo);
}
}
For this to work you need to pass in a ConnectionInfo object (which will contain all of your login information) and the report document to apply it to. Hope this helps.
EDIT - Another option, that I can't believe I haven't thought of until now, is that if you are using SQL Server you can make sure that all of the development databases names are the same, then use "." or "(local)" for the server and integrated security so that everyone effectively has the same connection info locally. I think this is probably the best way to go assuming that you can get all of the developers to use the same setup.
EDIT Again :)
After reading some of the comments on the other answers, I think I may have misunderstood the question. There is no reason that I can think of why you wouldn't be able to do the steps in Arvo's answer outside of not having rights to edit the report, but I'm assuming that you've been able to make other changes so I doubt that is it. I assumed that to get the report to work for each developer you had been doing these steps all along.
Yeah I agree Crystal Reports is a pain. I have ran into the same problem in the applications that I have built that I was forced to use it.
1- Log off the server(inside crystal right click the database and log-off)
2- Click on the database and change the database location
If you are logged on and change the database location it doesn't seem to stick
You can set the logon at runtime. See this question...
How do I change a Crystal Report's ODBC database connection at runtime?
If you used ODBC, each dev could point their DSN at the appropriate database. Essentially pushing the connection string into the DSN and out of the crystal report.

How to prevent Crystal webserver refetching data on each page

We're using Crystal 11 through their webserver. When we run a report, it does the Sql query and displays the first page of the report in the Crystal web reportviewer.
When you hit the next page button, it reruns the Sql query and displays the next page.
How do we get the requerying of the data to stop?
We also have multiple people running the same reports at the same time (it is a web server after all), and we don't want to cache data between different instances of the same report, we only want to cache the data in each single instance of the report.
The reason to have pagination is not only a presentation concern. With pagination the single most important advantage is lazy loading of data - so that in theory, depending on given filters, you load only what you need.
Just imagine if you have millions of records in your db and you load all of them. First of all is gonna be a hell of a lot slower, second you're fetching a lot of stuff you don't really need. All the web models nowadays are based on lazy loading rather than bulk loading. Think about Google App Engine: you can't retrieve more than 1000 records in a given transaction from the Google Datastore - and you know that if you'll only try and display them your browser will die.
I'll close with a question - do you have a performance issue of any kind?
If so, you probably think you'll make it better but it's probably not the case, because you'll reduce the load on the server but each single query will be much more resource consuming.
If not my advice is to leave it alone! :)