x

Dynamic Report creation in ssrs

I want to pass the excel file name in a text box and then want to create a report from the data available in that file.What i want is to create the report dynamically according to the file name in textbox.How can i do it??

more ▼

asked Apr 20, 2010 at 02:36 AM in Default

xyz gravatar image

xyz
1 2 2 2

(comments are locked)
10|1200 characters needed characters left

3 answers: sort voted first

It is possible to build a report that takes a parameter value to construct all or part of a datasource. If it is only the filename that is changing then it will be one parameter, if more details are different then you will need a parameter for each difference. You wont be able to control the error handling very well so your users could get ugly error messages if they provide a value that isnt valid. This is a good start for you http://msdn.microsoft.com/en-us/library/z72eefad.aspx

more ▼

answered Apr 20, 2010 at 03:45 AM

Fatherjack gravatar image

Fatherjack ♦♦
42.7k 75 79 108

(comments are locked)
10|1200 characters needed characters left

Please check this [flash video demo][1]

[1]: http://www.fast-report.com/en/products/frnet-flash-demo.html
more ▼

answered Oct 06, 2011 at 11:55 AM

CNewton1 gravatar image

CNewton1
11

(comments are locked)
10|1200 characters needed characters left

You can add a new DataSource to the report where it will use ODBC Driver. Then at least in SSRS 2008R2 you can define the ODBC connection string for the excel file as an expression utilizing an parameter containing the path to the excel file.

Then you can build your datasets reading from the excel.

However you have to take in mind, that the select should always return the same columns, so the excel files should have the same structure.

Another note is, that the expression in data source can be evaluated only during runtime, so for design time, you have to put a fixed ODBC connection string and once you want to test the dynamic behavior, you put the expression for connection string.
more ▼

answered Oct 06, 2011 at 02:45 PM

Pavel Pawlowski gravatar image

Pavel Pawlowski
22.3k 9 11 21

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x555
x115
x94
x51

asked: Apr 20, 2010 at 02:36 AM

Seen: 3160 times

Last Updated: Apr 20, 2010 at 06:59 AM