SSRS/RDLC Detail Data Single Value repeated - asp.net

I have been plagued with an issue for SSRS (really RDLC report viewer report) in that the details rendered in a report are the same value all the way down in a group. I faced this before and ended up having to create a new view and pull it into the solution and rebuild the report from scratch. As I am having this again I really want to know what else to try. I have deleted the tableadpator and added it back again, tried cleaning and rebuilding solution. I had altered a view, added a couple of columns to the end, so that is my suspect item as another report that uses the same base view now has a similar problem. This is not a code specific example and sure hoping someone else has seen this behavior and know how to get rid of it.
So I have a ASP.Net web application that uses the report viewer to render some reports, RDLC. I use entity framework for my data access and bind the data to the report.

I found what seems to have been the problem. I am using Entity Framework (EF) and I updated some views to add additional columns for reporting. EF randomly picks a key for columns. If I manually set the key to what it should be, and I set my grouping to be on an ID column rather than text (not sure this really fixed it, but adding as it is part of my solution), then the report is now not duplicating the same data for each row. The odd thing was the count of rows for the group was correct, just somehow would only render the first row data for each row. I know this is not a great example of the root problem and fix, but at least all the reports I had issues with are now working and the only thing that changed for some was the EF model was updated for the view that would bind to the RDLC report.

Related

Cannot add new tables via Entity Framework

I'm encountering a very odd problem. Since 2 days I cannot add new tables from my db in the model.
They appear in the list of addable tables, no error are shown at the validation but then, they don't appear in the Entity lists, and they still appear in the "addable" part of the menu.
The problem appears in
We've tried from different computeurs, so it's not a problem of my specific visual studio.
We've tried with other dbs, and the problem doesn't affect them. It affects boths of my prod and developpment dbs though.
We've tried with the exact same credentials to log to the db (not window authentication as we usually do), and the problem remains, so it's not a problem of rights.
We're a bit out of ideas right now :/
Does someone have an idea what it could be?
Thanks
Ok, we've found where it came from.
The table we wanted to add had no PK, and then when we tested we created mock tables without PK.
Once we add a PK the import goes well =)
If you're using a Code First approach then Entity Framework will build the table for you. It looks like you are not using Code First, so you will have create the table in the database. I assume you're using an Entity Data Model (.edmx)? If so, you will create your table in the database, then update your data model (.edmx). If you have not yet created your .edmx file, you need to do that - the .edmx file will contain all your CRUD operations.
What I'm confused about is I'd imagine your code would throw an error if the table did not exist (i.e. if the table represented by your data model didn't map to an actual table in the database, because it doesn't exist). So, the question is, does your table already exist? If it does, then step through the code line by line to find out why your records aren't being saved. If it doesn't exist, then add the table via SQL Server Management Studio (or similar), then open your .edmx file, right click on the layout that comes up, click "Update Model from database".

is there a DevExpress XtraReports event that fires after all widgets of a details subreport got printed, like for formatting?

I want to be able to go through all instances of a printed details subreport and do some formatting of records, in part by computing stuff for one record based on another one already printed. The code that prints reports is a bit of a mess, so I think this particular issue is easiest to handle by a kind of postprocessing of a printed report rather than by changing the underlying data binding etc code.
Well, frankly, I am unable to find a way even to get to the point where I could format text records in a single XRTable (XRTable.AfterPrint event does not work for me here) let alone format one XRTable based on values output in another one.
Any suggestions? Is this a FAQ with a standard answer or a FAQ with "we are tired of telling people it cannot be done" answer?
There is no such event :(. A possible solution I've posted by answering
does DevExpress XtraReports have an easily accessible notion of “current detail report being printed”?
question.

getting data from controls in <asp:wizard>

Hi
Is there a way to get data on the "last step" from previous steps?
I am interested in pulling data from couple of controls in each step, and then build the object and insert the new object to the data base.
Thanks for every one who helps me.
You can still reference controls in earlier steps, regardless of what step the wizard is currently on.
What did you try and what was the result?

Ideas for Quick Hierarchical Listing - .NET

I have a table in SQL Server listing corporate departments and their sections and subsections (3 levels). I would like to create some web-based listing of this, but similar to a TreeList.
I was thinking to set up nested Ajax Accordions, but it was taking me way too long to put together. I would even settle for a GridView with non-repeating column values.
Is there a way I can implement my idea without it taking me more than an hour or so for a newbie to complete? Any controls in ASP.NET or Ajax I can bind to would be great.
Thanks to Ozzy, I was able to solve this simple issue using a TreeList. Since my issue is simlper than the one in the tutorial he supplied, all I did was create DataTable for each level, and for each row I added the TreeNode (which was simply the string value of that entry). Thanks!!

Have a Crystal Report but not the XSD - how to extract it?

I have a Crystal Report used in an ASP.NET web application that I've just come into a project I'm assessing/turning around.
The reports are called from a web page or web service and are sent an ADO.NET dataset - using ReportDocument.SetDataSource for some tables with a relation etc - all defined largely in code - initially loaded from the database, but it looks like some data is even altered after load in the datasets. (don't ask)
I have several XSDs (and a whole bunch of source repository history) but none seem to match the report, and trial and error to find the right one is taking way too long.
I have added some data in the code, but I cannot get the report to allow me to add fields until I update the report data source, but I don't have the original XSD to point it to. I have to get the report updated to solve immediate needs and then I can address the strategic direction of refactoring this design/architecture.
Is there a way to extract the XSD from the Crystal Report?
In the end I used ds.WriteXmlSchema() to write the schema to a file and then pointed the report at the file to fix it up.

Resources