Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Crystal Reports Export to CSV

  • 07-05-2019 9:03pm
    #1
    Registered Users Posts: 1,899 ✭✭✭


    I have a report and I suppressed duplicates records using something I found on the web using the Previous formula.
    This works fine but when I export the report to .csv it includes blank lines where the duplicates are suppressed.I don't want these blank lines.
    I have read almost everything on the web about this but nothing so far has worked.
    Anyone got experience with CR that knows how this can be done? Thanks.


Comments

  • Registered Users Posts: 59,549 ✭✭✭✭namenotavailablE


    As a workaround, if the CSV files are exported to Excel, could you use the 'Find>Go to Special>Blanks' menu choice to select the blank lines then delete them?


  • Registered Users Posts: 1,899 ✭✭✭UrbanSprawl


    As a workaround, if the CSV files are exported to Excel, could you use the 'Find>Go to Special>Blanks' menu choice to select the blank lines then delete them?

    the problem was excel was not on the host pc hence csv ..I will just deploy excel on the pc thks for the reply


  • Registered Users Posts: 59,549 ✭✭✭✭namenotavailablE


    One thing I forgot which may be an issue for you- if your CSV rows are not of equal length of data (i.e. some rows have more data than other), the 'Go to Special> Blanks' approach might select the empty cells on the 'partially filled rows'. This would make it impossible to delete rows which are entirely blank.

    You could insert this macro module to work around this (it assumes that column A is the first column in which data is entered and that there's always something in the column A cell of each row):

    Sub DeleteBlankRows()

    Dim LastRow As Integer
    '
    LastRow = Cells(Sheet1.Rows.Count, "A").End(xlUp).Row

    For i = LastRow To 1 Step (-1)

    If WorksheetFunction.CountA(Rows(i)) = 0 Then Rows(i).Delete

    Next

    End Sub


    It basically identifies the last used row and then proceeds to delete any rows from that to the 1st row which are entirely blank.


  • Moderators, Computer Games Moderators, Social & Fun Moderators Posts: 79,983 Mod ✭✭✭✭Sephiroth_dude


    ^^^ Is that the qbasic language?


  • Registered Users Posts: 59,549 ✭✭✭✭namenotavailablE


    No- it's VBA (a version of Visual Basic specifically used in Microsoft Office applications)


  • Advertisement
  • Registered Users Posts: 1,899 ✭✭✭UrbanSprawl


    No- it's VBA (a version of Visual Basic specifically used in Microsoft Office applications)

    Thanks again..I know were to come if I need any VBA help!


  • Registered Users Posts: 9,555 ✭✭✭DublinWriter


    Anyone got experience with CR that knows how this can be done? Thanks.
    Manually override the SQL in CR and use GROUP BY clause.


  • Registered Users Posts: 1,899 ✭✭✭UrbanSprawl


    Completely gone away from .csv but what I found is that in CR I had not aligned the text fields and sized them properly hence the blank lines when exporting.So now report when exported looks good.I also found a nifty program called crystal delivery which makes things even easier in terms of exports and emailing.


  • Registered Users Posts: 2,781 ✭✭✭amen


    Umm a little of topic but why does the report have duplicate records ?

    imho surpressing the duplicates is not the way to go.

    It would be better to determine the source of duplicates.


  • Registered Users Posts: 1,899 ✭✭✭UrbanSprawl


    amen wrote: »
    Umm a little of topic but why does the report have duplicate records ?

    imho surpressing the duplicates is not the way to go.

    It would be better to determine the source of duplicates.

    The duplicates are reported from the system that populates the database and are real but the end user only needs to see one record.


  • Advertisement
Advertisement