I would like to make a REST call to a report and provide the datasource as a parameter at runtime such as this:
http://somereporthost.com:8080/jasperserver/rest_v2/reports/reports/Recently_Created?datasource=ds_test&user=doej&begin_date=2012-12-04
Given this example, in the use case I have in mind, ds_test would already exist as would others (ds_test2, ds_test3) so that any datasource could be specified at runtime.
Is it possible to specify a datasource at runtime?
I have seen one thread which includes changing the datasource associated with a particular report but unless I misunderstood the solution, I see potential race-condition issues.
I saw another one which creates a copy of the report on the fly with the desired datasource but I think this would create the need for some housekeeping when reports are updated and seems to be overkill.
I'm currently using release 6.2 of JasperReports Server. I think the way this is supposed to work is by referencing user attributes, and defining as many execution users as datasources you need.
Please take a look at this answer:
https://stackoverflow.com/a/37926230/5731158
Related
I have a requirement to generate reports in PDF and Excel format. For the same I have chosen Jasper. Now require some help from your side to identify the best approach on the same.
Note - My queries are dynamic in nature.Like in some scenario then will provide name in some scenario they will provide dates not name and in some scenario both.
Approaches I have identified are given below.
We can create data source and query in JRXML and execute the same.But not sure query will be dynamic or not. I am personally not prefer this approach because from java I can pass the connection from pool.
We can pass the query and connection both from the Java side and then Japser will execute the query.
We can query in java and then pass the List of bean to the Jasper for report creation.
Now need some suggestions on the best approach among above and also of any approach suggested apart from the above.
To me, option 3 is best. I did that previously.
For mine, I had a master report containing conditional sub-reports. To do that, I have build sub-report's .jasper from their .jrxml and passed my List of bean so that I don't have to re/compile the .jasper from .jrxml again(My master report was in .jrxml and condition for sub-reports where set there).
Another advantage is, you don't have to change your jasper files if you want to change your logic in query level-just leave them untouched once done.
So, I think , option 3 is good to go.
I would like to change the properties of multiple diagrams together rather than clicking on them one by one. Does anyone know how this can be achieved?
You can use the scripting facility of Enterprise Architect to loop the diagrams you would like to change and update them.
See this section of the manual to get help.
There is a bunch of example scripts included with EA, either from the local scripts, or from the EAScriptLib MDG.
Another source of examples is my Github repository: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library
You could write a SQL to manipulate your database. t_diagram.PDATA holds a long cryptic string where one part is ScalePI=0; (which is the default for no scaling). You can alter that to be ScalePI=1; (meaning scale to one page).
String manipulations vary from database to database. So you need to write your own which you can execute in a script using
Repository.Execute("UPDATE t_diagram ...")
Note that you should test this in a sandbox first since invalid SQLs can easily disrupt your whole repository.
Is it possible to add a Ticket Report to the Available Reports via a plugin, so that after installing the plugin it becomes automatically available? Or would one have to manually save a custom query with the intended columns and filters?
If it is possible to do this via python code, what is the Trac interface to be implemented?
You can insert the reports through an implementation of IEnvironmentSetupParticipant. Example usage in env.py. In env.py the reports are inserted in environment_created. You'll want to insert reports in upgrade_environment. Example code for inserting the report can be found in report.py. needs_upgrade determines whether upgrade_environment is called on Environment startup so you'll need to provide the logic that determines whether your reports are already present, returning False if they are present and True if they are not. If True is returned, then upgrade_environment will get called (for your case environment_created can just be pass, or it can directly call upgrade_environment, the latter being a minor optimization discussed in #8172). See the Database Schema for information on the report table.
In Trac 1.2 (not yet released) we've tried to make it easier to work with the database by adding methods to the DatabaseManager class. DatabaseManager for Trac 1.1.6 includes methods set_database_version and get_database_version. This is useful for reducing the amount of code needed in IEnvironmentSetupParticipant.needs_upgrade when checking whether the database tables need to be upgraded (even simpler would be to just call DatabaseManager.needs_upgrade). There's also an insert_into_tables method that you could use to insert reports.
That said, I'm not sure you need to put an entry for your plugin in the system table using set_database_version. You can probably just query the report table and check if your report is present, use that check to return a boolean from IEnvironmentSetupParticipant.needs_upgrade, which will determine whether IEnvironmentSetupParticipant.upgrade_environment gets called. If you are developing for Trac 1.0.x, you can copy code from the DatabaseManager class in Trac 1.1.6. Another approach can be seen with CodeReviewerPlugin, for which I made a compat.py module that adds the methods I needed. The advantage of the compat.py approach is that the methods can be copied from the DatabaseManager class without polluting the main modules of your codebase. In the future when your plugin drops support for Trac < 1.2 you can just delete the compat.py module and modify the imports in your plugin code, but not have to change any of your primary plugin logic.
I apologize if this has been already asked but my searches have had little luck. I've also tried MSDN forum's, but its obvious that I need the big guns for this one ;)
I am using VS2008 (SSRS 2008 R2) to create a series of subreports. Each Subreport queries 1 or more Web Methods from a WCF Web Service.
When I run an rdl as a stand-alone report, everything renders properly. When I run that rdl as a subreport, I receive an error recommending that I check the log (details, and steps to reproduce below.)
Simple Test (No Subreports):
Using the instructions found in the article Reporting Services: Using XML and Web Service Data Sources I was able to create the necessary Shared Datasets for each web method.
I successfully created a report (SubTest.rdl) utilizing a Shared Dataset for a Table.
The dataset's underlying web method contains no parameters (trying to keep it simple).
SubTest.rdl renders correctly!
So far so good.
Test 2: Master/Subreport structure
created a Parent/Master report (MasterTest.rdl)
added a Subreport Report Item, and specified "SubTest.rdl"
Note: No Report parameters are specified, as SubTest does not have any parameters defined.
I receive the following error during the rendering of the MasterTest.rdl report:
Warning 1 [rsErrorExecutingSubreport] An error occurred while executing the subreport 'Subreport1' (Instance: 5iS0): Data retrieval failed for the subreport, 'Subreport1', located at: /SubTest. Please check the log files for more information.
Additional Testing:
To ensure that my subreport is properly defined in MasterTest.rdl, I altered SubTest.rdl. In SubTest I removed the DataSource, DataSet, and Table from "SubTest.rdl" and insterted a TextBox filled with the words "Output From Subreport". This rendered properly in the Master report, indicating that the problem specifically relates to my Web Service Datasource/DataSet.
Questions: :(
Is there a way to accomplish this task?
If this is not possible, can anyone suggest a workaround for providing Web Service xml to a subreport?
Also, per the error message: Any idea where I can find this log? (because this is running in Visual Studio, checking the SSRS logs folder on my local machine did not help, nor did running VS with logging enabled.)
A workaround that I could not get to work:
I tried to follow the instructions in the linked article for passing XML to a subreport as a parameter, but
The master passes the xml as a scalar string. Because I am querying
a web service and not using a data set where each row contains a col holding the XML, I only have the resultant dataset to work with. Basically I need to convert a data set to a scalar.
I had difficulty following the instructions (even if I could solve problem
1, I'm not even sure that I properly defined the dataset and
parameter - how do I get fields when the data is not known until
runtime?)
Thank you for any help you can give. This has been driving nuts for days!
I remember seeing a trait that will automatically add the created and updated dates when using either lift's Record or Mapper ORMs.
The question is, is there a similar thing for Squeryl to automatically set the date/time the record was inserted and, less importantly, the last date/time it was updated?
If not, is it possible to make one?
There is no existing trait you can mix in to do it, but if you are using 0.9.5-SNAPSHOT you can create your own using Squeryl's lifecycle callbacks. Take a look at this message for more info: https://groups.google.com/forum/#!searchin/squeryl/lifecycle/squeryl/8FY7n0DN5fs/O2O8OhqVPSUJ. If you run into any trouble post a message to the group and we'll do what we can to help you out.