I am stuck into a problem....
I am filling my Table with Dataset with FIXED rows but Dynamic Columns.
My Requirement is that I need to have a page break after 5 columns...
Eg:
Product Name 2003 2004 2005 2006 2007
Mobile 10 15 20 19 17
Laptop 55 2 3 17 10
Tablet 10 10 25 4 9
Similarly on next page , I should have
Product Name 2008 2009 2010 2011 2012
Mobile 50 5 2 19 25
Laptop 5 2 30 17 100
Tablet 10 10 25 4 19
I haven't got anyone's reply till now ... :-(
But my problem is solved :
I followed this link : http://blogs.msdn.com/b/chrishays/archive/2004/07/23/horizontaltables.aspx
Above link also hade the HorizontalTable.rdl attached...
I just adjusted my fields,Dataset and groupnames... It is working like charm...!!!!
Thanks Chris..!!!
Regards,
You could create secondary data source and use it to filter the main one - with one record per "page". So, you would create "wrapper" report where you push all the data, add table to it with single column where you would drop subreport where you only push data filtered by the values in the record of the secondary "wrapper" table.
Related
Web application contains two pages
1.index.jsp
2.result.jsp
index page contains input values such as weeknum,sla etc , user has to fill the input values , after that query will be executed in result page
This is my database table
weeknum groupby images actct sla24 sla8 CTSUM type
1 studio 123 8.5 5 11 16 16 short
1 studio 12 9.5 6 12 16 12 long
1 studio 154 10.5 7 13 16 short
2 studio 123 11.5 8 14 16 long
2 studio 12 12.5 9 15 16 short
2 studio 154 13.5 10 16 16 long
And below is jsp page database query (resultPage)
"<sql:query var=""retouch"" dataSource=""jdbc/imaging"">
SELECT WEEKNUM,
GROUPBY,
SUM(IMAGES) AS IMAGES,
SUM(SLA24) AS SLA24,
ROUND(SUM(CTSUM)/SUM(IMAGES),2) AS AVGCT,
ROUND(SUM(SLA24)/SUM(IMAGES)*100,2) AS CTPERC
FROM (SELECT
WEEKNUM,
COLUMNTYPE as groupby,
IMAGES,
ActCT,
IMAGES * AVGCT AS CTSUM,
SLA24,SLA8
FROM RETOUCHSUMMARY
WHERE WEEKNUM = ?
<sql:param value=""${param.weeknum}"" /> )AS CT GROUP BY
WEEKNUM,COLUMNTYPE;
</sql:query>"
The above query works fine,by default it picks sla24 column.
it is possible , if user selects sla8 in index page query has to pick sla8 column inside of sla24 ..?
Hope i explained well, Please help
I've got an issue where I've been presented data in this format from SQL, and have directly imported that into SSRS 2008.
I do have access to the stored procedure for this report, however I don't want to change it as a few other reports rely on it.
Project HoursSpent Cost
1 5 45
1 8 10
1 7 25
1 5 25
2 1 15
2 3 10
2 5 15
2 6 10
3 6 10
3 4 5
3 4 10
3 2 5
I've been struggling all morning to understand how/when I should be implementing the SUM() function with this.
I have tried already to SUM() the rows, but it still outputs the above result.
Should I be adding any extra groups?
Ideally, I need to have the following output:
Project HoursSpent Cost
1 25 105
2 15 40
3 16 30
EDIT: Here is my current structure:
"LineName" is a group for each project
You have to add a row group on "Project" since you want to sum up the data per each project.
Apologies if this question is a bit long, but I wanted to explain in detail what it is I am trying to do.
I am developing a database in MS Access 2010/Windows 7 which analyses and reports on incidents (e.g. faults) in an organisation. An incident is reported as beginning at a particular date/time in a particular location for a particular duration. An incident may occasionally cause one or more "live resilience outages" (LRO) which will have the same start-time but can be in different locations and have different durations. So for example a router going out of service in the central technical area for 600 sec might cause live outages of 60 sec and 30 sec in studios 5 and 6 respectively.
I need to report on three date ranges: the month in question, the previous month and the (financial, beginning in April) year to date. So for example the report for March 2012 would consider the periods 01 Mar 2012 - 31 Mar 2012 (month), 01 Feb 2012 - 29 Feb 2012 (previous) and 01 Apr 2011 - 31 Mar 2012 (YTD).
These dates are correctly calculated in a form called ReportCentre. I have three queries to return the LROs for the different date ranges: QueryLROMonth, QueryLROPrevious and QueryLROYTD all of which work properly in isolation (i.e. return the correct values). So for example QueryLROMonth is defined as
SELECT lro.*
FROM lro INNER JOIN incidents ON lro.pid = incidents.id
WHERE (((incidents.begin) Between [Forms]![ReportCentre].[StartMonth] And
[Forms]![ReportCentre].[EndMonth]));
which returns the expected values:
id pid duration facility
6 681 30 23
7 686 857 23
8 735 600 25
9 738 600 25
as does the YTD query
id pid duration facility
1 100 120 25
2 366 5 25
3 380 460 1
4 505 341 23
5 622 0 29
6 681 30 23
7 686 857 23
8 735 600 25
9 738 600 25
20 1297 50 1
So far so good, but now the bit that's got me puzzled. I am trying to design another query which takes the output of the three LRO queries (and some other data), groups it all by facility and calculates things like availability. If I design a totals query and include the Facilities table (for the facility name) and the QueryLROMonth query e.g.
SELECT facilities.facility, Count(QueryLROMonth.id) AS lrocountmonth, Sum(QueryLROMonth.duration) AS lrosecondsmonth
FROM QueryLROMonth INNER JOIN facilities ON QueryLROMonth.facility = facilities.ID
GROUP BY facilities.facility;
This works fine and produces what I expect.
facility lrocountmonth lrosecondsmonth
HQ3 2 887
HQ5 2 1200
but as soon as I introduce the YTD query:
SELECT facilities.facility, Count(QueryLROMonth.id) AS lrocountmonth, Sum(QueryLROMonth.duration) AS lrosecondsmonth, Count(QueryLROYTD.id) AS lrocountytd, Sum(QueryLROYTD.duration) AS lrosecondsytd
FROM QueryLROYTD INNER JOIN (QueryLROMonth INNER JOIN facilities ON QueryLROMonth.facility = facilities.ID) ON QueryLROYTD.facility = facilities.ID
GROUP BY facilities.facility;
for some reason stuff starts being counted reported wrongly. Specifically the two Count columns are multiplied together and so lrocountmonth and lrosecondsmonth are both multiplied by lrocountytd. Similarly lrocountytd and lrosecondsytd are both multiplied by lrocountmonth.
facility lrocountmonth lrosecondsmonth lrocountytd lrosecondsytd
HQ3 6 2661 6 2456
HQ5 8 4800 8 2650
What am I doing wrong? How do I prevent this entanglement?
Your [QueryLROMonth] and [QueryLROYTD] queries each return multiple rows per Facility, but because you are effectively JOINing them on just the Facility_ID you are producing an OUTER JOIN of sorts. For example, if for a given Facility your [Month] query contains 3 rows and your [YTD] query contains 6 rows then your JOIN on Facility_ID alone will produce 18 rows.
You'll want to create aggregation queries that "roll up" the Monthly and YTD numbers by Facility first, so they each have only one row per Facility. You can then use them in your final query to produce the report.
Troubleshooting tip: If your aggregation queries are producing strange results try removing the GROUP BY parts so you can see the underlying rows that are being aggregated.
I have SQL Server 2005 Reporting Services. I need to create a report with number of columns that is defined during runtime.
I have a DB table with content like the following:
Person Date Val
----------------------------------------------
Person1 2012-01-03 3
Person2 2012-02-11 5
Person1 2012-02-17 7
Person2 2012-01-19 2
Person2 2012-01-15 4
I have to create a Report like this:
Person Jan 2012 Feb 2012
----------------------------------------------
Person1 3 7
Person2 6 5
In other words, for every Person I have to make sum of all his Value fields for a given month, and put the sum into column corresponding to the month. In the example above I have 6 for Person2 during month Jan 2012 - this is sum of the values 2 (on 2012-01-19) and 4 (on 2012-01-15).
Thus, in design time I do not know the date range covered by that my table. I should detect it, to build array of months covered by the date range (the Jan 2012 and Feb 2012 in the sampel above) and add a column for each of the months.
How should I implement this using SSRS?
In SQL 2008 and later the approach to this problem changed a little bit, so make sure that you are looking at reference materials for 2005 if that is what you are using.
On this page, look for the Matrix section. Matrices in SSRS are designed to solve exactly the problem you describe with minimal effort. In 2008 Matrices and Tables are both variants of the "Tablix:" a control that can have both row and column groups.
If you're stuck with Tablix, here's a similar situation that I have solved, How do i represent an unknown number of columns in SSRS?.
I am creating a SSRS 2008 Report
in my report i have 200 columns, it is difficult for visualizing purpose,
is there any way in SSRS by which i can show 20 column per page with row hearer in each page.
ex..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .....................
2010 5 4 8 7 6
2011 9 7 5 8 9 4 2 5
2012 1 2 4 5 3
2013
can i break to show only 20 columns in first page & reamin 20 second page & show on with column heaer repeat in each page
Thankyou
Assuming that your column IDs are sequential, simply set up a new column grouping as =Floor(Fields!columnID.Value/20) above your existing column ID grouping and set a page break on your new grouping.