Combining duplicate rows in Crystal Reports - crystal-reports

I posted this question already on another forum, but have not got any responses yet and requiring a solution quickly: https://answers.sap.com/questions/384242/combining-duplicate-lines-in-crystal.html
For various reasons to do with product numbering customization on our SAP B1 system, we can have no more than two of our standard items on a row in a sales order or invoice. All other items, such as accessories and non-numbered items we can put as many on a row as we want. To save any questions, this process cannot be avoided.
The issue is that this means we get some very strange looking invoices. For example if I sell 15 of our standard item 'A' and 15 of our standard item 'B' with 30 accessories to match, I can either bill out 15 lines each containing one 'A' and 15 lines each containing one 'B' then one line containing all the 30 accessories. Otherwise, I can bill out 7 lines each containing two of 'A', then one line containing the 15th A, then 7 lines each containing two of 'B', then one line containing the 15th B, and finally one line containing 30 accessories.
Is there any way that, in the case that an invoice contains rows with identical length, width, height and colour (or any other fields if it makes it easier), crystal can be configured to combine the rows into one and return the sum of the quantities and the sum of the prices in the relevant columns?
Added images below:

Related

Finding rows with matching id's and the using the date fields in each row to find the time difference in days between them

I have rows of data where up to 3 id's match. I need to try and find the number of days between each of the rows with matching id's using the date field. I am looking to find the number of days between each row in date sequence. So between the first and second row in date sequence, or second and third row but not the first and third row.
So a simplified version of my rows can be seen in the attached image.
image showing 2 ID's with multiple entries. John Smith (highlight yellow) who has 3 entries, two on the same day and one later and Bill Wright who has just two entries on separate days.
The results I would be looking for would ideally be shown in column 4 of the image.
Is there any way I can do this in a formula or pivot table? (basically avoiding VBA) Any suggestions hugely appreciated! Thanks.
This array formula
=IFERROR(B2-INDEX($B$1:$B$9,MAX((A2=$A$1:A1)*ROW($A$1:A1))),0)
will work as long as your data are sorted by date (which your screenshot indicates they are):

SSRS Double row headers and data display for printing

** I'm using SSRS2008 R2
I have a report that the users would like to see in a printable pdf.
Problem is there are several columns, potentially too many to fit on a printed 8.5x11 paper.
One of the concepts they suggested was a stacked header/data display, like breaking the columns into 2 rows, so 2 rows of data (for John and Bill) would look like this:
NAME START_DATE STATE COMPANY
ACCOUNT BALANCE END_DATE
-------------------------------------------------------
John 1/20/2016 NY GE
10076 $100.00 2/20/2016
-------------------------------------------------------
Bill 5/13/2016 MA Netflix
00013 $150.00 12/31/2016
-------------------------------------------------------
This leads me to 2 questions:
Is there a way to do this with a tablix?
AND/OR in addition, is there a way to set a default property on the report so when the report is exported to pdf and to print, that it defaults to fit all columns on one page (therefor shrinking the font size to fit on page?)
For anyone that cares - Apparently this can easily be achieved by dragging a Tablix onto the work area, right clicking the header row, adding a new row underneath (basically becomes header row 2), then do the same thing to the details row - however make sure to insert row - Inside group. That allows you to have stacked header and data rows and you can copy / paste headers and row values in whichever row you'd prefer.
it will work if you make all the columns on the same height not unequal. If all the columns has same height, then while exporting to pdf/excel and print it will come in the same page.

Multilevel list skip numbering

I have created a multilevel list for being able to reference to table rows in a word document. Multilevel list thread
With the multilevel list I struggle to skip numbers. The table numbering is divided into two levels. NNN and NNNL, where N: Number and L:Letter.
Example:
1. Header 1
101
101a
2. Header 2
201a
The numbering below header 1 works fine, but header 2 does NOT work.
The numbering are used for clauses in a document, so in case a clause is divided into different conditions, the class NNNL is used. However, as it is now, it needs the NNN for create NNNL.
I have tried using 'Set numbering value' - 'Continue from previous list' - 'Advance value (skip numbers)', following this solution suggestion, but following this guide still results in the addition of a level NNN before (see below for examplification).
2. Header 2
201 <- This is added
201a
Can't I skip a numbering value of a list level above the item I wish to change?
Edited:
Also, when having a subheader I face issues. If the first clause after a subheader is divided into subclauses, I get
101
1.1 subheader
101a
What I want is this
101
1.1 subheader
102a
I have uploaded a word-file I have uploaded a word-document here which shows the issue.
Set both Level 2 and Level 3 to restart after Level 1 (in the dialog box described in the Answer of first post to which you link). This way you can leave out Level 2 and Level 3 will still restart.

Crystal reports - Group total

I have a report that I've written and I understand how to create running totals and such, but need help creating a custom evaluation formula.
I have two levels of groups, first group is based upon a certain user, the next group is based upon transactions that user has been involved in. I have details hidden, and am only interested in the totals for a particular activity. This is working great, and totals are working properly but the problem is, each activity has a 'line number', which essentially can be the same as another activity (ie: two activities can have lines 1, 2, 3 contained within), so doing a distinctive total based upon a set of data isn't accurate because I only want it to be distinct based upon each individual recordset, and not globally.
The example is below... if I do a count on each record for this dataset, it comes out to 18 because there are duplicate line numbers on each... but if I do distinct, it only comes to 9 because of duplicate line numbers across multiple actives.
I guess what I need to know is how I can take the totals per detail group, and have them total up in my second footer properly. I assume it's going to take me compiling together a string including the activity number and line number, and then comparing them?
Here is an example of the data contained within the total groupings:
I figured this out on my own... turned out it was pretty simple. I converted my numeric values to text, and included a copy of the transaction id and the line id as my test value, and did distinct on that... Sometimes it just helps not staring the problem down.

getting grouped records into separate view columns

I have a crystal report with a subgrouping on a field. The output is shown each group-details vertically stacked as follows:
Group Header Value 1
Detail 1a
Detail 1b
....
Group Header Value 2
Detail 2a
Detail 2b
.....
and so on.
What I need to see is the detail values in table columns as follows:
Group Header Value 1 Group Header Value 2 Group Header Value 3
Detail 1a Detail 2a Detail 3a
Detail 1b Detail 2b Detail 3b
Detail 1c Detail 3c
Detail 3d
I've tried formatting the Detail Section with multiple columns along with formatting the group with multiple column, but it's just a mess. I know I will only have at most 4 distinct Group values.
Any suggestions please?
Thanks.
Crystal is not very good at displaying items vertically like that, but here are a couple of options I can think of:
Build up 4 arrays where each corresponds to one of the groups and contains strings that are what you'd like to output for each record (one array element for "Detail 1a", one for "Detail 2b", etc.). You can do this by creating a single formula in your details section that checks the individual records for the group condition and add the values to the appropriate array.
In the report footer, create 4 formulas that output the entire contents of one of the arrays delimited by a newline character. If your arrays contain strings, you can simply use the Join() function to output the whole thing with a delimiter. Make sure those formula fields are set to "Can Grow" and place them side-by-side.
The downside to this is Crystal arrays are limited to 1000 elements, so if you'll have over 1000 records per group, this is a bad idea.
You could make 4 individual subreports for each group and place them side-by-side. I've never tried something like this before, so there might be some quirks that I'm not considering. Generally, though, you should be able to put whatever you want in the subreports and as long as it doesn't grow too large width-wise (you may needle to manually specify a very small page size in the subreports to make sure of this), it should look relatively the same as how you place them in your main report
If I understand the question correctly, you want to implement your report in a format similar to a Pivot table (as can be found in Excel).
The Crystal equivalent of this is call a Cross-Tab - you can add one to your report by selecting Insert>Cross-Tab... . This will bring up the Cross-Tab Expert, which will enable you to drag and drop the fields you want to see down and across the page into the appropriate places.