Can't see or add Website Data Sources in RDLC report in ASP.NET MVC - reportviewer

In the RDLC report, in Design view in Visual Studio 2008, we don't see anything in the Website Data Sources tab and the button to Add New Data Source is grayed out. Only the Refresh button is enabled, and clicking it doesn't do anything. Our business logic layer returns Lists of business objects and the business logic and business object projects are both referenced by the MVC project. This is an MVC app, so there is no App_Code folder.
How do we get our business objects to appear in the Website Data Sources list so we can drag and drop fields from the object onto our RDLC report?

I think I suffered the same problem as this.
I solved this by closing all open VS windows, cleaning, rebuilding the solution then adding a new WebForms page (yes I know its MVC) but it then seemed to trigger a refresh in something and the data sources showed up when we reopened and editted the rdlc file.

I have also been frustrated by this, using VB.NET, but this should fix it:
In addition to the reference to:
Microsoft.ReportViewer.Winforms or
Microsoft.ReportViewer.WebForms
You need to also add a reference to:
Microsoft.ReportViewer.Common
The Data Sources panel is still blank, but when you select Add Dataset, you'll see the correct options.

Try this...
https://msdn.microsoft.com/en-us/library/yft2c9ad.aspx
On the menu bar, choose View, Other Windows, Data Sources (or choose the Shift+Alt+D

I had the same problem in Visual Studio 2008. The solution I accidently found was to do the following:
1 - Launch VS 2008
2 - Open Solution
3 - Open report file (rdlc) and make sure "Website Data Sources" pane is showing
4 - Close VS 2008 (with the rdlc "having focus"
5 - Launch VS 2008
6 - Open Solution
You should now see the data in the Website Data Sources pane

One of the problems I had was that my DataSource class didn't have a parameterless constructor...after the parameterless constructor was added "the class" showed up in the DataSource list.
Small detail, but lost some time to figure it out. :)

Related

How do I get Visual Studio 2012 to generate code from a windows form design?

I am trying to add a simple windows form to my VB.Net project. I have used the designer to design the form how I want it with buttons, a text box and a Timer. The problem is when I try to view the code, there is only an empty class that looks like this:
Public Class MCastMain
End Class
I have set the application type to a windows form application in the project properties, and I have made a successful build of the application since doing so. I have been scrawling the internet and this forum for about half an hour now and I can't find one other person who is having this problem, nor can I find a tutorial that mentions any special steps that must be taken beyond what I have done. This is the first project I have done in Visual Studio.
I know this is probably stupid simple, but I have no idea what to do. Any help is appreciated as always.
Forms comes as partial class meaning the code is separated in two files.
The "empty" code you shown is from "mcastmain.vb" (if the file is named as the class).
With that one there is a (probably hidden) file "mcastmain.designer.vb" file which contains the generated code by the designer ; and is not meant to be modified (as any designer change will rewrite the file).
To show the hidden files you have to look in the solution explorer on the button on it's top there should be a "show all files" button. (it may be possible to do the same via the menu but I don't have VS right there to be sure where)

User control type not defined

I'm having trouble adding user controls to my project.
I right-click on my project and select Add -> User Control...
I then click Add
I drag a label onto the new user control, and save it.
I build the project, go back to my main form, and drag the control from the Components tab in the Toolbox onto the form.
I see the control, but I get an error:
Type 'crm.UserControl1' is not defined.
If I do this with a blank project, it works. I'm not familiar enough with vb.net or visual studio to understand what's going wrong.
If I double-click the error, it brings me to this line in the generated designer code for the form:
Me.UserControl11 = New crm.UserControl1()
and says that crm.UserControl1 is not defined. If I change it to Global.crm.UserControl1, it works, but obviously this code is overwritten when I fiddle with the designer.
Any ideas, or pointers to get me started in the right direction? Thanks in advance.
My main form had the same name as the root namespace. This is what caused the problem.
Kind of late to the party with this one but I had this problem and I think that the issue was due to the controls being built in a more recent framework than the one that I was using.
Basically my custom controls were built in 4.7, but my project was being built in 4.5.1
Once I changed the current build so that they both were the same it compiled happily.
As far as I know, it is kind of accessibility issue because you are able to solve the issue when you try to access the object globally. I think when you drag and drop the control, the definition codes of the control in the designer class automatically generated with private accessibility but I don't know why. You could try to change it as public. I hope this will work.
Way late to this party. I fixed it by referencing it in the aspx page with the following as it was missing.
<%# Register Src="~/Controls/mycontrolname.ascx" TagPrefix="ucControl" TagName="MyControl" %>

Why would a .sln file open as empty in VB2010Express when it should open referring to projects etc. as it did before?

Why would a .sln solution file open and appear empty in Microsoft Visual Basic 2010 Express - i.e. no windows showing projects and code files etc.
When I inspect the file in a text editor, it contains references to vbproj files (which are present) which indicate that it should not appear as empty.
No error messages are reported when the file is opened.
Update:
(To illustrate my problem)
It attempts to load the projects that belong to the solution:
And then results in a bare solution screen
Express Edition is limited to on project per solution. If you have more than that, you will not be able to use the solution file with the express edition of visual studio. You will need to open the projects separately.
The answer is that the projects did load for the solution but the Window to display them was not open or visible. To make it visible, go to the View menu and select Other Windows:
This displays the 4 projects referenced by the solution
Forgive me for blurring the project names but this might be commercially sensitive and therefore not for public awareness. But you get the picture.
In summary it was my lack of knowledge about the tool, though I had looked under the Window option first thinking along these lines, but the View menu is actually where one would go to display things about the project.
Thanks to everyone for your contributions.

Charts and plots in .Net 4 using Windows Form

I am using Windows Form and .Net 4 in Visual Studio 2010. I need to do some cross-plots, and would like to have a few features, as cursor and zoom in and out.
I tried to use ZedGraph, however I was not able to add its controller to the toolbox. I don't know if I have done something wrong or if it is not compatible.
Do you have any suggestions?
Thank you!
First, I'll assume you are using WinForms (as opposed to WPF).
Add references to the ZedGraph DLLs to your project
Right-click references in the solution explorer and select Add Reference
Select the browse tab and locate ZedGraph.dll (also ZedGraph.Web.dll if needed)
Rebuild the project (F6)
In the Toolbox, check that ZedGraphControl has appeared under Components
This control can be added to the design layout of a form.
Alternatively, once you have the reference added, you can add a graph to a form in code with the following:
using ZedGraph;
ZedGraphControl myZedGraphControl = new ZedGraphControl();
// set size, location, etc. properties
form1.Controls.Add(myZedGraphControl);

Windows Workflow 4.0 Activities not being added to the toolbox

I've created a class project in VS 2010 Beta 2. I've added one Activity to it. Saved it. Created another Activity. I would expect the first Activity to appear in the toolbox so I could drag it into my workflow, but it's not. Any ideas?
I had this problem with Visual Studio 2010 RTM as well. I wrote a blog post with a potential solution here.
Essentially, the toolbox doesn't load your custom activities if you have two projects in your solution that share the same folder.
Make sure your Custom Activity class is marked as public.
I experienced this issue too. My workflow service project was part of a solution with other projects. I removed the workflow service project from the main solution and created a new solution only containing the workflow service project. After a build, the custom activities were generated and listed in the toolbox.
I don't know if this is still relevant for you but I had the same problem.
I could solve it like this:
Right click on the Toolbox to open context menu.
Select Choose Items...
Select the tab System.Activities Components
Click on browse and select the dll that contains the custom activity
Make sure that the activity shows in the list and is checked
Click OK
Not really the same question but in Visual Studio 2012, on a 64 bit windows, I had a 64 bit application with CodeActivity and NativeActivity and they were not showing up in the toolbox. I changed the application to AnyCPU and built it, and the activities are now displayed...
I hope it will help someone :)
I resolved this by creating a Windows Workflow 4.0 Console application and then removing out the Program.cs. Very odd, but it worked.