Our Sites | Alchemy NetCOBOL

Creating your own NeoBatch SQL Reports in VS2010

Friday, February 25, 2011

With the release of Visual Studio 2010 and SQL Server 2008 R2, the way reports were being done for VS2008 has been changed and such we need to change the way we create our NeoBatch reports.

I’ll do a quick walkthrough of how to create a simple report for NeoBatch

Creating the Project

1. Start up Visual Studio 2010

2. Go to File –> New Web Site, Select Visual C# and choose ASP.NET Reports Web Site, Click OK.



3. Visual Studio should start up the Report Wizard, Configure your connection to your NeoBatch SQL Database, Click Next, Save the Connection if you want.



4. Choose your database objects, for this simple chart we are just going to select the jobs table from our NeoBatch Database.



5. Click Finish, and then cancel to quit the wizard.

The Wizard should quit and leave you with a project with the database connection but no chart created.


Configuring your DataSet

1. DoubleClick on the NeoBatchDataSet.xsd file in the solution explorer

2. Select the TableAdapter control and drag it from the tool box onto the main window.

3. This should open the Table Adapter Configuration Wizard. Select the NeoBatchConnection String created when the project was created.

4. Select the “Use SQL statements” option.

5. Add the following SQL Query:

SELECT TOP 10 [job].[name] , SUM(S.CpuTime) as TotalCpu FROM JOB INNER JOIN Step S on S.JobId = Job.JobId GROUP BY Job.Name ORDER BY SUM(S.CpuTime) DESC

Click Finish.

6. Rename the TableAdapter to Durations.



Creating your Chart

For this quick example we are going to make a chart that displays the durations of the jobs which have been run in NeoBatch.

This is similar to a report found in the VS 2008 Reports

1. Right click on the black report and select the Insert –> Chart Optionimage

 

2. For this example we are going to do a simple column graph. The first one in the upper left had part of the screen.



Click OK, Select your Dataset you created when creating the project and click ok again, It should then drop a chart onto your report page.

3. Right click on the NeoBatchDataSet under report data on the left side of visual studio and select “Add DataSet…”

Name the new DataSet, “DurationSet” and select the Durations Dataset and click ok.



4. Drag the name value to the category fields on the bottom, and TotalCpu to the data fields section on the top.

5. Right click on the Y- Axis on the left part of the chart, and select “Axis Properties”. Click on the number section and change the value from Default to Number. Click OK.



Do the same for the X-Axis, however for this axis under Axis Options, change the interval to 1.



6. Select Default.aspx, Click on the arrow in the upper right hand corner, this will open the ReportViewer Tasks. Select choose DataSources. For DurationSet select ObjectDataSource2.



7. Running the project should now display a report:



8. From here you can clean up the report, rename a few things, and have a fairly decent looking report. Open-mouthed smile



Questions? Thoughts? Comments?
Comments
Post has no comments.
Post a Comment




Captcha Image

Trackback Link
http://www.alchemysolutions.com/BlogRetrieve.aspx?BlogID=11346&PostID=317406&A=Trackback
Trackbacks
Post has no trackbacks.

Recent Posts


Tags


Archive

Contact Us | Privacy Policy | Terms of Use | Mainframe Migration | Cloud Solutions | NeoKicks | NeoData | NeoBatch
©2011 Alchemy Solutions. All rights reserved.