Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Tabular Data Control

Posted on 2004-04-17
17
Medium Priority
?
505 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

916 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