Showing posts with label IDE. Show all posts
Showing posts with label IDE. Show all posts

Tuesday, October 8, 2013

How to work around issue with using Visual Studio 2012 / Web Application to create a .rdlc report using Report Viewer Control

I don't know what I am missing, but as far as I can tell the Report Viewer in Visual Studio 2012 does NOT work properly when using a ASP.NET Web Forms Application. Notice I said APPLICATION, not Web SITE. To clarify, there is no issue you create a ASP.NET Web Forms Site Here is the scenario I will propose a work around to.

  1. Open Visual Studio 2012
  2. Create a new ASP.NET Web Forms Application (This is the critical choice to make this break)
  3. Create a report and call it Report1.rdlc
  4. Open your default page. The master page should have a Script Manager on it already. If it doesn't then you will need to add it.
  5. Drag the ReportViewer control from the Toolbox to the content area on the Default page (or other page).
  6. Use the SmartTag (the little box with a triangle in it on the upper right corner of the ReportViewer control to choose your report. This will create an ObjectDataSource with the improper configured.
  7. You can verify the ObjectDataSource is configured improperly by clicking the Refresh Schema task on the Smart Tag of the ObjectDataSource. It will generate an error similar to:

    The 'AdventureWorks2008R2DataSetTableAdapters.SalesOrderDetailTableAdapter' could not be loaded. If the type is located in teh App_Code folder, please check that it compiles. If the type is located in a complied assembly, please check that the assembly is referenced by the project.

    The type 'AdventureWorks2008R2DataSetTableAdapters.SalesOrderDetailsTableAdapter' could not be found'
  8. Reconfigure the ObjectDataSource and you will see that the problem is that it should have the namespace before the type (that it can't find). It is as if the Microsoft developer that did this functionality didn't realize the ObjectDataSource that would be created is different depending if you are using a ASP.NET Web Forms Application or a ASP.NET Web Forms Site.

  9. Run the application and you will get an error similar to this:

    An error occurred during local report processing.The report definition for report 'Report1' has not been specified Object reference not set to an instance of an object.
  10. To fix that issue, you need to select the Report Viewer and look at the Properties pane. 
  11. Scroll down to where it says LocalReport and expand that area using the Plus sign (+).
  12. Set the ReportPath property to Report1.rdlc (or whatever the filename is of your report).
  13. Run the application again. This time it will hopefully work. 

Alternatives
  1. Do everything in code.
  2. Don't use the smart tag - Create the ObjectDataSource first and make the bindings to the Collection and ReportPath yourself using the Properties panel (not the smart tag since the bug seems to be in the Smart Tag of the ReportViewer).

Friday, March 19, 2010

Getting Started with RIA Services

WCF RIA Services -  You can download a version of RIA Services for either Visual Studio 2010 or 2008. This is also a great page to find sample code, walk-throughs, videos, forums, etc for RIA Services. This is a great starting point.

Below are some links to some more advanced RIA Services topics.

Silverlight 3 and RIA Services - The advanced things – Several interesting advanced topics

Walkthrough: Creating a RIA Services Class Library – If you have a Web Site instead of a Web Application, you may want to look at this since Web Sites can’t be linked to RIA Services. This serves as a nice workaround though and allows for reuse, which is very nice.

How to: Add or Remove a RIA Services Link – Nice if you want to change your RIA Services Link

WCF RIA Services Code Gallery – a good place to get source code for the walk-throughs.

Friday, December 19, 2008

Why can't I see my Visual Studio 2008 Solution File in the Solution Explorer

In Visual Studio 2008 when you open your project or even open a solution file the Solution Explorer doesn't show the solution file by default. There are times that you want to see the solution file, like when you want to add multiple projects to a solution. To show the solution file in the Solution Explorer just follow the instructions below once you are have your project open in Visual Studio 2008.
  1. Go to the Tools Menu and choose the Options... menu item.
  2. In the Options window, expand the Projects and Solutions node.
  3. Click the General node (child of the Projects and Solutions node)
  4. Click the Always show solution checkbox.
  5. Click OK.
Now you should be able to see the Solution file in the Solution Explorer. If you want to add another project to the solution all you have to do is right click on the solution and choose Add | New Project...

Thursday, August 7, 2008

Basics of Subclipse when starting a new project

Subclipse is a plugin for Eclipse that adds a GUI in Eclipse to perform the basic functions of Subversion (like CVS or Visual SourceSafe (VSS)). Basically if you want to use Subversion while in Eclipse, Subeclipse is the tool for you.

This entry assumes that you have a Subversion repository already setup. It does NOT assume your project is in Subversion though. It does assume you already have a project in Eclipse though. In my examples, the name of my Eclipse project is called MyApp. Below are some basic things you should know where to find, but does not really get into Subversion features and how to use them. This entry assumes you know what Merge, Update, Commit, etc are used for, and how to use the other Subversion version control concepts. By no means is this a comprehensive look at all the features. It is really a view of things I use often or can't remember when I do them when I get a new project or start a new project. :)

Adding your project to Subversion.

Make sure your project is actually open (not closed), otherwise the Share Project... menu item will be disabled.

While in Eclipse, Go to the Package Explorer and right-click on MyApp (or whatever your project is called). Go to Team | Share Project...

When prompted select SVN as the repository type.

When prompted select your existing repository location, or create a new one if you don't have one already.

When prompted, use a custom path and append /MyApp/trunk to the path instead of just the default of /MyApp

Enter a comment like Initial import if it is not already specified.

When prompted select the files you want to add to source control. This should exclude any files that are specific to other version control systems such as VSS or CVS.

I would also highly recommend creating three remote folders (branches, tags, and trunk) under the project you just created in SVN. To do this do the following:

Go to the SVN Repository View (you can add it by going to the Window | Show View | SVN Repository menu item if it is not already visible.

Right-click on MyApp project in the SVN Repository View and choose New | new remote folder.

Enter branches

Then do the same for the other one tags

When you are done you will have a hierarchy like the following or something similar if you did not put yoru project at the root of the repository.

- svn://mySubversionServer/MyRepository/MyApp ---- branch ---- tags ---- trunk

Using Subversion operations on a file

Subclipse does a very nice job of integrating Subversion into the Eclipse IDE. To perform operations of a file simply do the following.

In the Package Explorer right click on the file you want to work with.

Go to Team and then choose the operation you want to use. This includes things like Merge, Commit, Show History, get the latest using Update, and a few other features as well.

Useful Perspectives

Subclipse includes some useful perspectives that may not be visible to start with. You can find them by going to Window menu Open Perspective Other...

This will show a window with a list of perspectives.

Click the SVN Repository Exploring and click OK. It is good to see all the projects in the repository or have direct access to the Repository.

Do the same for Team Synchronizing. Team Synchronization has the Synchronize view in it.

If you don't see them, click the Show all button in the Open Perspective window. There are also two other menu items that are of use when you right-click a file. They are the Compare With and Replace With menu items.

Adding a project from Subversion

This handy if you have a new machine, re-installed Eclipse, or just adding a project to Eclipse workspace that someone else put in Subversion and you need to work on now. To do this, do the folowing.

File menu New Other SVN folder Checkout Projects from SVN.

Walk through the wizard until it is finished.

If you want more information on Subversion operations, and installing subclipse see the link below.

http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/

Thursday, July 31, 2008

MyEclipse tabs (views)

If you are new to MyElipse and Elipse you may have accidentally closed one of the tabs in one of your perspectives. I did, and it took me a while to figure out were to go to add it back since I didn't know what the tabs were called anyway. The answer is that they are called Views. Once I figured that out, it was easy to find the solution under Window menu | Show View and then click the View you want to show. You can also use Other... to a full list of Views if you don't see the one you want in the list. You can also drag the View from one dockable area (I don't know what they are really called) to another.