Cascading input control based on multiple parameter---Jasper Server - jasperserver

I would be thankful if anybody help me in this regard.
I have three parameters as below on jaspersoft server. and I want to build cascading input control as follows.
Parameter1 is a list with multiple select.
parameter2 is also a list with multiple select.
but I want the parameter3 should be filtered as what I have selected from the above two parameter1 and parameter2.
I have tried the following third parameter3 query but getting the result one parameter1 or parameter2.
select id, name
where
$X{IN, samecolumn, parameter1} AND $X{IN, samecolumn, parameter}
please I would be thankful for the response.

There is a sample for this in the Jasper Reports demo data which comes with the server. This is not a part of the documentation as far as I know.
I searced for "cascade" in Jasper Reports Server and it is a report:
It is called Cascading multi select topic. Its description says: Shows cascading input controls. Multi-select and single select queries.

Related

Microsoft Access - Creating a form which looks up data between 2 dates

For my College assignment, I have to create a database in Access, I have done 99% of my database, apart from this section which I'm stuck on.
In my DB, I have a tickets table, which contains records on order information and a field containing a date. For my assignment, I have to create a Form which reads from a Query.
For example, in my Form i have already created i have 2 Combo boxes with the dates already pulled from the Query. I need to be able to drop down one of the boxes and input 1 date, and then drop down the other box and select a different date, press a button and it generate me a Report.
The part I am asking for help on is the expression which is used to look up the data inside the Query. I tried using this expression, which Access said was too complicated.
[Forms]![frmOrdersBetweenTwoDates]![Combo33] And [Forms]![frmOrdersBetweenTwoDates]![Combo36]
My full SQL query is:
SELECT tblTickets.CustomerID, tblCustomers.FullName, tblCustomers.AddressLine1, tblTickets.OrderNumber, tblTickets.OrderDate
FROM tblCustomers INNER JOIN tblTickets ON tblCustomers.[CustomerID] = tblTickets.[CustomerID]
WHERE ((("WHERE [OrderDate]") Between [Forms]![frmOrdersBetweenTwoDates]![Combo52] And [Forms]![frmOrdersBetweenTwoDates]![Combo54]));
My expression/query now returns the report, but there is no data inside the report. How could i fix this?
Cheers.
Should post the complete query statement. Expect the filter clause should be like:
WHERE [date fieldname] BETWEEN [Forms]![frmOrdersBetweenTwoDates]![Combo33] AND [Forms]![frmOrdersBetweenTwoDates]![Combo36]
However, I don't use dynamic parameterized queries. I prefer to use the WHERE argument of OpenReport (same for OpenForm), in VBA:
DoCmd.OpenReport "report name", , , "[date fieldname] BETWEEN #" & Me.Combo33 & "# AND #" & Me.Combo36 & "#"

Insert URL into BIRT Report that contains dynamic parameters

I am fairly new to BIRT and I am working on adding some new functionality to one of our existing reports.
We have an application that makes a call to BIRT to generate the report in question. When this report is generated I would like to include a URL at the bottom of the report.
The only issue is that the URL would contain two parameters that are different for each report that gets generated. I created a data source and a data set that I can pull the parameters from, but I am not sure how to create a URL with the parameters that relate to the particular report that is being generated.
I have read that you can create a label and insert a hyperlink, but this doesn't seem to be of much help in my situation.
The URL that gets inserted into the report would need to look as follows:
localhost:8080/Application?key=firstParameter&securityString=secondParameter
Please let me know if I did not explain my situation thoroughly or if you need more clarification.
Best Regards,
-Dave
There are multiple ways to do this.
For example insert a new "Data" element to the report, set the datatype to "String" and enter as expression the text you want to display, i.e. "My URL" (with quotes because it is an expression).
Then click on "Binding" tab of this data element and select your dataset. Answer no to the question "Do you want to clear existing binding". In the popup, select all columns required to build the URL.
Finally use hyperlink property of the data element. May be you missed it can be an expression:
This pops up an expression builder, in your case this would result in something like:
"localhost:8080/Application?key="+row["firstParameter"]+"&securityString="+row["secondParameter"]

Prevent Crystal Reports to select related fields to get only distinct items

I'm using Crystal Reports 14 with an Oracle DB. If I have related tables Authors and Books and I selects all the authors that have book with 'code' in their title Crystal will put Books.title in the SQL SELECT clause, even if I don't use any Books fields anywhere in the report (except for the record selection). The query looks like this:
SELECT "AUTHORS"."NAME", "BOOKS"."TITLE"
FROM "AUTHORS" INNER JOIN "BOOKS" ON "AUTHORS"."ID"="BOOKS"."AUTHOR"
WHERE "BOOKS"."TITLE" LIKE '%code%'
This causes a problem because, even if I use the "Distinct" option, I will get many entries for each author (if they have more then one book with 'code' in the title). But what I want is only one entry by author. "Distinct" do not work here because each entry is really distinct, their book title are different.
How can I avoid getting "BOOKS"."TITLE" in the SELECT clause like this:
SELECT DISTINCT "AUTHORS"."NAME"
FROM "AUTHORS" INNER JOIN "BOOKS" ON "AUTHORS"."ID"="BOOKS"."AUTHOR"
WHERE "BOOKS"."TITLE" LIKE '%code%'
If that's not possible, what's the best workaround to get distinct authors in my scenario?
UPDATE
I should add that currently I'm using this formula in the Suppress details section:
{AUTHORS.ID} = previous({AUTHORS.ID})
The problem with this solution and also the group solution proposed by #Beth is that the query is the same and the DB return too much data for no reason. In both solutions the data is filtered/regrouped in Crystal Reports, not in the DB.
can you group by authors in your report and suppress the books.title details?
to group by author, in your report, under the Insert menu, select 'Group...' then select author.id in the first combo box and click OK. You'll notice your report has changed to introduce Group Header and Footer sections above and below the detail section. You can suppress the detail section and only the authors will print.
If you want only the authors to come across, you'll need to use a command sent to the data source with the SQL you want used, instead of using the tables directly like you are now.
You can create a command as your back-end with your parameter in it. You'll use that parameterized command instead of the tables you're using now. Try creating the command without the parameter first, then after you get that working, you can add your existing parameter into the command SQL.

Jasperreport parameter selection from SQL query

I wanted to create a JasperReport which asks the user for a deliverer before it creates a report with data of the last the deliveries of the selected deliverer.
The problem, how I can do that? I found only examples where a parameter is created and the ArrayList is filled statically. But in my parameter I need the query result over the table of deliverers filled.
Can anybody tell me a possible solution?
I'm using Jaspersoft Server 5.1 which directly access a PostgreSQL database which has a datawarehouse structur. So it's not possible to use Java code.
Here is the documentation for adding input controls to reports in JasperReports Server:
http://community.jaspersoft.com/documentation/jasperreports-server-user-guide/adding-input-controls
Scroll down to the section that deals with query-based input controls. Your input control will have a name, such as deliverer. In your report, you must add deliverer as a parameter and reference it in your query, as you have done in your comment.

Two SQL query inside single JasperReport and populating Data

We are using reports in our web application.
The report is generated using JasperReports.
The problem I am facing is:
My SQL query fetches data based on a where clause:
SELECT * FROM table WHERE level='c'
I can easily show this information inside the iReport.
But I need to fire another query where level='d' and the information for the same needs to be appended to the report with that of level='c'.
I tried grouping both the outputs. But problem is how do I fire two different query while generating the report because I can write only one query in QueryBuilder inside the iReport.
Is there anyway of achieving the same.
In essence:
The report should look like:
Level=C
Name Age Phone number
Level=D
Name Age Phone number
Level D should appear only after level c is completed.
Can anyone please guide.
I finally managed to achieve the same..Grouping the data using level_id..
Initially I was trying to group in a different manner and hence the value was not getting shown..
The same is explained pretty nicely in ireport Ultimate guide-3 document.