Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Forms
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 November 18th, 2004, 11:36 PM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default How to generate report from txt file by asp

hi everybody,
i'm a beginer in using asp.
now i have a project need me generate the report from txt file..
i have no idea about...
anybody can help me ??
thank you ...

bey

 
Old November 19th, 2004, 12:24 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

What is the data format? You can use can use filesystemobject to read and display data.

Om Prakash
 
Old November 19th, 2004, 05:06 AM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default

hi Om Prakash,
the data format is as below:
"FileName","NoOfPages","Date(YMD)","user"
it will retieve the file in text file format (.txt)
have any example for "filesystemobject"
thank you very much.......

bey


 
Old November 20th, 2004, 04:55 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Hi,

 Please check the following code:

<%
Option Explicit
'Code to display data from the current text-based logfile
Dim objFSO, oInStream, sLine, sSeg

'Define the constants used by the FSO
Const Forreading = 1

'Create an instance of the FSO
Set objFSO = CreateObject("Scripting.fileSystemObject")

'Check the file exists
If objFSO.fileExists( Server.MapPath( "stuff.txt" ) ) Then

'Open a file for reading
Set oInStream = objFSO.OpenTextfile( Server.MapPath( "stuff.txt" ), Forreading, False )

Do Until oInStream.AtEndOfStream

sLine = oInStream.ReadLine
sSeg = Split( sLine, "," )

Response.Write "<b>A</b>: " & sSeg(0)
Response.Write "<b>B</b>: " & sSeg(1)
Response.Write "<b>C</b>: " & sSeg(2)

Response.Write "<br>"

Loop

oInStream.Close
Set oInStream = Nothing

Else

Response.Write "file not found!"

End If
Set objFSO = Nothing
%>


Om Prakash
 
Old November 24th, 2004, 12:01 AM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default

Hi Om Prakash,
your code is very useful for me...
thank you very much.......

bey






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP write to txt file dizzy1 Classic ASP Basics 7 June 15th, 2010 10:38 PM
export crystal report in txt format mallick_kuet Crystal Reports 0 January 20th, 2007 02:35 AM
How can i generate OLAP Report manoj_k79 Classic ASP Basics 0 December 15th, 2006 08:28 AM
calling txt fields of a form in a report mjuliao Access 1 October 16th, 2005 12:07 AM
Access to the path "E:\WebSites\Report\text.txt" favaedi BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 21st, 2004 11:36 AM





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