Crystal Report displaying Group Header multiple times - crystal-reports

Hi I am using Crystal Reports 10 to generate my reports. In one of the reports I see that a group header is getting repeated 2 times in the output document while in the design tab I can that it is present only one time. I am having my query as a "Union All" of 2 data sets.
Please advise what could be the cause. Thanks.

Your grouping condition just generates two different groups and some detail suppression condition kills details for one of these groups?
Create "debug" detail section without any conditions and show there some non-empty field from leftmost table from your data tree (and optionally something from other tables) - usually this helps to debug such problems out. (I usually make such debug fields red to rememeber hide that section before sending report to customer :)) Check too that "convert null values" options in report options are set appropriately.

Related

How to filter records in a single section of Crystal Reports

I have my base record set filtered with a parameter. However, this leaves me with 6 records and I need to filter down to one particular record in each of my sections. If none of the records meet my criteria i cannot suppress the section, it will need to just stay there and blank.
Essentially, I need a method to filter down records that hit one of my sections but not affect the report as a whole.
A few notes:
I cannot use a subreport for this. I need to duplicate this effort over a couple of sections and if I add any more sub reports it just crashes crystal reports (I have a lot of data & a ticket with SAP)
Using a suppression formula hasn't worked yet because I need the section to exist, if it has a null value
Applying no filter doesn't help me because it will duplicate my section 6 times
2 options.
a)
Right Click on white space and choose Insert Group
Choose your field and select specified order or use another record that can filter your data
On the Specified Order Tab click New
Select equal to on the combo box and specified what record you need to be shown
or
b)
Right click on the record
Next to the suppress check box, click on x-2
Here you can create a formula to suppress the records that you don't need.

Crystal Reports printing multiple detail lines

In Crystal reports, I have a detail line that includes fields from multiple TSQL tables. Detail lines print twice because multiple records are returned from one of the tables. I want only the first record returned for each of the tables with fields in the detail section.
I have tried to use field formatting to suppress after RecordNumber>1 but this only suppresses the field. I have Select Distinct records selected in database options.
I am not seeing a way to do this with Crystal options or formatting. Am I wrong? The only option seems to be a TSQL command to pre-process the table.
A cheap work-around could be to set up a suppressed running total variable that resets on group change, and then, suppress the detail section if the variable RTotal is greater than 1.
However, you're likely running into issues because the tables have not been joined properly. If you don't correctly identify the relationship between SQL tables using their respective ID columns, Crystal Reports will cross join those tables--giving you duplicate rows.
You can check the Table Link. Then on the Fields Right click and Format Field. Click on Suppress Duplicate if you want to see Unique value.
Other way would be creating a group from the detail value and suppressing Details.

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

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")

Crystal Report-Running Total

I have a problem with running Total in Crsystal report9
if their is no values available for a Paticular field how can we return the running total as '0'
Instead of display the Running Total directly in your report create a Formula Field based on the Running Total and drag it into the report.
Your formula should look like this (Crystal Syntax)...
if ISNULL({#RunningTotalField}) then
"0.00"
else
ToText(RunningTotalField, 2)
If there is no data for that particular group, then Crystal won't show it easily. Your options are :
1) Use subreports to display the values for a particular group, and keep the main report just looking at the table(s) containing the group headers.
2) Use a stored procedure as the source so you have full control over the SQL that is run.
The problem is that as soon as you use a field to group, Crystal will only return records where that field has been used. If it was simply in the Details section you could modify the link to a LEFT JOIN and it wouldn't matter, but the group forces the INNER JOIN which means the groups without data are not returned.
Unfortunately Running Totals don't show up if there are no records that match your criteria. An alternative is to use a set of formulas calculated in various sections of the report. The technique is widely described in the Crystal literature. For example, this TekTips gives a very succinct overview of your options.
You set up an initialising formula in each header, with the evaluation time directive "WhilePrintingRecords". This approach was the only one available for doing running totals in the "good ol' days" before RunningTotal objects were available.