Dynamically generating reports in Pentaho and dealing with report definitions store in the database - pentaho

I am developing a reporting application where a user can select(and order) reports from a list of 100 reports and ask for a master report. This master report will contain all the selected reports in the exact order and with a table of contents listing the reports included in the master report. The reports available for the user to select (which could be 100s) are stored in the database.
My questions are :-
To generate the master report with the user selected reports, the only solution I can see is using the Reporting Engine API to generate a dynamic report into which I have to add the user selected reports as subreports. Is this the right and easiest way to approach this problem? Does anyone have samples of the Reporting Engine API usage especially to inject subreports in a Master report?
Since I am storing the reports in the db(blobs), I am trying to find a way to generate my sub reports with an inputstream rather than a URL as specified in ResourceManager.createDirectly(url, MasterReport.class), but haven't been successful till now. How can I generate reports from definitions stored in the database? There should be some resource abstraction.

Read your reports into a byte-array and then use the ResourceManager.createDirectly method as usual. That will solve your problem of parsing the reports.
You can parse them directly into SubReports by using
ResourceManager.createDirectly(bytes, SubReport.class)
These subreports can then be added to your master report as banded subreports. if you want your selected reports to start on a new page, make sure you set the "pagebreak-before" style on your subreport's report-header.
There is a resource abstraction: It is called "LibLoader" and you can create your own ResourceLoaders that deal with the problem of getting your data out of your database as raw-streams so that the ResourceFactory implementations can interpret/parse the raw-data.
But every database is designed differently and thus you as the system integrator have to write the glue code for it. We only can offer the interfaces.

Related

Advantage to using SSRS or Crystal reports when the output is simple and static?

I have an ASP.NET/C# web app in which the user needs to run reports with various criteria that will ALWAYS yield simple, 2-dimensional, tabular data. I'm tempted to use a sophisticated reporting engine like SSRS or Crystal Reports, but these seem like overkill, since there's really nothing to design (all outputs will be to CSV, or JSON for the browser to render in an HTML table).
In this scenario, am I eating too much complexity by trying to use SSRS or Crystal Reports? Should I instead just write custom classes to dynamically assemble SQL statements (based on user selections) that will be fired against the database?
Does SSRS or CR add anything that is of value (within the requirements constraints I've already described)...?
Its depend on your requirement if you want to minimal overhead on your web app then please go ahead and use your custom codes since you are not required any styling or extra functions.
Just get JSON objects and fill in HTML and go Head !!
I am working with ssrs So i will talk just about it:
ssrs is a very useful tool for building a Reports
all You need is sql server Stored Procedure to build your report
then deploy it to report server and use this report from your app
-now all you need in your app just one page for all reports and you path the URL
dynamically with report name
You need to know this :
-ssrs did not work correctly with all browser
for Exp :
-Print Btn just work with IE
so Mozila and Google you need to use java script to print Report
-some issue with criteria section :
there is no way to rename the 'select value' with drop down
so you need to use java scrip to handle it
also you find ( Null and chick box ) any customer did not know what null mean so
you need first to remove null keyword or to rename it to anther Keyword
also you need java script to do this
the most problem i have :
all reports in reports server so
when i go to a new client what i need
just Sql server no need to setup visual studio and ssrs tool
just to deploy all reports on client report server
its very bad ..
i solved this issue with tool i had make to deploy the all the report
and no need to setup VS just to deploy the report
i think that the most important problem i have
and all of it i found a work around to solve .. and it takes more time
finally :
use ssrs or CR its very easy to use and make report very fast no need to create a custom page for report and develop all its control just like print and export
report to PDF,excel or any type
but if you have a few report i think no need to use any reports tool

SSRS 2005 Subscription changes

OK this is my question(s) and its SSRS 2005 and SQL Server 2005/2008
I had been tasked with rebuilding a dozen or so reports that our users use on their data systems. We just build them and since every DB instance is schematically the same for all our clients, we push the reports out to their report servers for use.
So modified a great many reports, but the reports have blown away the clients subscriptions. So every user that uses these reports, that can be a great many seeing as how everyone can have their own set of parameters, has to run the reports manually or redo their subscriptions.
My company would very much like to avoid that, but I can not figure out how to change a report, and even with the same parameter set going in as the last report, keep the subscription there.
Even when I copy the report down to their report server and replace the old with the new using same name. The subscription is still there, but it gets modified.
I am looking either for a way to push down a subscription as part of the report, so that they will have minimal input to their subscriptions in order to tailor it to their needs
--OR ideally--
Upload a new version of the report to their report server and just have the subscription apply to the newest report that I have put on their server
It doesn't really matter which one but the second is best seeing as how individual users use the reports with individual names as a parameter
Many thanks in advance for anyone that can point me to the way to manage out subscriptions on my side, or enable my reports to assume the subscriptions of same named reports on their server.
--edit--
Want to put a clearer picture out there
I have a master copy of a report. The users use the report on their own systems.
I do some heavy modifications to the master copy of the report, and upload it to their systems. using the same name and same parameter set as the original report.
I want the subscriptions on their report server to find this report using the same name.
so XXX.report has a subscription. I change it to XXX.report locally, and upload to their servers. The subscriptions are not synching though.
Thanks
I'm not sure how you're accessing SSRS but you can use the following webservice methods to download and upload report subscriptions
ListSubscriptions
GetSubscriptionProperties
GetDataDrivenSubscriptionProperties
DeleteSubscription
CreateDataDrivenSubscription
CreateSubscription
Using those methods, you use ListSubscriptions to get a report's subcriptions. The Subscription.IsDataDriven property will tell you if it's data driven or not. For data driven subscriptions, use GetDataDrivenSubscriptionProperites to get the subscription properties, otherwise use GetSubscriptionProperties. All of those classes are XML serializable so you can save them to disk out of the box using the XmlSerializer.
To readd the subscriptions, use DeleteSubscription to delete the subcriptions one by one and then CreateSubscription or CreateDataDrivenSubscription to readd the subscriptions.
This is a hack though, because you should be able to modify reports without breaking the subscriptions. You should to the following to help diagnose the issue
Set SSRS logging to verbose for all components
Use the click once report builder to change the title of a report and see if the subscriptions break when you click save
Have the SQL profiler running on the ReportServer database to see what SQL is being generated when the subscriptions break
there's a tool called Reporting Services Scripter from Jasper Smith. I think it should work for you.
What I had to wind up doing was going back and change all the input parameters, including the sql content for the drop downs, back to what they originally were. Then playing with the SQL for the report to accept the new(old) parameters.
Thanks for your input. I accepted the web services answer as that is a path I will have to explore for our next update.

How to distribute a SSRS report?

(distinction, I'm talking about distributing a report--not deploying a report to a report server)
To our product we've recently added support for it so it can dump various stats to a database (mssql server). Since then, I've made reports (where the datasource is my own sql server). But if I want to get these reports into the hands of customers (pointing to their own database, obviously) so they don't need to make their own (or if they don't want/can't make their own) is there a good way to do this?
I'd rather not have to give instructions on how to use the report creator and have them copy/paste what I've done nor have them open it and change the datasource. I'm completely new to using SSRS and don't know any of its intricacies. I know I can query the database to see what reports are available, is there a way to just add an entire report to the database via code (c# or java)?
Assuming that they have SSRS installed and configured, and assuming that their DB (tables, SPs etc.) match your report - one of the way this could be done is:
When creating your report use a shared datasource (don't use one embedded into report)
Ask a customer to create shared data source in their SSRS instance under the same name, but pointing to their DB
Profit! That's it, all you have to to is to give them the RDL file, they will upload it to their SSRS. It will use shared datasource they provided to pull data from their DB

Reference the current CUID in Web-intelligence report in SAP Business Objects

When in the 'Modify' mode of a Web-intelligence report inside Business Objects, when using the Formula Editor with an object is it possible to identify the CUID from this in a Web Intellience Report?
I wish to display the CUID on each report, and was hoping there is some variable I can just refer to and it displays accordingly to whatever report I have open.
I don't believe there is a way for this to occur.
The reason is you are looking at 2 different items of data from the way Business Objects is internally structured. The CUID is part of the metadata stored in the repository database, while the data in the Web Intelligence Report (WebI docs) is store in the actual file that resides on the IFRS. When working with WebI docs via the SDK, they are 2 very different objects that are manipulated that relate to these different parts.
It might be possible to work around this using the SDK, but I have not tried it.
Recently found a guide to create universe on top of the BusinessObjects CMS database. Web Intelligence XI 3.x - Reporting off the BusinessObjects Enterprise CMS Via Data Access DDK Once you have the universe for the CMS database, you will then need to bring in all document names and the CUID. Then in the WebI report, you then filter the list of CUIDs using the DocumentName() function.
I wrote a note on CUID... May it help many
http://arkaandbi.blogspot.com/2013/07/a-note-on-cuid.html

Using subreports with Microsoft's ReportViewer control in local mode

Does anyone have a recommendation for an excellent reference on Microsoft's ReportViewer (VS 2008 flavour) when used in local mode? I'm currently using it but parts of it are a bit of a black box so I'd like to read up on the entire subject.
Especially want to start using sub-reports to display more complex parent-child reports. I'm assuming they work in a similar mode to Crystal Reports with which I'm reasonably familar.
Thanks, Rob.
The link to http://www.gotreportviewer.com is a good once but it does look like material on local sub reports and ReportViewer 2008 is a little sparse and spreadout across the net. It would be a subject worth blogging about so I will :-)
Here are a few headlines:
A subreport is a completely separate report but is linked to the master report using the standard report parameter mechanism. The master report is configured to pass one or more of it's fields (e.g. the primary key) to the subreport. The subreport typically then uses this parameter as a parameter to it's own query to load a dataset
Even though you may have defined a data source against the subreport when designing it, this isn't used when used in a master report. Instead you have to implement a handler for the SubreportProcessing event. The same handler is called for each subreport you add to your master report so you can query the parameters passed to the handler to determine the dataset to load.
The event handler is called once for each record in master report. For example, if the master report displays 200 records, the event handler is called 200 times but with a different parameter each time.
Because of this, you have to be wary of performance. The first report I ran had 2,000 records (perfectly okay for a flat report) but each of those 2,000 records fetched 20 child records for the subreport. It did run but took several minutes before the report was rendered
If you can structure your data so that a single dataset can be used containing data for both the master and subreport, then nested data regions have better performance - only one query to return 2,000 records not 2,000 individual queries. See http://www.gotreportviewer.com/masterdetail/index.html
Cheers, Rob.
I worked with the ReportViewer control at one point and was able to find some good information at http://www.gotreportviewer.com
Was the documentation insufficient? In what way?
Reporting Services and ReportViewer Controls in Visual Studio
Samples and Walkthroughs
ReportViewer Controls (Visual Studio)