I've got two reports that I wish to combine into one print off. Report1 is a 2 page report and has an ID parameter, Report2 is a 1 page report and also has the same ID parameter. The ID's come from a separate query dataset1
SELECT id FROM users WHERE firstname = 'Dave'
I want there to be 3 pages per id. I have tried putting two subreports into a List, where the list has a dataset linked to my SELECT query, but this displays all of the Report1's and then all of the Report2's after.
Desired output: (Report1pg1[id=1], Report1pg2[id=1], Report2pg1[id=1]), (Report1pg1[id=2], Report1pg2[id=2], Report2pg1[id=2])
I am not sure and i don't have no data tools installed in my current machine to check.
But I think the following logic will work.
Try grouping with id in Report1 and in detail portion add subreport and call Report2 (assuming that you are using table)
Related
Basically I am using MS Access 2013 to import all active work items that are assigned to a specific group from an API and select the data into 2 new tables (Requests & Request_Tasks).
I then have a form sourced from a query to select specific fields from the 2 tables.
Until yesterday it was working with no problems and nothing has changed.
All of the data appears in the 2 tables so the import from the API works fine.
When it comes to the query selecting the data from the 2 tables (Which are already populated with the correct data) the query returns only data from Requests table with blank fields instead of data from Request_Tasks.
The strange part is that out of 28 active work items it returns 24 correctly and the last 4 are having the problem.
Every new task added to the group has the problem also.
Query is below.
SELECT
Request_Tasks.RQTASK_Number,
Request_Tasks.Request_Number,
Requests.Task, Requests.Entity,
Request_Tasks.Description,
Request_Tasks.Request_Status,
Requests.Requested_for_date,
Request_Tasks.Work_On_Date,
Request_Tasks.Estimated_Time,
Request_Tasks.Actual_Time_Analysis,
Request_Tasks.Offers_Built,
Request_Tasks.Number_of_links_Opened,
Request_Tasks.Number_of_Links_Extended,
Request_Tasks.Number_Of_links_closed,
Request_Tasks.Build_Allocated_to,
Request_Tasks.Buld_Review_Allocated_to,
Request_Tasks.Keying_Allocated_to,
Request_Tasks.Keying_Approval_allocated_to,
Request_Tasks.Actual_Build_Time,
Request_Tasks.Actual_Stakeholder_Support,
Request_Tasks.Task_Completed_Date
FROM Request_Tasks
RIGHT JOIN Requests
ON Request_Tasks.Request_Number = Requests.Request_Number
WHERE (((Request_Tasks.Task_Completed_Date)>=Date()
Or (Request_Tasks.Task_Completed_Date) Is Null)
AND ((Requests.Task)<>"7"
And (Requests.Task)<>"8" And (Requests.Task)<>"9"))
OR (((Request_Tasks.Task_Completed_Date)>=Date()
Or (Request_Tasks.Task_Completed_Date) Is Null)
AND ((Requests.Task)<>"7"
And (Requests.Task)<>"8"
And (Requests.Task)<>"9"))
ORDER BY Request_Tasks.Work_On_Date Is Null DESC , Request_Tasks.Work_On_Date, Requests.Entity Is Null DESC , Requests.Task;
Any help would be great.
Thanks.
The query is using RIGHT JOIN, which means rows from Requests table is always reported even if there is no corresponding entry in Request_tasks table.
A full example is here http://www.w3schools.com/Sql/sql_join_right.asp
In your case, most likely somechange might have happened during data load/API and Request_tasks table is not being populated. That is the reason you see blank data for fields from that table.
Solution
Manually check data for 4 faulty records in Request_tasks table.
Ensure keys in both table request_number are matching including data type and any leading space/non printable characters (if they are string type of data) for faulty records.
Query seems fine, its more of issue with data based on problem statement.
I am new to access. I have a report with a query(Q1) as its data source. Is it possible to use another query(Q2) only for one field in the same report?
My main query is:
SELECT PersonTotalHours.*, Person.*
FROM PersonTotalHours
INNER JOIN Person
ON PersonTotalHours.LastName = Person.LastName;
My report's structure is like this:
Report header
_____________
Page header
_____________
Lastname header
_____________
report details
_____________
Lastname Footer
_____________
PageFooter
As you can see, in the report I group my data using the Lastname column then I show details about each peron for current year.
I need to show short form of data about former years of each person in the Last name header (somewhere before the detailed data).
Second query is like this:
SELECT PersonTotalHours.MA, PersonTotalHours.Year, Sum(PersonTotalHours.Hours) AS Sum
FROM PersonTotalHours
GROUP BY PersonTotalHours.MA, PersonTotalHours.Year
I use this for short form of data.
Important point is that the number of rows can be different. Person A might have 0 previous years and another person has more than 5.
How is it possible to use the second query for parts of report data?
I solve the problem using a subreport.
http://www.simply-access.com/Multiple-Queries-in-Report.html
I have 3 tables.
One contains Profiles as described below:
ID NM
==============
1 Profile A
2 Profile B
The second contains assignments:
ID NM
==============
1 Assignment A
2 Assignment B
My third contains FID's for both and allows you to prioritize them like so:
ID P_FID A_FID PRIORITY
========================
1 1 2 1
2 1 1 2
My problem is populating the third table via a continuous form so the end user has the ability to input priorities. Basically, there is a combo box that lets the user select the appropriate profile. If there are no entries in the third table, it should show you all of the assignments so you can input priorities. If there are already records in that table it should retrieve those values so you can update the priorities.
The following query works great as long as the third table is empty. Once the user inputs priorities and tries to switch to a different profile, it doesn't return any records unless it is the selected profile.
SELECT tblProfileForAssignments.PROFILE_FID,
tblAssignments.NM,
tblProfileForAssignments.PRIORITY
FROM tblAssignments
LEFT JOIN tblProfileForAssignments ON tblAssignments.ID = tblProfileForAssignments.ASSGNMNT_FID
WHERE (tblProfileForAssignments.PROFILE_FID = Forms!frmProfileAssignments!cmboProfile)
OR (tblProfileForAssignments.PROFILE_FID IS NULL);
Can this be done in a single query utilizing a union, I would think, or should I just revert to VBA to figure this out? Like I said, it works great as long as the third table is empty or they only work on the first profile they select, beyond that it fails. Does this make sense?
Turning it into a subquery might give you what you need:
SELECT PRIORITIES.PROFILE_FID, tblAssignments.NM,
PRIORITIES.PRIORITY
FROM tblAssignments LEFT JOIN
(SELECT ASSGNMNT_FID, PROFILE_FID, PRIORITY
FROM tblProfileForAssignments
WHERE PROFILE_FID = [Forms]![frmProfileAssignments]![cmboProfile]) PRIORITIES
ON tblAssignments.ID = PRIORITIES.ASSGNMNT_FID
This should return all assignment names along with any assignments for the specified profile. The query in your example would not display records if assignments for any profile existed and the current profile had no assignments made.
Very new to Pentaho Reporting,
I have a query grabbing columns categories, quantity, and gross. It returns about 200 rows.
Without changing the query, is there a way for the report to display the aggregates for each category (I have category as a group)? For example, All you can eat should only display a sum of the Amount and GrossValue columns.
Same for dessert (notice there are two group headers - why?)
You just need to get used to with pentaho report designer.
Refer information given at the end of this page simple report.
You can add one parameter in group footer and set its properties.
They provides properties like aggregation-type, which can be set as Sum or count and then it will show at the end of each group with sum or count of the rows as per the type you specified.
I inherited an SQL Reporting Services .rdl project from somebody and need help fixing some functionality.
In each row of the report, there is a subreport. In order to save space the subreport is divided into 3. Such that in each row of the report, it splits the data of the subreport into 3 smaller tables. Right now, it fills these 3 subreports horizontally. (ie. if the result has 9 values, the first subtable will have 1, 4 & 7, the second subtable will have 2, 5 & 8, etc)
Is there a way to have it fill the subtables vertically? (ie. the first subtable would have 1,2 & 3)
Thanks!
By default, the multi-column reports should fill vertically. In fact, there isnt even an option to fill horizontally so i'd like to know how it is being done. Perhaps the underlying query has been modified?
In fact, I took a deeper look into the query and it turns out that the column number is being passed as a report parameter and the results are being reordered using a modulo on the column number. I don't have it with me right now, so I don't have the exact syntax.
More info for anyone trying to do this:
it turns out that the subreport query gerates a column which indicates the row number
ROW_NUMBER() OVER (PARTITION BY columnName ORDER BY otherColumn) AS RowNumber
Then in the report, the subreport is included 3 times. Each subreport has a report parameter called Column, the first one is of value 1, the second 2 and the last one 0. The subreport then has a filter on it
=RowNumber Mod 3 = Column
that way the subreport results are divided into 3 supreports that can all be placed on the same row to save space.