Solved

how do I use a text file as a data source in SSRS

Posted on 2008-10-13
1
3,301 Views
Last Modified: 2013-11-05
Does anyone have an example on how to use a text file as a SSRS data source?  In this case it is a CSV file.  I know that I could use SSIS to import and then report off of it, but I would rather directly access the file from within SSRS.

Thank you
0
Comment
Question by:fmsdev
[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
1 Comment
 

Accepted Solution

by:
fmsdev earned 0 total points
ID: 22725585
found this at: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=955207&SiteID=1

RS supports ODBC providers, so you can specify that you want to use the CSV/text provider, and set your connection string accordingly. (The designer may have issues with regard to removing the '{' and '}' characters from the connection string, if you use the data source dialog for setting the connection string. So, after choosing the data source type, ODBC, and setting the credentials information in the data source dialog, be sure to insert the connection string directly in the RDL.)

Here is the connection string to use (be sure to change the path from "c:\" to location of your text files):

Driver={Microsoft Text Driver (*.txt; *.csv)};dbq=C:\CSVFiles\;defaultdir=C:\CSVFiles\;driverid=27;fil=text;maxbuffersize=2048;pagetimeout=5

As an example, create a file that contains the following, named flatfile.csv. Place this file in the location specified in your connection string.

File contents:
    Col1,Col2,Col3
    Hello,there,123

Now you can query this using this query string:

    Select * from "flatfile.csv"
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

696 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