Crystal Report create separate report pages based on field value change - crystal-reports

Looking for some advice related to data grouping and printing in Crystal Reports.
I'm working with an order confirmation form. Ideally I would create separate report pages based on a specific field value change for the 'warehouse' field. So, if any given line on an order comes from warehouse A, it prints together. Then we'd get a page break, and we'd see the form repeat for any lines coming from warehouse B.
I've inserted a new group for "warehouse" and configured the group as 'New Page Before.' But when I attempt to print I'm getting an error related to "There must be a group that matches this field". So there must be some pre-existing grouping that I'm not considering. I'm hopeful I can figure this out.
I am interested to get thoughts on overall design, and if the grouping approach I am trying to take is even the correct one.

Somewhere in your report you probably have a formula such as:
Sum({some_value}, {some_field})
where the {some_field} used to be -- but is no longer -- grouped upon.
Fix that expression to set the desired aggregation level (the 2nd argument) to a field you are actually grouping on.

Related

Multiple copies of a record based on formula

Good afternoon,
I am very new to Crystal Reports, so am not sure where to look for this information and would appreciate if someone can point me in the right direction or tell me if what I am asking for is impossible.
One of our departments uses a field called RecordChanges to note changes made to a record. The field is text and the department stores information there about the date a change is made and the type of change, separated by commas (i know this is terribly inefficient, but it's what I have to work with). I have a Crystal Report that parses this text field and picks up the latest date and latest change made to the record. I would like to modify this report to include ALL the changes made to the record, so if the field RecordChanges of the data source has 3 dates, I would like this record to appear in my Crystal Report 3 times, once for each change that was made. How to parse the field I can figure out but where I'm stuck is how do I make the number of times a record appears equal to the number of dates found which is my {#DateFound} field?
There is a lack of details, but as far as I understood the problem and assuming that you did state in the comment that "there wouldn't ever be more than 5 changes to an order", here is a first try to tackle the situation.
I will assume that you already have a formula that "parses this text field and picks up the latest date and latest change made to the record". And that you know how to adjust this formula to pick up each of the record changes. I will name this formula as {#Parser1}.
Based on {#Parser1}, create other 4 formulas: {#Parser2}, {#Parser3}, {#Parser4}, {#Parser5}. As you probably presume, each formula must be changed to parser the Nth occurrence of the record change.
Create 5 details sections.
Put each formula in each detail section.
Suppress the detail section wich formula is null or empty.
That's it.
The limitation is that you can have at most 5 record changes.
This is an awkward solution, but it is necessary (as far as I know) since Crystal Reports works based on your data rows. It iterates over the rows, but cannot "generate" more rows by itself. If you can manipulate the data source, you can create other solutions.
You still need to do the magic trick to pickup the Nth change from the text.

Crystal Reports XI - Group not returned when adding field which might be null

I'm a very new user of Crystal Reports with no training but with a very light background in programming.
I have been working on a report which should show me some information regarding the order status of parts within my company. I have modified an existing report which had a lot of the information I was looking for and have added several fields containing more information I want to look up (information like stock, delivery date, suppliers and partnumbers). I have one last field I want to add to the report, which shows me the name of the supplier where the part is ordered.
Problem:
When I add this field in the report, the groups where there is no information for this field disappear. When I remove the same field again, the missing groups return.
I have tried to look everywhere for an option or function which suppresses a group when a field is null but can not find anything. I also have tried to add an isNull function to return a certain value when the field is empty, but with no results. Unfortunately I can't review the returned values because the group has disappeared when I add the field.
This problem might have to do with the fact I started working from an existing report, but I have not been able to find a reason to believe so.
Update
I have made some pictures showing the problematic result and the SQL-Query (I can only link to the folder in Onedrive because I'm not allowed to post more than two links at the same time):
http://1drv.ms/1J1enHj

SSRS Aggreation on Calculated Field

I am trying to perform an aggregation on a calculated Field in SSRS and am getting the following error:
[rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox43.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers
This is the formula I tried to use:
=Sum(ReportItems!PlanPurchPrice.Value, "Select_UCPUtilization")
In this Case PlanPurcPrice is also an Expression:
=First(Fields!PawPlanPurchPrice.Value, "Select_UCPUtilization")
Any suggestions on this would be greatly appreciated.
SSRS 2008 does not support the functionality you are looking for unless the report item is located in the header or footer (as is stated in the error message). I would, instead, propose two alternate solutions:
First Option
Place the calculation in your query (if possible) at which point you can then reference the field and the aggregate will work as desired.
Second Option
You essentially want to create the aggregate you're looking to return elsewhere in the report where it is directly connected to the Select_UCPUtilization scope, then reference the aggregated value elsewhere. Follow these steps:
Within the same scope as report item PlanPurchPrice, calculate a sum of the PlanPurchPrice. Name the textbox containing the aggregate something meaningful (e.g., Sum_PlanPurchPrice).
Reference that textbox directly wherever you were trying to use the ReportItems sum before (i.e., =ReportItems!Sum_PlanPurchPrice.Value)
Hide the workaround. Place the aggregate you created in an additional column or row attached to the Select_UCPUtilization scope. Turn the text white, turn off growth and shrinkage, and make the row very tiny (a pixel or two high).
Using the second option, the report item does exist (and is visible, which is important) on the report and contains the sum you are looking to return elsewhere.
Hope this helps. if this doesn't make sense, please reply via comment and I'll help you to the best of my ability.

Crystal Reports: Accessing printed records

I've been working on a report that uses subreports to print records.
The problem is: for the same information, there may be several records - i.e.:
There may be several records for the same product if those records differ in one single column. My goal here is to make a Record Selection Formula that says: "if that item is already shown, then don't show it once again."
I've tried to use (shared) variables for this, but can't seem to find the way, because of the evaluation time.
Selection formulas are already being used to apply some filtering criteria. The column that may differ between two ocurrences of the same record is not always the same, so using a simple Selection Formula is not likely to work...
Any suggestions?
Example:
I used the record selection to tell the report:
"Show me all the products according to these criteria (warehouse=parameter1 and category=parameter2 for example)".
But there may be more than one record for the same product of the same category and inside the same warehouse, if one or more fields are different (for example, different price, different lot)
I want not to display those repetitions.
Your approach is wrong... Record Selection Forumula is something that is applied at report level not on the row level or column level.
If you requirement is not to show the records that duplicates then you need to write the supress condition for those, As per your requirement apply supress condition to the rows or columns.

SSRS report with multi-column content and fixed dimensions

I need to design a report that has some very specific requirements that I am having problems with.
The report needs to have fixed margins at the top and bottom (to allow for pre-printed content on paper). In the body of the report, there needs to be two seperate columns of data (student information). Below this, there needs to be a section that will contain information that will wrap to a new column depending on its length (student course and grade information). In addition, the course/grade information cannot break up a given academic year. Finally, there needs to be messages indicating "(End of Column)" and "(End of Transcript)."
Also, due to the nature of the data, I currently have the different sections of the report broken into sub-reports.
What would be the best way to design this report?
You can use a Tablix to allow your data to be displayed in two columns.
For the rows in the tablix you can leave "CanGrow" as "true" to ensure that it wraps and you will need to set grouping on your datasource based upon year.
You may need to set up a new field in your database that is set to only the year, then you can create a group on that field in your report. If this is SQL Server, you can add the following to the end of the "SELECT" statement before the "FROM" statememt
,DATEPART(YEAR,DateField) AS Year
For "End of column" and "End of Transcript" you will use grouping. You can set group headers and footers to display messages as required.
tutorial on setting up groups:
http://database.blogs.webucator.com/2010/09/10/add-format-and-grouping-to-a-report-in-sql-server-reporting-services-2008/
Update in response to op comments:
In addition, you can use expressions in to group on for data, so you can probably group with the following expression:
=FORMAT(Parameters!YearField.Value,"yyyy")