Avatar of Starr Duskk
Starr Duskk
Flag for United States of America asked on

Lumenworks CSV Writer

I have been looking for an example of how to use Lumenworks to CREATE a CSV file. I've only see how to read one.

Can someone please send me to an example or show me how to use Lumenworks to create a CSV file?

I then need to send the CSV file to the screen for the user to download.

thanks!
ASP.NET.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
Sony vv

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Nasir Razzaq

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Starr Duskk

ASKER
That's what I thought, but the project lead told me to use it to write a file, so I wanted to make sure. Yes, I know how to write a csv file, I was just trying to comply with the project lead who said it was "very easy to do with Lumenworks" as though he knew it was possible. Thanks!
David Johnson, CD

Why use something that you don't need to?

Public Sub ExportDataTableToCsv(target As DataTable, outputFile As String)
    Dim writer As New System.IO.StreamWriter(outputFile, False)
    For rowIndex As Integer = 0 To target.Rows.Count - 1
        For columnIndex As Integer = 0 To target.Columns.Count - 1
            Dim fieldValue As Object = target.Rows(rowIndex).Item(columnIndex)
            If Not IsDBNull(fieldValue) Then
                Dim output As String = fieldValue.ToString
                If output.Contains(","c) Then
                    writer.Write(ControlChars.Quote)
                    writer.Write(output)
                    writer.Write(ControlChars.Quote)
                Else
                    writer.Write(output)
                End If
            End If
            If columnIndex < target.Columns.Count - 1 Then
                writer.Write(",")
            End If
        Next
        If rowIndex < target.Rows.Count - 1 Then
            writer.WriteLine()
        End If
    Next
    writer.Close()
End Sub

Open in new window


http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/d8a2ffc2-3782-46dc-bc97-e0b5cdf9ad29/
Sony vv

test
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes