Solved

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

Posted on 2008-10-13
1
2,892 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Tableau Server - email options 5 123
Create dynamic SSRS connection string 10 176
report showing ***** in 11g 13 86
SQL Reporting 8 79
1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

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

13 Experts available now in Live!

Get 1:1 Help Now