I am new to writing crystal reports. I was asked to make a report that will show how many MRIs were ordered to be done at our facility compared to those ordered to be done at an outside facility. I got it basically how I want, however, I noticed that a lot of patient orders were duplicated on the report. I believe I have narrowed this down to the fact that the documents are getting created by our scheduler and then signed by her and also the physician.
I would like to format the report so that it removes an entire detail line if the SDID of the order is a duplicate. Can anyone help me?!?
If it's easier to email me directly my address is [email protected] or you can call me at 913-319-7551. Thank you!!
use this formula on your section expert
Report-> Section Expert->
Click on Detail, click on Suppress (No Drill-Down)
Type this fomula: {PatientProfile.PatientId} = Next({PatientProfile.PatientId})
Replace the Patientprofile.patiend inside with the sdid colum of the tablet you are using.
example: Orders.sdid, your formula would look like
{Order.sdid} = Next({Order.sdid})
There's also an option in the properties for each field. Right-click the object, choose Format, go to the Common tab and choose "Suppress if duplicated."
Both of the other answers are great answers and will work fine in most cases, however, if you are working with a really, really large amount of data then your report could run for hours, maybe even just never finish. Another option, especially if you are creating a report that counts things, is to create a Command in the Database Expert ("Add Command" option under your datasource) and use that to code a SQL select statement that selects distinct data. This way you are doing your data gathering on the SQL server and paring down the amount of data that Crystal has to work with. Yes, I know that Crystal has the option to perform the Grouping on the SQL Server, but in many cases it is still best to create the report in this manner.