Skip to Content
0
Oct 04, 2020 at 07:16 AM

Doesn'rt export a valid CSV file if you use conditional suppression

75 Views

We have written lots of crystal reports which are to export to a CSV to provide interfaces to other software, Sometimes we want to suppress particular lines from the output. Usually you can do this by using record selection criteria - which works just fine. However, sometimes you need to suppress a group summary or even one or more detail lines based on information that can't be determined at record selection time.
I am using conditonal suppression by putting in a suppression formula for an entire section eg details or group footer sectrions.
If we put in conditional suppression on these lines and we export to a CSV file then the field data from the lines is suppressed (which is good) but the actual line itself is not suppressed so we get a loine of commas. So you get output that looks like this =========================================================================
Hours Code,Description,Short Description,Classification,Classification Description
,,,,
,,,,
30,PUB HOL WKD 1.4 CAS,PH 1.4,P,Public Holiday.
31,NORMAL 140,NORM 140,N,Normal pay hours. 32,PPL,PPL,O,Other Leave.
,,,,
33,O/T 1.75,O/T 1.75,T,Overtime.
34,NORMAL - OUTSIDE 6-8,NORMO6-8,N,Normal pay hours.
35,CAS O/T 1.6,CO/T 1.6,T,Overtime.
,,,,
38,NORMAL 180,NORM 180,N,Normal pay hours.
39,W/COMP EXCESS,W/COMPEX,W,Workers Compensation. =========================================================================
when it SHOULD look like this ... ========================================================================= Hours Code,Description,Short Description,Classification,Classification Description
30,PUB HOL WKD 1.4 CAS,PH 1.4,P,Public Holiday.
31,NORMAL 140,NORM 140,N,Normal pay hours.
32,PPL,PPL,O,Other Leave.
33,O/T 1.75,O/T 1.75,T,Overtime.
34,NORMAL - OUTSIDE 6-8,NORMO6-8,N,Normal pay hours.
35,CAS O/T 1.6,CO/T 1.6,T,Overtime.
38,NORMAL 180,NORM 180,N,Normal pay hours.
39,W/COMP EXCESS,W/COMPEX,W,Workers Compensation. =========================================================================
So you can see the first example has several lines which just contain a row of commas. Now if I export this same report to an EXCEL file then it does exactly what it supposed to do and truly suppresses the lines we don't want to appear and there are no lines of commas or blank rows in Excel. I presume that if I export to PDF or any other format I get proper suppression of this data as well. This issue is in every version of Crystal Reports I've tested it in including 2020, 2013, 2008, XI, 10, 8.5, 5 and 4.5 Why doesn't this work?
Or is there some trick to making it work? We have to jump through all sorts of hoops to get around this - like running a report to generate the data that displays the problem and then running another report on the exported data to clean up the rubbish that was exported. By the way, I tried to use your CHAT app on this website but when I asked to chat, and someone said HI, there was nowhere I could type anything in to reply. I couldn't even ask what to do to correct it because I couldn't type anything in anywhere. (It's like your internet service provider telling you to go look on their website to see if there are any outages when you ring up to tell them you have no internet access).