Solved

Tabular Data Control

Posted on 2004-04-17
17
493 Views
Last Modified: 2008-03-10
Hi,

I am planning to use Tabular Data Control to read the CSV file.  It works fine when it reads from a plain txt file.  But I want to make CSV generate dynamiclly.  But it does not work.  Any ideas?  Many thanks.
0
Comment
Question by:mcrmg
  • 9
  • 8
17 Comments
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10858240
Hi, you say you want to read the CSV - then you say you want to generate it - which way around is it?

Please could you paste the code you are referring to - cheers.
0
 

Author Comment

by:mcrmg
ID: 10858920
<OBJECT ID="objTDC" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<PARAM NAME="DataURL" VALUE="TheList.asp">
<PARAM NAME="UseHeader" VALUE="True">
</OBJECT>

in The List.asp, I loop trough the RS to create CSV, I do not know if it is possible to do that.  Thanks
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10858986
Bear with me on this, now I don't know anything about Tabular Data Controls - but I do know and I do it ofter - about producing CSV files, so...

Are you able to read information from the control, if so can you include a bit of code which say for example will read the first row of data.
0
 

Author Comment

by:mcrmg
ID: 10859129
The following is the code that I use to generate a CSV file, if I add this:

Response.ContentType = "application/csv"

       
Response.AddHeader "Content-disposition", "attachment; filename=myCSV.csv"



I will have a CSV file, and I have no problem to read a CSV file using that Tabular Data Controls, but since I have a real time web application, I do not know if it is possible to generate a csv on the fly for this control to use.


while not rs.eof
      Response.Write "C1"
      Response.Write ","
      Response.Write "C2"
      Response.Write ","
      Response.Write "C3"
                Response.Write vbNewLine

      Response.Write oRs("F1")
      Response.Write ","
      Response.Write oRs("F2")
      Response.Write ","
      Response.Write oRs("F3")
                Response.Write vbNewLine
      rs.movenext
wend
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10859328
Okay, well I take it you are able to read data from the control and to read a CSV file so I guess you just need to do the creating - as follows...

sFilename = "TheFile.csv"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(Path & sFilename,True)

objFile.WriteLIne "C1,C2,C2"
Do while nor rs.EOF
   objFile.WriteLine oRs("F1") & "," & oRs("F2")  & "," & oRs("F3")

   rs.MoveNext
Loop

objFile.Close
Set objFile = Nothing
Set objFSO = Nothing

...one CSV file :)
0
 

Author Comment

by:mcrmg
ID: 10859401
If there are more than one user on the site, and they all want to generate that report, and CSV, too.  Will it have a probelm?  Thanks
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10859497
If thats a possible concern then do the following....

sFileName = "File_" & Mid(Date(),1,2) & Replace(Time(),":","") & ".csv"

Basically thats taking the Day and the Time so you'd get

File_19144236.csv

If you take this route then you'll need to clear the old files from the server from time to time - but thats no biggy.
0
 

Author Comment

by:mcrmg
ID: 10867423
Thanks

Do you think it would be faster or displaying the report in ASP directly?  Thanks
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10867516
I'm not sure what you mean.
0
 

Author Comment

by:mcrmg
ID: 10867529
:)

Currently, I am display RS from DB directly in ASP.

While not rs.eof
......
wend


Which way do you think it will be faster in terms of speed of displaying the rs? Thanks
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10867599
So what is it that you would like to do...

• Display the info to the screen
• Save info to file

You talking about the speed of display - what are you comparing it to?

I'n not sure what you mean.

0
 

Author Comment

by:mcrmg
ID: 10867629
because I use paging in asp, say, I have a rs that contains 1000 records, but I only display it 10 at a time, I was thinking to use this control.  Maybe I was wrong.

The goal that I want to achive is that I want to see if there is a way to :
1. maybe get 10 records from db at a time
2. or, get 1000 back, but do the paging on the client side.
0
 
LVL 6

Assisted Solution

by:Lord_McFly
Lord_McFly earned 300 total points
ID: 10867714
There are MIN / MAX syntax that you can include in your queries but I'm having troble find documentation - I'm not sure how to use it off hand but it basically allows you to specify a range (page) so to speak.
0
 

Author Comment

by:mcrmg
ID: 10867730
is it the syntax in asp or SQL? because I am using Access now.
0
 
LVL 6

Accepted Solution

by:
Lord_McFly earned 300 total points
ID: 10867921
Access uses SQL (SQLis just a langage) and MIN / MAX SQLsyntax - I had a search on the web but couldn't really find anything useful.

When you get your recordset do you apply any filtering (WHERE clause) or do you have a search for so you can create filtering.

Maybe you should limited you search results to say a 100 record by using the SELECT TOP 100 * FROM clause.
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10885429
Do you need any more assistance on this question?
0
 

Author Comment

by:mcrmg
ID: 10928976
Thank you
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now