Crystal Reports: Accessing printed records - crystal-reports

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.

Related

Crystal Report create separate report pages based on field value change

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.

Listing multiple values from the same record multiple times in crystal reports

I have a PDF "student record" that we need to print the values on. Because of this, all values must be printed where they are listed on the pdf and I can't just put everything in a list format. I have attached a screenshot of the bottom lefthand corner of the PDF as an example.
Obviously, grouping wouldn't allow me to print out different values of the same record like this. It probably wouldn't allow me top specify which record goes on which line exactly either.
Is it possible to make a formula field that pulls the correct record for each line?
For example, dragging the "Student.Relationship.FirstName" field always lists whatever 'first' relationship is on their record.
Can I make a formula that specifies that will pull the second relationship record instead of defaulting to the first?
Can I make a formula that can specify "student.relationship.firstname" WHERE student.relationship.type = "father"?
SUBREPORTS.. I think that is what you need. Create a grouping on STUDENT, add Extra sections for the same group and on each section insert a different Subreport that has details as required.
Pass the Student ID as the sub-report link.

Crystal Report suppress a whole row in details section

I am using crystal report in my vb.net program. Because of my database design I get some rows duplicated as in the following picture:
As you can see from the picture, the first record has two printer models that have the same ink group. and the next model is the only model that has that particular ink group. As I have mentioned before This is because the way I designed the database and its not the problem. I know how to suppress a single column.
When I select a column and check "suppress if duplicate", the following results show:
The row is suppressed but also has taken a place in the report details.
My question now is how to suppress a whole duplicated row?
thank you
As you are aware that your database design is producing these type of results, one option would be check the option Select Distinct Records so that only distinct records are displayed.
One more option.. This is not a tested one change as you required, This is just an idea
write a condition in supress of the section where you placed your data.
if ID=next(ID)
then true
else false
This condition will make sure that if next row is duplicated then it will be supressed
there is many Options , Easy one Is,
you can use Grouping in Crystal report , in your Example u can Group on ID then Suppress Group Detail and Group Footer Problem Solve Have Fun with Coding

How to make zero tablix data rows appear?

I am developing an SSRS 2008 report. I created a tablix, however, when I view this report one of the rows has zero entries. This row is not showing in the output. How can I make it show regardless of values so that it will just show "0" otherwise?
This was the expression I used for it:
=iif(CountDistinct(Fields!Client.Value)=0 or
isnothing(countdistinct(Fields!Client.Value)),0,
CountDistinct(Fields!Client.Value))
And I have tried grouping on different fields and also filtering on another field, but none of these make it appear when there is no data.
I think that the best you can do is ensuring that the dataset you are using has the record you want, even if it is null. For example, if you are grouping months, and you want all 12 months to appear in your tablix, then you need to make those months to exist in your dataset even if they have null values for all the other 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")