Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.
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
Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!
Leave a Reply