Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2005, 05:34 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening the formated output in browser

Hi

I am working on ASP.NET.As per my client requirment i need to generate some .csv reports.Right now i am storing entire formated report into stringbuilder then writing this stringbuilder into.csv file and storing the .csv in serverside.Finally opening the stored .csv using javascript.Is there any way opening the report directly from excel without storing in server?

My reports format is complex i can get the data from single table or single data source.So i cant use Response.ContentType = "application/vnd.ms-excel" ect.

My code is like below

Assume Entire my report format in resstr variable.

    Dim resstr As New System.Text.StringBuilder(4096)
     Dim filename As String
        Dim filepath As String = Request.PhysicalApplicationPath()
        Dim objDir As New DirectoryInfo(filepath)
        Try
            If objDir.Exists Then
            Else
                objDir.Create()
            End If
            filename = filepath + & "test.csv"

            Dim objStreamWriter As StreamWriter
            File.Delete(filename)
            objStreamWriter = File.AppendText(filename)
            objStreamWriter.WriteLine(resstr)
            objStreamWriter.Close()


            Response.Write("<script language='javascript'> window.open ('http://" + svrname + "/" + webdir + "/test.csv','','') <" & "/" & "script>")


 
Old January 18th, 2005, 08:29 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry if i confuse with my prev question.Finally what i am looking is displaying my output string as .csv file in browser.

thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
opening client side folder browser in c# sauravnimesh .NET Framework 2.0 4 November 21st, 2008 07:20 AM
Need HELP with: Formated Input form file LoonyGenius C++ Programming 3 December 25th, 2006 06:43 PM
xml Files read in asp with formated data shaileshk Classic ASP XML 1 June 7th, 2006 04:53 AM
Opening excel sheet in IE Browser venterjo Excel VBA 0 October 10th, 2005 09:52 AM
XSLT in VC++.NET 7.0: Output in Web Browser BigOcean XML 0 February 18th, 2005 11:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.