I have little to no experience in using Datasets and Crystal Reports so please don't bash me if the answer is really obvious, I didn't manage to find the answer on-line.
I have a C# Winforms application, containing a Crystal Report that takes its data from a DataSet. I populate the DataSet dynamically from inside the application.
In the past, if I added another column to the DataSet, I could right click the DataSet in the Crystal Report and click "Verify Database" to make the new columns available in the Report.
Now, if I do this the following window pops up:
There is no item available in the Class Name combobox, and if I check the checkbox, another combobox appears which is also empty.
Please note that I populate the DataSet from inside the program, so there is no connection.
How can I update the DataSet in the Crystal Reports, so that the new columns become available?
Thank you.
P.S.: I have tried the following solution but it didn't work: Update DataSet Schema On Crystal Reports for VS2008 because I am presented with the same window as above.
Also, this is what I see, might be useful:
Edit1: The fields appear in the Data Sources but do not appear in the Field Explorer.
I already have some Formula Fields that have the same name as the newly added Columns but removing them didn't help either.
I finally managed to solve it by myself. There are three things I did and I'm not quite sure which one did the trick since I can't seem to manage to recreate the problem.
I renamed the Formula Fields that had the same name as the DataTable columns I added.
I clicked the " ... " box and reselected the same file.
I added the Internal Connection ID {294de39c-3e3c-4748-9138-53d4be2a74a6} in the Class Name textbox.
The first two probably didn't help since they didn't work before. It did work when I added the string so that's probably the solution, but this didn't work the first time either.
Hopefully my wasted hours would save someone's time.
This is my solution. Here is the steps:
Create New DataSet and drag the table from SQL Server ObjectExplorer
Right click on Database Fields
Choose Datasource Location
Click on the table on new DataSet created on step 1
Click Update
Hope it can help
Related
This article here describes handling concurrency exceptions. The steps to reproduce the problem are:
Create a new Windows Application project.
Create a new dataset based on the Northwind Customers table.
Create a form with a DataGridView to display the data.
Fill a dataset with data from the Customers table in the Northwind database.
After filling the dataset, use the Visual Database Tools in Visual Studio to directly access the Customers data table and change a record.
Then on the form, change the same record to a different value, update the dataset, and attempt to write the changes to the database, which results in a concurrency error being raised.
Catch the error, then display the different versions of the record, allowing the user to determine whether to continue and update the database, or to cancel the update.
My question is, why does this even happen? Why can't I just save and edit the record from the DataGridView without causing any errors? I'm creating an app with a DataGridView and I'm facing this problem. I need some way to avoid or resolve this error without notifying the user, so whatever they see in the DataGridView gets saved exactly the way thy see it. What's the cause of that error?
The solution turned out to be pretty simple.
All you need to do is reload the data into the DataGridView again after every save.
So the code for the BindingNavigator save button is now:
this.Validate();
this.maintableBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.yourDataSet);
this.maintableTableAdapter.Fill(this.yourDataSet.yourtable);
I have no idea why this works, so I need an expert to confirm this. Working solution though.
Thanks to E-Bat for planting this idea in my head.
I'm basically banging my head against a wall here.
I've got a sharepoint list that I want as a datasource in a .rdlc file. So I go to "Add Dataset", name it, then select "New" to create a new datasource. VS walks me through creating a new datasource, then when I'm finished it shows up as a Service Reference and I can use it in code.
Now, the annoying part. It still doesn't show up in the drop-down list. It doesn't matter how many times I create the datasource or where I put the report, it refuses to acknowledge the existence of this new datasource and doesn't let me use it.
Any and all help would be appreciated here. If you need more information, let me know.
I have in my project this problem and I want to solve it by my hands, and I don't know how.
I have been made a lot of search on google but there is no a complete answer.
could any one have the unreachable solution for me " :P " .
how to add delete and update rows in DataGridView that mapped to the database by strongly typed dataSet but without auto generated form.
I need to add a second DataTable from our app's main DataSet into a report, but not having much luck.
We have several simple local reports in RDLC files, each with a single DataTable based on a view in our application DB. I need to improve one of the reports to add information from another table. This other table is defined in the same core DataSet which we use for reports in our .NET 2.0 WinForms application. Since the two tables are in the same DataSet, can I just make sure that both tables are loaded into the DataSet and then point the report at the DataSet instead of the DataTable? Something else?
Needless to say, I've been playing around with this for a while and not getting anywhere.
TIA,
Matt
OK, I got this working and, in retrospect, it was pretty easy. I just didn't know which menus to use for getting VS to hook everything up, and which order to do them in.
Looking at the Designer.cs for my form was actually the most helpful thing I did. I noticed was that the ReportViewer has a default BindingSource pointed at the first table. Originally, I was hung up on trying to give the BindingSource a DataSet instead of a DataTable, but then I decided to try making a second BindingSource instead.
Maybe there's a better way, but here's basically what I ended up doing:
With the RDLC in the designer, clicked the Report menu then Data Sources.
On the Report Data Sources dialog, chose the additional DataTable from the drop-down and clicked Add to Report. (I also renamed the new data source to just be the name of the additional data table; VS had created some gigantic long name based on the full namesspace.) OK to close the dialog.
On the designer for the form that contains my ReportViewer control, clicked the ReportViewer's smart tag (the little arrow in the top right corner of the control) and then selected Rebind Data Sources. This made a second BindingSource appear at the bottom of the Designer surface.
Clicked the ReportViewer's smart tag again and this time chose "Choose Data Sources" to confirm that the ReportViewer now had two data sources, each bound to one of BindingSource instances now on the form.
Revised the my form's OnLoad code to load rows into the second DataTable.
Went back to the RDLC file, added a new table and set the detail cells to fields in the second DataTable -- and it worked!
Hopefully this will save someone else a couple hours someday.
Figured out a way to use it in Visual Studio 2010.
Click on View > ReportData and when the report data is seen , click on Datasources and then click on add. DO this as many times as the number of datasets needed.
Now in the smart tags of the reportviewer, click on choose datasources, this will show each of the datasets. To associate the datasets with a binding source, you will have to click on Project and then further click till you get the appropriate class, this will cause the binding sources to be created.
This work around is very useful if you have multiple tablixes and you have to associate a binding source to them within the same report when the report is displayed on the report viewer
I'm trying to summarize data in a crystal report. I'd like to create a columnar view of data in crystal but am not sure how to do it. I was wanting to use a crosstab but when I try to insert, the control never appears. I create a crosstab report but when done, it comes to a blank report. I want it to be like this except columns would be vehicleCategory and rows would be individual charges
1 - Any idea what I'm doing wrong and
2 - is there a better way to do this?
Thanks!
Ok, I'm going for the Necromancer badge again. :)
You should be able to open the Cross-Tab expert, and put vehicleCategory as the columns, individual rows would be the individual charges and the summarized fields would be what ever you want to sum for (ie. Count of vehicleCategory). On the custom style tab make sure that you aren't suppressing the grand totals until you make sure that you are showing data. Also make sure that you are suppressing or hiding the section that you are putting the cross tab in.
I'm sure you are well past this issue now, but I figured I'd throw an answer out there for you so that if nothing else I can try for a new badge. :)