Select the expression Fields!OrderDate.Value to group on for the table. Right Click on the table in the report on the Data row and select Edit Group. Then click Edit Details Group and then on the General tab, select Fields!VendorID.Value from the Group On box under Expression. Grouping List Box that surrounds all of the data by right clicking and selecting Properties. I don't want the time to show on the report.įormatting for the dollar amount fields as the number is just a decimal with no $ and no commas and several digits after the ".". I also added an IIF statement to prevent any blank lines due to a Null Address2 field.Īdditional formatting for the Vendor field, I added some text to let the end user know that the value in the box was for.įormatting the Date for the OrderDate and ShipDate fields. I added the Page Header and Footers to identify what the report was about and the date it was run as well as the Page Count - should someone want to Export it to Excel or PDF.Īll of the address data is in a single textbox and I added Chr(13) & Chr(10) in the box to get line breaks between the addresses. Protected void Page_Load(object sender, EventArgs e)Īdd the rest of the fields to the report and format the font size and textbox sizing. The code for the binding function in the webform page code You can easily verify the DataSetName by clicking on the List object and looking for it in the Properties box. If you were to call the ReportSouce with just "VendorDS", you will get the following error when running the project:Ī data source instance has not been supplied for the data source 'VendorDS_dtVendor'. This is the name of the data source that the Report is linked to even though it is the same DataSet. When I dragged and dropped the first field from the local DataSet onto the report List object, it linked and renamed the dataset to a hybrid of both the DatasetName_DataTableName (VendorDS_dtVendor). Note that the call to ReportDataSource uses a slightly different name for the Named Dataset that the report is pointing to. SqlDataReader dr = SqlDataLayer.GetVendorReport() Īnother function is used to set the dataset (dsVendor) table as the report data source and map the report path. In a separate class file, I add a static function to return a SqlDataReader with the data from the View I created. Coding the SqlDataReader and Dynamic DataSet Finally, drag and drop on of the fields inside of the Rectangle. Add a Rectangle object inside of the List object. Open the Toolbox tab and drag and drop a List item on to the body of the report. The Website DataSource window should have the DataSet that we added to the project. Adding the SSRS ReportĪdd a new item of a report to the project and double click the new. The data type for the Order and Ship Dates should be System.DateTime. The data types for the amount columns should by System.Decimal. Name them accordingly and make sure that they are the correct DataType. Right click on the DataTable and add columns to it. Double click to open it up and then Right Click in the blank area to add a DataTable. Do not add a ReportSource or Report to it.Īdd a new item of a DataSet to the project. Open up the aspx file and from the Toolbox, add a ReportViewer to the new webform. Add a New Item to the project of an WebForm. It returns the Vendor ID, Name, and Address and the Order Dates, Ship Dates, and Totals for the purchase orders.Ĭreate an ASP website in Visual Studio. Using SSMS, I created this View in AdventureWorks using the grid. xsd file will be populated with data in a call to the AdventureWorks database in code. The data set will be created manually and be independent from the report as opposed to an automatically generated DataSet using the Wizard that steps through creating the connection string, selection of data tables, and creation of the Fill and GetData methods. rdl file that I created for the composite report: SSRS Composite Report. This article covers creating an SSRS report on an ASP.
0 Comments
Leave a Reply. |