How to filter records in a single section of Crystal Reports - 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.

Related

SSRS report need to show n-time based on dataset rows

I have designed two pages and each page have different table.Currently my dataset return only one user details.So i have bind all details in table.
Requirement
In case data set return two user details ,need to print two user details.First two pages for first user and second two page for second user.
Is this possible in SSRS report? If yes please guide me.
As you already have a report working for a single user then I would normally do this with subreports.
Asumming your current report accepts a userid or similar as a parameter....
Create a new new report.
Add a dataset that returns a list of users that you want to produce the report for
Add a table and set its dataset property to the name of the dataset you just created.
You can remove the header row and all columns except one from the table
In the remaining cell, right-click and choose "insert Subreport"
Right-click the subreport placeholder and choose properties
Choose your original report as the subreport
Click the parameters tab and choose the subreport property name on the left side, choose the field from your dataset that contains the userid (or whatever value you pass as a parameter) on the right side.
That's pretty much it, when you run the new report, it will produce 1 row per user, in each row it will run your subreport.
You will need to use a matrix, specifically row groups, grouping by using user details, and possible inserting a page break between each instance. This should get you going in the right direction.

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.

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 calculate sum of a formula field in crystal Reports?

In some inherited code, I see group headers/footers have items like 'Sum of #numcount' . I cannot get the sum of a formula field. Any thoughts?
The only reason that I know of why a formula wouldn't be available to summarize on is if it didn't reference any database fields or whose value wasn't dynamic throughout sections of the report. For example, if you have a formula that returns a constant it won't be available. Or if it only references a field that is set throughout the report and returns a value based on that field, like "if {parameter}=1 then 1" would not be available either.
In general, the formula's value should not be static through the sections of the report you're summarizing over (Though the way Crystal determines this is beyond me and this doesn't seem to be a hard and fast rule)
EDIT: One other reason why a formula wouldn't be available is if you're already using a summary function in that formula. Only one level of summaries at a time!
(Assuming you are looking at the reports in the Crystal Report Designer...)
Your menu options might be a little different depending on the version of Crystal Reports you're using, but you can either:
Make a summary field: Right-click on the desired formula field in your detail section and choose "Insert Summary". Choose "sum" from the drop-down box and verify that the correct account grouping is selected, then click OK. You will then have a simple sum field in your group footer section.
Make a running total field: Click on the "Insert" menu and choose "Running Total Field..."*** Click on the New button and give your new running total field a name. Choose your formula field under "Field to summarize" and choose "sum" under "Type of Summary". Here you can also change when the total is evaluated and reset, leave these at their default if you're wanting a sum on each record. You can also use a formula to determine when a certain field should be counted in the total. (Evaluate: Use Formula)
You Can simply Right Click Formula Fields- > new
Give it a name like TotalCount then Right this code:
if(isnull(sum(count({YOURCOLUMN})))) then
0
else
(sum(count({YOURCOLUMN})))
and Save then Drag and drop TotalCount this field in header/footer.
After you open the "count" bracket you can drop your column there from the above section.See the example in the Picture
You can try like this:
Sum({Tablename.Columnname})
It will work without creating a summarize field in formulae.

Crystal Report displaying Group Header multiple times

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.