Dynamic columns number in Crystal Report? - crystal-reports

I want to make a report that runs a query on database, it gets the count of items used in a specific transaction grouped by their name, so both item's name and its count are retrieved from db, is it possible ?
The query will get results similar to this:

You can use cross tabs for this purpose.
Create a cross tab and use Item name in columns and count in rows.
There are many links when google, below is as sample
https://www.tutorialspoint.com/crystal_reports/cross_tab_layout.htm

Related

Filemaker: display related records based on date

I have 3 tables,
Table 1:
Client
Table 2:
Followups
Table 3:
Referrals
It's a one to many relationship where one client can have multiple followup or referrals.
How do I display the Followups and Referrals between 2 dates?
I have a summary field which counts the total of each followup and referrals but they show me all the count rather than in between a given date
In your relationship graph make a new table occurance that restricts the related set based on a date range. Here is an example image. You can make "date one" and "date two" globals so that they are not stored, and operate across all records. Base your sum / count calcuations based on this relationship.
Otherwise you can use a sub-summary on your layout in list view, and place the Summary fields in the sub summary. The summary field will show the sum for that sub section.
Another option is to place the summary field inside a one-row portal and filter the portal to show only records within the desired range.
This requires much less resources than adding filtered relationships - but it can be slow if you have too many related records.

jasper report show count on footer of a specific query

am very new to jasper report
also I have tried looking at videos but can not seem to get this one concept
basically there is this main query which i have
select * from table
which is populated in the details area
however i want a second query
select count(*) from table where name = "tim"
and put the count on the footer
can this be done using jasper
any tutorial to this concept or guidance would be helpful
to sum up the details area should show all the data where as the footer should only show counts of a few things.
You can only have one DataSet (therefore query) for the report. In your case this is your main report select * from table, which seems to be working well.
You have two options for adding the information you want:
(and I would say the better option) is to add a variable $V{tim_count} which is configured as:
initial value 0
expression value "tim".equals($F{name}) ? 1 : 0"
calculation function sum
there are multiple ways to increment this variable, so I'll leave that with you. In the footer you would then add a text field with the $V{tim_count} variable as it's contents.
You can read about variables here https://community.jaspersoft.com/wiki/variables
You can add an object that has it's own DataSet:
Table
List
Subreport
You would then be able to add your query to that object and display it appropriately. As you can see, displaying a COUNT is not really the most appropriate way to do this.
Note - I don't suggest this way

How to generate a page in report for each data row using SSRS

I am working on developing an SSRS report.I have a table in which student name and 6 subjects marks is stored in each row. My problem statement goes like this ---> lets say if 10 rows of data is present in table then I want to create report card/ marksheet for each student in new page but inside a same report. (I.e. 10 pages in one report). Then convert the report containing 10 pages to PDF format and save it in some folder.
Can anyone show some possibilities to achieve my problem statement.
Thanks in advance....
Usually you'll want to use a List object to separate your report by student. You would group the list by student in your report. Then set a Page Break in the List with the location to Between each group so that it separates each student into a separate page.
Then you can put charts, tables and other object inside the list and it will repeat with the list group (in your case, each student).
MSDN: Lists
In this report I made below, the List is highlighted in Red and groups by each site. It just has a table inside. When it's run each site gets it's own page with a list of their people.
Keep in mind that a List is actually just a Tablix with only one data cell - with the column and row headers removed.

Order a JasperReports report by several columns

Is it possible to create a subgroup in iReport/JasperSoft Studio?
I have a report and I want to group it by name. Then inside that group I want to group it by street.
Each time I group something by name the headers I start a new page reprint the headers. That's the point where I'm at. Now I want to group (inside the name group) by street so that the headers display again each time a new street is found.
You can only use grouping on sorted data. If you need ordering by several columns you will have to pass it that way to Jasper and order the rows yourself either with multiple order columns in your SQL query or with custom Java code.

Is it possible to create a filter that filters out distinct values in a dataset?

I'm trying to create a report that will contain two pie charts. I get the data for the report from SQL.
Currently, I created a dataset for the first chart which holds records with the following fields: Import ID, Date, Status. This dataset contains duplicate records.
For the second chart, I need the same data I have in the first dataset, only without duplications and aggregated differently.
I realize that I can create another dataset that will get the distinct values from the SQL database, but I was wondering if there was a way to use the built-in filtering functionality to filter out the dataset I already have to return only distinct values (based on ID field).
Looking at the options in the following filtering dialog, I see no obvious way to do this:
If ID is not unique and your 1st query looks like this:
select ImportID, Date, Status
from YourTableSource
WHERE YourConditions
Then you probably should use for your 2nd query form like this:
select DISTINCT ImportID, Status
from YourTableSource
WHERE YourConditions
If changing the query is not an option ,then you may create the Group in ssrs with invisible DETAIL pane and place the ID and Status fiels in int Group pane