Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

Microsoft Reporting and parameters

2008-12-13

If you use Microsoft Reporting, anyone that is used to work with ASP.NET 2.0 or later will be very familiar. In this example, I use the Northwind database (Microsoft Access – not SQL Server). Add the report file, create and configure the data source using the built in wizard, drag fields from the Data Sources window onto the report, and finally, if required, modify the typed dataset that the wizard supplied to you. To view a Microsoft Reporting report, use the Report Viewer control in the Data section of the toolbox.

In detail, open the typed dataset. Right click on the data table and click Configure. You should see a query looking something like this:

SELECT OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry FROM Orders

To add a parameter, append the following code to the query:

WHERE EmployeeID=?

Now, when you have stepped through the wizard, the Fill method of the corresponding data adapter has a new parameter: An employee ID is required! The parameter you send to the Fill method, will be used in the query. Imagine if everything was this easy!

Categories: Visual Basic 8

Tags: Reporting Services

Leave a Reply

Your email address will not be published. Required fields are marked *



En kopp kaffe!

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips