473,732 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem when exporting sql db to csv/txt file

Dan
Hi,

i have some problem with exporting data from sql server to some formats.
Excel and Word are not a problem, but .txt and .csv do not work properly:
- with .txt, the data are shown (correctly) in the browser but the windows
asking to save or to open the file never appears.
- with .csv, the code below produces an identical excel file as with.xls (no
comma).

Here an extract of the code:

Dim objFileStream As FileStream
Dim objStreamWriter As StreamWriter
....
filecsv = "myfile".xl s" '=this is ok
'filecsv = "myfile".cs v" =this produces an excel file just like .xls
'filecsv = "myfile".do c" =this is ok (word file)
'filecsv = "myfile".tx t" =this produces no file (windows asking to save or
to open never appears)
' but instead the data are automatically rendered correctly in the browser
....
objFileStream = New FileStream(file Name, FileMode.OpenOr Create,
FileAccess.Writ e)
objStreamWriter = New StreamWriter(ob jFileStream)
....
objStreamWriter .WriteLine(strL ine)
....

Do i have to manipulate some parameters in some functions?
Thanks for tips.
Dan
Jun 27 '08 #1
0 1148

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7494
by: Janne Ruuttunen | last post by:
Hello DB2 people, I'm having problems exporting >= 250000 lobs to IXF files with the LOBSINFILE option, using a legacy DB2 2.1 system on Win NT. If I don't specify a path for the lobs, defining more than 250 base names for the lobs leads to an error message something like "DB2 encountered an unexpected error when sending the query to the backend process" (I don't have the exact message at hand). It doesn't matter how short the base...
4
3949
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear" TEXT field that contains data such as 2000/01, 2001/02, etc. If I export a Query with this kind of data to Excel, it gives me the text value of this field; however, when I export a Report bound to this TEXT field, Excel gives me the values 36526,...
1
3896
by: Lasso | last post by:
Hi all, Im having problem in exporting pdf file from crystal report. Now I already can show the crystal report but error when exporting. this is my code: Dim myReport As USERReport = New USERReport Dim strExportFile As String = Server.MapPath ("../REPORT/") & "Output.pdf" Dim DiskOpts As CrystalDecisions.Shared.DiskFileDestinationOptions = New
1
3165
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream As System.IO.MemoryStream = 3 myReport.ExportToStream( ExportFormatType.PortableDocFormat) 4 Response.Clear() 5 Response.Buffer() = True
0
1036
by: David Dvali | last post by:
Hello. I have some strange problem and will be very thankful if anybody will help me to solve it. In my ASP.NET web form I have used CrystalReport to produce some report, now I want to export this report into PDF without saving any temporary file on server disk. I'm using such code: P.S. At moment when this code is running I already have "crReportDocument" created and assigned all required parameters to it.
2
2870
by: Mux | last post by:
I am facing the following problem while exporting data to Word. The current implementation is as described below: I have a JSP file which has a link that enables you to export the data to Word. Clicking on the link invokes a javascript function: function showRTF() { var newWin = window.open("", "newWin","width=900,height=800%,scrollbars=yes,menubar=yes,resizable=yes,too
2
1494
by: David | last post by:
We've developed a seismic-data processing app in VB.NET 1.1 which runs on XP Pro using SQL2K. Like all seismic data apps, it deals with HUGE amounts of binary data (we use NTFS sparse "flat files") ... a typical user will have a 20 Terabyte raid array. During a particular operation that reads, formats and exports these files, we've noticed that sometimes it runs rather slowly... like it might take 12 hours to finish exporting the same...
5
2132
by: Dave | last post by:
Hello, I have a possible problem exporting a text field that happens to contain dates (but is not a date field) when using TransferText in MS Access 2000. I am exporting a query to a text file using TransferText in a module. One of my fields is a text field called "invoice description". This field may include any content including dates (e.g., 01/01/2006, 1/1/2006, 01/01/06, Invoice #1, Jan 2006, 293842, etc. are all
0
2055
by: db2admin | last post by:
Hi, I am getting error when exporting data from mainframe using db2 connect while i am on db2 on linux. Here is what error looks like ============================================================== $ db2 "export to abc.ixf of ixf lobs to /tmp modified by lobsinfile select * from temp" SQL3104N The Export utility is beginning to export data to file
0
8944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8773
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9445
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9234
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6030
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3259
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.