Displaying multiple columns / dataset rows per detail section - crystal-reports

I need to create a report where each page contains four columns. I initialy had them as subreports but I guess they dont need to be.
How do I make it so each entry in a supplied dataset is represented as a column? Say if I had a dataset with 6 rows, the report would span two pages with four columns on the first and two on the second.
In other horizontal reports I had one dataset row represented as a row in the detail section of the report. But now I need four dataset set rows for each detail section, as the detail section contains four columns.
Guess what I really am looking for is a vertical detail section, sort of, while retaining the rest of the report horizontal.

I suggest using a Crosstab - these are the Crystal equivalent of pivot tables in Excel, or matrixes in SSRS.

Related

Parallel Detail Sections in Crystal Report?

I want to know that how to make a crystal report such that its details section should display values of details in multiple/parallel fashion depending upon its column value.
Suppose that my data-set for report is as follows,
I want to group by my report on Id and want to display their Value in detail section so that if value is positive then it should display in left side and if it is negative then it should display in right side. But these two sides should be "Parallel" in display like this
Currently if I suppress a field on some condition then it remains blank or when I do "Format with Multiple Columns" then also the required result is not possible. Because In multiple columns option, it is not necessary that my positive's & negatives columns are equal in count, and there is chance to display positive values in negative side.
Since there is no logical connection to enforce what values should be on the same row, you probably need to implement this as 2 subreports placed side by side. One to show negative values and one to show positive values.
The subreports would be placed in the Group Footer for ID and would be linked on ID.

Aggregating ratios in Crystal Reports pivot table

Simple pivot table:
In this case, I'm pulling back 5 fields from the database:
Category
Year
Quarter
Numerator
Divisor
2 unfortunate facts. First, the year/quarters drift to provide a rolling 8-quarter view. Consequently, there will usually be 1 full year and 2 partials with their respective quarters. Second, the measures to be displayed are ratios of numerator to divisor. Naturally, Crystal is assuming that I want to divide everything and then total it, which is not correct.
How do you get the pivot table totals to calculate correctly as SUM({Numerator})/SUM({Denominator})? Since there are multiple levels in play, the Sum({Numerator}, {Attribute})/Sum({Denominator}, {Attribute}) doesn't seem to work or I'm missing an extra element to it.
This crosstab is intended to replace a report that individually calculated every cell, and is not viable for long-term maintenance. If the totals can't be corrected, we'll have to revert back to that format.
Once you create a cross tab... you can insert saperate column or row inside the existing column using the option embeeded summary
Right click---> Embeeded Summary ---> insert embeeded summary
This will insert a row as Edit This Formula.
Now on the newly created cell
Right click---> Embeeded Summary ---> Edit Calculation formula
This will open a window there write your division formula.

Generating multiple crosstabs dynamically

How can we generate multiple crosstabs from one crosstab design in iReport? So there will be specified number of crosstabs and each crosstab will be filled with different values.

SSRS Dataset Rendering

I have created a stored procedure where its columns can change names and the number of columns fluctuate as well. Is there a way to auto generate the report in SSRS depending on the result set. My main concern is to output from 3 columns to lets say 10 columns. Any assistance would be greatly appreciated. Thank you.
You can toggle the visibility of columns using the Column Visibility in conjunction with some parameter you define for control flow. It is a bit more difficult to do column wise shifting then row shifting, as with groups. Another thought would be to look into column grouping. In SSRS you can simulate the PIVOT command using column groups.
You can use the matrix, which will show the number of columns as they are generated.
Include (Drag from DATASETS) your data in DATA and the field (dynamic column) in columns.
Hope this helps you.

Can't Repeat Column Groups AND ALSO hide Static Columns within a Matrix

UPDATE
When I first asked this question, I didn't fully understand what the problem was. Your best bet is to glance over the issue below and then read my answer.
I have a report with a matrix where the data looks like the following:
Name Id Activity 1 Activity 2 …Acitivity N
Smith 1 77 100 nn
Johnson 2 88 99 nn
Name and Id are in a group.
When the number of activities are greater than 11, I need the columns Name and Id to repeat when the report renders in a PDF.
Here is an example of report recently run:
Page 1 (NOTE: red boxes indicate
personal data filtered out):
Page 2:
I've been fiddling with the properties RepeatRowHeaders and RepeartColumnHeaders, but I have had no success.
How do I make this column repeat?
Sadists can check out the rdl file here.
Short Answer (and a plea from me):
Please vote on this Page to conditionally hide non-group matrix columns.
Long Form:
I found the solution to my problem, but first was figuring out the exact issue. An SSRS Matrix has the ability to repeat columns on subsequent pages as its width grows when RepeatRowHeaders and RepeatColumnHeaders are set to True. So that part of my report setup was fine.
My problem was that my grid was set up as follows:
What you see above is a Tablix containing a Matrix. The blue represents a normal Tablix with four columns. The green Represents a Matrix within Column 4 that has N number of columns.
So even with the properties RepeatRowHeaders and RepeatColumnHeaders set to true, Columns 1-3 would not repeat as the data in the Matrix extended to multiple pages. This is because the outer Tablix (e.g. the blue part) only saw Column 4 as growing outwards instead of the individual columns in the inner matrix.
In order to make the columns repeat, I had to alter the grid like so:
This grid is only one matrix; not a Matrix within a Tablix as the first image depicted. I pulled the matrix out and added "Static Columns" to the left. This made Columns 1 - 3 repeat on multiple pages as the Matrix grew.
All seemed well, but here's the rub: Static Columns cannot be hidden or, more aptly put, you can hide the data within a column, but the column itself will not shrink.
So, when I hid Static Column 3, my report looked something like this:
Notice the white-space Gap. This solution simply would not work. When I found that I was stuck in an either/or situation (either have the ability to conditionally hide columns or Repeat Columns on Subsequent Pages), I used one of our Microsoft Support Incidents to analyze the report and come up with a solution.
Microsoft was nice and knowledgeable and even pointed to a article in their forum stating they were considering allowing SSRS to have the ability to hide static columns. However, in the end, they said we were stuck with the either/or situation. (BTW, note that forum thread was answered in 2006.)
So after that long process with Microsoft, we were still stuck with our dilemma. Fortunately, one of our fellow programmers came up with a workaround: put the columns you want to toggle visibility within the Matrix itself.
And that's what I did. It took some finagling with the report SQL (and creating a statement I'm not particularly proud of), but it works.
So now the working report looks like this:
That's one Matrix, two static columns that always need to repeat on every page and Column 3 which is now part of the dataset used for the Matrix.
Once again, I plead with the community to vote on this Page to conditionally hide non-group matrix columns. It would make constructing future reports like this much easier :)