?
Solved

Tabular Data Control

Posted on 2004-04-17
17
Medium Priority
?
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 
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 1200 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 1200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

718 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