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 there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Crystal Reports Export to CSV

  • 07-05-2019 8:03pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 59,704 ✭✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 59,704 ✭✭✭✭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: 81,083 Mod ✭✭✭✭Sephiroth_dude


    ^^^ Is that the qbasic language?


  • Registered Users, Registered Users 2 Posts: 59,704 ✭✭✭✭namenotavailablE


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


  • Advertisement
  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 9,560 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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