Refresh RDLC DataSet in Visual Studio - c#

I'm modifying an SSRS report inside a Visual Studio project. The report is based on a view in SQL Server that I've modified. The DataSet properties refuses to pick up the new columns in the view without manually editing the XML .rsd file. Searching through these posts and on other sites going back as much as 10 years, there seems to be a "Refresh Fields" solution on the DataSet properties but my DataSet Properties dialog has no such button. I don't want to delete the data set and lose all the report formatting that is already done. There has to be a way to update the data set with new fields.

Related

Visual Studio 2013 - Creating Dataset for RDLC Report

I am trying to make a report. The class that I am working with has several ICollection properties, and passing those values to the report for display is difficult.
I have created a class called FlatClass that has all of the string values that I need to display. In the Controller, I plan to populate an array of type FlatClass and pass it to my Report. From what I have read, I need to create a custom dataset/data source. In Visual Studio 2013, when I click Add DataSet in the Report Data tab, it wants me to choose a table from my database. But ClassFlat does not have a table in the database.
I have added a .xsd file, but I cannot find any instruction on how to tell it the names and types of the Fields I want it to have.
Any help would be greatly appreciated!!!!
I tried to create rdlc report in my web application but I could not add my class as dataset. There was no option for that.
Workaround:
Create a Library project in the same solution.
Add the main project as reference to this new Library project.
Create a rdlc file.
Add dataset; for datasource select New->Object->Choose the class from you project namespace
Do your report and when it is complete, move the file to the main project
Not sure if your problem is similar but hope the information is useful.
I ended up creating an .xsd file and just editing the raw XML to add all the properties of the class I wanted to use as a dataset. This worked when I added it to the report.

How to create a report using c# with Active Reports?

I have never created any report in VS, now i am facing problem in adding reference to my project.
Can any one tell me the basics of Report Generation and How to add reference to our project?
The purpose of report generation is to take data from a source such as a database, XML stream or a spreadsheet, and use it to produce a document in a format which satisfies a particular human readership.
Please refer ComponentOne HelpCentral for Active Reports for topics to get started with ActiveReports.
Features of Report Generation with c# .NET:
Multiple Report Types to Fit Your Reporting Needs: Fixed Page Layout provides developers with a new way of creating reports where layout is the primary focus. Great for creating invoices, prospectus reports, forms, or other highly structured reports.
Continuous Page Layout makes it easy to create reports using tables, crosstabs, charts, and other data regions with flexible layouts.
Data Visualization: This include simple listing or groups with keep-together control, master-detail reports, sub-reports, horizontal and vertical multi-column reports, address labels and badges, or richly formatted letters with mail merge support. Simple and lightweight report controls allow you to easily create dazzling reports.
Data Binding .NET data sources allow you to connect to any of the standard databases, plus .NET in-memory objects and collections. In addition, the unbound data mode opens up the report to data from anywhere, in any form. If your application can access it, so can the report engine.
Visual Studio Integrated Design Time Support
Support for Migration from Other Reporting Tools
Global Options and Localization Support
Basic Steps in Report Generation with Active Reports:
This walkthrough is split into the following activities:
To add an ActiveReport to the Visual Studio project
Create a new Visual Studio project.
From the Project menu, select Add New Item.
In the Add New Item dialog that appears, select ActiveReports 8 Page Report and in the Name field, rename the file as rptMasterDetail.
Click the Add button to open a new fixed page report in the designer.
To connect the report to a data source
In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the Add button.
In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a name like ReportData.
On this page, create a connection to the Reels database. See Connect to a Data Source for information on connecting to a data source.
To add a dataset
In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data Set from the Add button.
In the DataSet Dialog that appears, select the General page and enter the name of the dataset as CustomerOrders. This name appears as a child node to the data source icon in the Report Explorer.
On the Query page of this dialog, in the Query field enter the following SQL query.
SELECT CustomerID, Title, LastName, Quantity, Price, [Quantity]*[Price] AS
Total FROM CustomerOrders WHERE CustomerID < 1010
Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
4.Create a layout for the report
5.To view the report
Click the preview tab to view the report at design time.
or
Open the report in the Viewer. See Using the Viewer for further information.
To add a reference in Visual C#
In Solution Explorer, right-click the project node and click Add Reference.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, and then click OK.

Adding a dataset to rdlc file

Scenario:
I have an RDLC file - TestReport.rdlc
I have a form - Form1.cs
I have a ReportViewer - rptViewer
My datasource for the report will be an XML file or a datatable defined at run time (in button click event). Now when I am in design mode for the report how do I add the DataSource or DataSet to the report so I can "add" the columns/fields into the report?
Right now in the report when I click New -> DataSet I am asked to pick from Database, Service, Object or SharePoint but I want to use an object which exists in memory.
I am using VS2012.
Thanks,
Andrew
In case of XML, you have to create the schema for it and then add it to the report in the design view.
A little example is exaplained in this blog (it's old but still good to understand what you have to do).
If also the XML's schema is dynamic, the only solution I came out is about to create one paramater for each node/attribute of your XML and build one or more .rdlc files for every type of XML

Update DataSet in Crystal Reports

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

Need to add additional DataTables to RDLC

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

Categories

Resources