I would like to use the Microsoft Report Viewer component to view a report created from a programatically filled datatable.
I have been looking for a while but the only information I can find is for reporting on information from a database.
You can definitely do that - if you programmatically control the Report viewer control (in Winforms or ASP.NET).
See these resources for some help and guidance:
MSDN: Creating Data Sources for a Report
ReportViewer Set DataTable as DataSource (VB.NET)
you can use visual studio to create and then deploy your report. After having created a project for Microsoft Reporting Server, you should add a datasource to it (this is to say where u want to connect to), then open report data view where you can create a query. This allow u to drag & drop fields on your report.
Hope this was what u intended to
Related
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.
I'd like to know of any tools to generate a report in wpf.
What I want to do is to generate the report and export it immediately to a pdf, csv or just print it. I don't want the client to be able to "adjust" the report from within my application. Also the report tool should give me lots of freedom, since I'm geerating reports from a datagrid that is constantly changing, according to the user's commands (in other words .. it's dynamic)
Does anyone know of any tools that allow me to do that (preferably an open source tool, but I'm not tied to it being open source)?
Reporting isn't specific to WPF. You can look at Crystal Reports, SSRS Reports (both server *.rdl and client embedded *.rdlc), or tools from companies like DevExpress' XtraReports.
The +1 for using SSRS Reports is that there appears to be a Mono project that will allow you to render them, so you're not tied 100% to the Microsoft server stack, if you have that requirement. Look at FYI Reporting from the provided link.
If you are familiar with crystal reports, this may be useful to you. Otherwise you could always use xslt and xml
This answer makes a a compelling arguement for micrsoft or third party reporting compared to xslt "hand made" reports.
Edit: As a first go, it may be adviseable to use the crystal report creation wizard
You can use Crystal Reports, just like we use it in WinForms.
You have several options here.
You can print a visual to pdf using a virtual printer: http://www.pdfforge.org/products/pdfcreator.
There are also XPS to PDF converters.
And, of course, there are numerous WPF based report generators.
You're question is quite clear, so I wasn't sure what exactly you were after.
You may consider using ActiveReports to fulfill your reporting needs as ActiveReports has a viewer and end user report designer control which can work quite well in WPF environment.The End user designer control will also allow your end users modify reports at their will.
Regarding the exporting capabilities , ActiveReports will let you export to PDF,Excel,Word,Tiff,Jpeg,Text etc.And lastly activereport will give you the flexibility you are looking for as it can be bound to datasets,XML,OLedbm,sql,Excel sheets, text,array, objects etc ..
You can visit these links to know more how ActiveReports works on WPF:
http://blogs.gcpowertools.co.in/2011/11/how-to-view-report-created-using-active.html
http://blogs.gcpowertools.co.in/2011/08/how-to-host-active-reports-end-user.html
I've inherited a project that uses Active Reports. I'm required to basically create a simple pdf that holds data that's in a DataGrid on one of my ASP.NET pages.
I've only found a single walkthrough on the DataDynamics website and it only applies to users of VS2003 and VS2005.
The report I need doesn't need to be interactive. I don't need to use Document and Page events. I just need to take what I have in a DataTable (which is bound to my grid) and create a pdf file, which will be available for download.
Is there a straightforward way to create this simple, static report with ActiveReports? Thanks.
kmarks,
You can indeed do this very easily, you can use the same DataTable as a datasource for report by setting the datasource property of the report to the DataTable.Then you just need to add an ActiveReports TextBox control to the Details section of the report and then set its DataField property to a column name in the datatable to bind a field from the datatable to the TextBox control.You can do this either at design time or in the code behind
After you have done this,just create an instance of the report,call the Run the method on this instance and then export the report document to PDF.
I would also suggest you to go through the following link which can help you achieve the same.
http://www.datadynamics.com/Help/ActiveReports6/arWLKCustomWebExporting.html
You can also download a sample application which converts a DataGrid to PDF report using Active Reports form here
ftp://ftp.fpoint.com/ActiveReports/Samples/GridToPdf.zip
Regards,
Abhishek Dutta
Grapecity
I have a connection to SSRS 2010 web service in my application and I can load the whole hierarchy of report folders and report items contained in my server without a problem. I generated the SSRS 2010 service proxy thanks to the WSDL tool, following the guideline on MSDN.
I have looked to the different ways of rendering the report items in WPF and the common way of doing so is to provide a path to a RDLC file as a datasource to the report viewer control. The problem is that when I load this hierarchy in memory, all I have is CatalogItems, and these items does not provide me a path leading to such an object.
I am kind of lost here. How can I proceed to retrieve a usable and displayble object?
I finally figured out how to do do that.
I take the report path from the CatalogItem.Path property and then I added a ReportServerUrl property to my ReportingService2010 instance so I can retrieve it later. This is all on the object side.
For the graphics I integrated the Forms ReportViewer in my WPF application with the WindowsFormsHost. To display the remote report in the control I had to change the ReportViewer.ProcessingMode to ProcessingMode.Remote and finally set the ReportViewer.ServerReport.ReportServerUrl and ReportViewer.ServerReport.ReportPath to my report object properties. Then call the ReportViewer.RefreshReport() method to load the report.
I have a Crystal Report File and I want to know what's the name of the Stored Procedure that is being used on the Report. How can I retrieve it through the code behind. Is this possible?
C# code would be better since I do coding in C#.
Assuming that you're just interested in getting the name of the SP, then there are a couple different ways to tackle this:
If you have Crystal Reports...
Open the Set Datasource Location dialog. On the bottom pane will be a tree-view of the available database objects, including the list of stored procedures. The highlighted SP will be the one it is calling to retrieve data for the report.
If that doesn't help (ie: there's no highlighted Stored Procedure), then ight-click in the report designer area, select Database -> Show SQL Query. This will display the query used to retrieve data from your database. It will possibly have the name of a stored procedure in it.
If you DON'T have Crystal Reports...
Use this code from Code Project to load your report into C# and traverse the report from there. http://www.codeproject.com/KB/cs/loadingcrystalreport.aspx
If that doesn't help (ie: you're not ready to tackle the C# aspect of Crystal Reports), then you can use your database's profiling tool to spy on the calls from your report to see which SP(s) it is calling to get the data it needs to run the report. SQL Server's SQL Profiler is a good tool for just that purpose. Here are some tutorials to help get you going:
Microsoft MSDN: ARTICLE http://msdn.microsoft.com/en-us/library/ms187929.aspx
Tech Republic: ARTICLE http://www.techrepublic.com/article/step-by-step-an-introduction-to-sql-server-profiler/5054787
SQLServerPedia: VIDEO http://sqlserverpedia.com/wiki/Using_SQL_Server_Profiler
Unfortunately there is not a way to do this programmatically. You can see the datasource, set the datasource, but you cannot retrieve the actual SQL being used to generate the report other than through the Crystal Reports designer.