RDLC - Adding a Data Source in VS2010 - visual-studio-2010

Greetings.
I have an RDLC file and am wanting to add a data source to it, although without any luck so far. The data source is a custom class written by myself (just to add, we do this all the time). We recently converted over to the VS2010 RDLC format which caused some problems, but we've made some changes to our implementation that workaround the more major issues.
So, back to the issue at hand, when I attempt to add my data source to the DummyDataSource list in the RDLC view in VS2010 it just does nothing, however it does add the data source to the list of data sources, but you can't select it from the drop-down list in the RDLC view which means I can't add the data source at all.
Has anyone come across this problem? Is there anything I need to check? I've searched with fervour and had no luck.

There seems to be a bit of black magic going on here. Or at least I haven't figured out all of the incantation to make this happen reliably.
I think I was having a similar problem. Not sure if this will help you, but here's how I got around it.
In the VS2010 report designer, use view->Report Data to show the Report Data pane.
Click the New button and choose Dataset... to get the Dataset Properties dialog.
Name your Dataset, if you've done this before, you probably know that the dataset name here needs to match the name provided in code when you bind your ReportDataSource.
The new part that I just tried, is to click the New... button next to the Data source drop down list. The resulting wizard walks you through selecting your assembly and CLR class (use the checkbox to select your class).
When the wizard finished, my new dataset appeared.
One thing to note: The first time I tried to reproduce this, the wizard completed without adding my dataset. I went back to my class definition and decorated it with [DataContract] and [DataMember] attributes and then re-ran the wizard and it seemed to work great.
Perhaps someone with deeper knowledge can comment on why those attributes make this work, or why the wizard fails silently without them.

Your data source object must include a native data type as a property on the class, otherwise it doesn't let you add it. Funny, eh!

I could not add the datasource, after following the wizard (new button) the data source did not appear in the drop downlist.
What I did was add a property with a primitive type VS class and then proceeded to show the correct data source.
Strange to have to do this, but I found another way.

If you are using a stored procedure, replace everything inside the procedure with one row select using no source tables/functions. I couldn't get it working with a stored procedure that returned data from temp table or normal table either.

I have seen this happen when your final select in a Stored Procedure pulls from a temp/memory table. You have to fake the designer out by adding a dummy select 0 AS mycol1int, '' AS mycol2string, etc. Once you have created the Dataset, you can then remove that dummy select. Another marvelous, fabulous feature in VS! They own the DB, they own the IDE, but...

If added data source object is not shown on ReportData then:
1. Right click on rdlc and click open with
2. Select xml editor
3. add your needed dataset by hand.
After this refresh ReportData and you will see the datasource object on the list.

Related

Form and Report on same page (Form as detail of selected report page)

I am curently moving my small business app from ms access to Oracle Apex 20.
What I need is a page that shares both the report where I would select a row with record and form element at the top of page that would show details of the record.
Can someone give me an advice on how to start? I tried creating a blank page and inserting report and form elements manually but I am getting error No Primary Key item has been defined for form region rep7.
I suspect I need to connect the form and report with primary keys but don't know how. Closest I've been to solving my problem was watching this:
https://www.youtube.com/watch?v=H-hoMcMIs9g&ab_channel=MostafizMitul
but I couldn't quite decipher it.
Thank you
Jakub
The way you described it, it is a page whose type is Master Detail. Just follow the wizard, it'll create everything for you.
True - you can do it yourself, manually, but - why reinventing the wheel? The whole idea of Apex is to make things simpler for us, developers, to save us from boring actions we'd repeat over and over again. Let the wizard do it!

Finding source of data in SSAS tabular

I have the following table in SSAS tabular using visual studio.
I would like to find out what source table Customer name uses as it seems to be using a wrong table, but I can't figure out how to find out which table it uses from.
picture of property window
View the properties window. To display this, highlight the table in SSDT then go to View > Properties Window or press F4. After this, find the Source Data field and click the ellipsis next to it. This will open a window that will display either the source table/view, stored procedure EXEC statement, or SQL command that the table is derived from.

Can't update default views' definitions permanently

I've created a subgrid showing a custom entity Blopp. It shows, the records are viewed as supposed to (related ones only) but I was unhappy with the columns' order and size.
So I went to the solution and made the changes. To my surprise, I discovered that they are not shown when I load the Contact form.
Before anybody jumps up with joy - the save is done, the publish all is done, it's the correct view set in the subgrid and when I pick a different view in the subgrid and then go back to the manipulated one, it shows as supposed to!
What's up with that? The way we're handling it now, we need to remove the subgrid and recreate it again.
What can be the cause and how do I kill it?

BIRT - How does Data Binding works?

I'm trying to create my first BIRT report and this data binding thing is confusing the bejeezus out of me.
So I have a data set that's working.
I right clicked my table and selected edit data bindings. I put in display names for all of my columns and changed the datatypes.
That seems to have been saved. But nothing appears on the report.
I then tried dragging columns from my dataset onto the detail band of the table, and when I do that BIRT brings up a (different?) data binding editor where it doesn't have any of the changes I made, and I'm not sure what I'm supposed to do with this one.
Could someone explain to me the basic process of getting my dataset to show up on a report table, and what all this data binding stuff is supposed to do?
Have you been through the tutorials? They answered most of my basic questions, including your other q about templates.

Save Silverlight DataGrid sort

I have a Silverlight 2.0 DataGrid that contains a list of items that needs to be refreshed in an interval to display the up-to-the-minute information. There are items in this grid that may be added and may be removed while the screen is being displayed to the current user. For Example:
If grid looks like the following, then after a minute the data needs to be refreshed because another user has added a 4th entry. (notice the sort is assending by Last Name)
Data Grid http://img16.imageshack.us/img16/1667/datagrid.jpg
Then when I get the new data set and set it to the datagrid's DataSource property, it resorts the array based on my first column like so:
Data Grid2 http://img19.imageshack.us/img19/1294/datagridb.jpg
Is there any way to reapply the sort after the data source has been updated? I'd like to save the fact that the data grid is sorted by last name, then update the data source, and then reapply the sort to the data grid. So, in the end the datagrid would look like the following:
Data Grid3 http://img13.imageshack.us/img13/4636/datagrid2.jpg
These screen shots are of course not a Silverlight data grid, but this is for simplicity in explaining the situation.
Probably the best way to go about it is to use PagedCollectionViews, although I have not tested this out myself, these classes contain a property that stores the different sorting methods applied to them. I believe that you can probably grab the current sorting element from one collection, connect to the new collection, and apply the sorting to the new collection.
For a more in depth discussion on how this all works, you can follow the explanation here
I tried using PagedCollectionViews as well as CollectionViewSources (I used the new collection to overwrite the existing source collection).
My solution isn't the most elegant, but it works. When updating the source of the DataGrid I did my own change detection.
In other words, instead of blindly overwriting the source collection I iterated through the new collection, compared each item to the existing collection, and updated the existing items where possible.
Hope that helps.
After researching how to do this, I have figured it out. I tried to implement what the others said to try, but could not get it to work in Silverlight 2.0. Thus, I searched StackOverflow and Google for more answers. ScottLogic and CodeProject seemed to be what I was looking for but I couldn't get them to work fully. So with a bit of frustration and playing around with code, I finally arrived on the solution.
If the collection that you're using for your DataGrid's ItemsSource is ObservableCollection(Of T), you can get the ability of sorting for the object, plus you can update the collection dynamically at runtime, causing the grid to refresh with the item you insert. I've created a Google Code project that is GPL for you to checkout and download. Please note that I'm using the Microsoft Silverlight 2.0 DataGrid December 2008 Release for this project. I have linked to this download on the project page as well. (The dll's required are referenced from within a lib folder inside the project).
Enjoy!
Silverlight 2.0 DataGrid Sort Project on Google Code

Resources