Crystal Reporting in VS2010 for Desktop Application - c#

Dear fellows I am 6 to 8 months old programmer and I do some plain programming like I've created point of sale/purchase inventory etc.
But in my whole programming career, I've never done crystal reporting, I need to know how can I do Crystal Reporting in C# in VS2010 for Desktop Application (like inventory software).
Please guide me in this regards or suggest me any link from where I can learn Crystal Reporting from very basic.
Thanks.

Make sure that you have installed Crystal Reports for Visual Studio which can be found here. http://scn.sap.com/docs/DOC-7824
I usually create views to fetch the data that I want to be displayed. You can add the views to your dataset.
You can make a new Crystal Reports by going to Add New Item -> Reports -> Crystal Reports.
In Visual Studio, while your new report is still in view, you should see the the Crystal Reports Menu, click on it and then click on Field Explorer.
You can then right click on Database Field to setup and set the datasource location of your report. The fields will then be in view to drag and drop.
You will need to create a report viewer to see the report and code appropriately for it.
There are many articles on how to create CR reports in Visual Studio like these two. http://www.codemag.com/Article/0207021
This one may be based on a ASP.NET project but the procedure for creating one is basically the same. http://www.codeproject.com/Articles/166291/Generate-a-report-using-Crystal-Reports-in-Visual
This is a good one to follow step by step.

Related

(Change Datasource) Prompt for Server and SQL Server database within Crystal Reports Viewer, Visual Studio (C#)

I'm using SAP Crystal Reports 2016 with the Visual Studio plugin, along with Visual Studio 2015.
What I've done is created a simple MDI application using C# which contains multiple Crystal Reports Viewer forms which open an embedded report in a child window when the menu item is clicked. This application will sit on our development server and be used to run reports against client databases that get sent to us with problems.
Here's the issue. We've got multiple instances (and versions) of SQL Server running and we are getting multiple test databases daily which of course will be named differently. The reports are looking for a specific database only.
What I would like to do, is either on form load or via a button click, be able to have a box prompt the user for server and database name. For example:
SQLServer\SuperCoolInstance
My_Cool_Database
The report would then connect to that database and display relevant information.
Any idea on how I could accomplish this? Second best scenario would be to have something like an XML file that contains the server and database and the program looks at that when launching. Even though we'd have to edit the XML whenever we wanted to change datasources it would be something! I wouldn't know how to pursue that avenue either though.
I would think that this must be possible because at a previous company that I worked for, they actually sent compiled Crystal Reports (in exe format) to clients to run on THEIR systems and it looked to an already existing XML file.
Thanks very much in advance for any ideas or guidance.
Cheers.
EDIT - I thought I should point out that all the SQL Server databases that this would run on would have identical schema but different data obviously. Not that this probably matters for this particular question, but just in case. :)

DataSet related issues when using ReportVIewer

I'm new to reporting in VS 2010 and I'm trying to use integrated report viewer. My current understanding is that If my system has 10 reports I should create 10 DataSets so one DataSet per report. The problem is I want to organize these DataSets in the IDE. I have folders for each type of reports in the solution explorer and I want to move respective DataSets to such forlders.
But when it is moved to a folder list of errors are shown in the code and after realizing that the namespace names of the moved DataSets have been changed, I manually changed them to original namespaces but still I have problems like System.DataSet1DataAdapter not found, No fill method have been defined etc etc.
How to solve this problem? Otherwise is it better to keep DataSets in the root folder?
Could we create DataSets for reports in code? What is the practice in professional level?
Is integrated reporting considered a consistent way to do reporting?
NOT: I'm developing a Win forms application

Is it possible to modify a Crystal Report chart using ASP.NET?

I have a Crystal Report which contains a subreport. Inside that subreport are several charts. I would like to be able to programmatically modify some of the charts' properties (title, legend font size, etc.) in my C# code. Is this possible?
I am using Visual Studio 2010 with Crstal Reports for Visual Studio 2010.
I found what I thought was the solution for me
here.
Unfortunately, however, the ReportClientDocument object used to access the chart cannot come from a subreport, so I think I am out of luck.
In any event I am providing the link above as it may help others whose charts are not in subreports...

How do i make use of .rdlc reports created using the VS 2008 Report Wizard?

I have a c# project where i created a dataset, then when through the steps of creating 3 reports via the Report Wizard. The rdlc files are now in my project and i have a reportviewer control in my Winforms project. The question is, after going through the process of setting up the dataset and reports, how do i get any of them to display in the reportviewer? When i try to set the ReportEmbeddedResource to be one of the rdlc files, i get a message in the viewer saying the source of the data has not been set. I did that when i created the data set and the report.
Any ideas?
Here is a detailed tutorial on how to use Local Reports : http://msdn.microsoft.com/en-us/library/ms252075%28v=vs.90%29
I had to do this last year, Local Reports are kind of a headache. The problem is .rdlc files do not fill their data sets (they ignore all the <Query tags. So, what I had to do is write a custom .ascx that would parse the <Query> tags in the .rdlc, fill the DataSets, and pass the new file to the ReportViewer control.
Basic steps:
1. Build a set of input fields based on the QueryParameters inside any <Query> tags. This usually involved cascading comboboxes since parameters can be dependent.
2. When the user submits the form, fill the DataSet associated with each <Query>.
If you look at the way you input parameters in VS 2008 when you test an RDL, the control you will make does exactly that.
All of this had to be done because of a client request to not have to authenticate when running the report...ugh. The fun thing is, I never found a complete schema for RLD/RDLC XML so I had to look at a lot of report files to figure out all the variations.
EDIT: I missed the part where you said WINFORMS. My scenario was for Webforms, though it might still apply I've never used the ReportViewer control in Winforms.

Reporting tool which print the control which we pass on that

What is the best reporting tool other than crystal report using with c# and mysql because crystal report has to be downloaded in user machine ? So what is the other alternative of the crystal report for using c# with mysql and should be less in size and user will not have to need to download more.And it should be with good features. (All open source and with paying charge.)
EDIT: I have need of printing only control on the form dynamically, like if user want to print third party control then also it should be printed, but it should not be printed like image of the treeview like if user wants to print the treeview on the window form but treeview is collapsed by user so here if user prints this treeview then it should not be printed collapsed treeview and but it should be printed whole the treeview(expanded).
Not a reporting tool at all, but if you're most interested with simply having a PDF output I recommend iTextSharp. You can then fill the report with place holders to be replaced with variables as you would any software - prior to the user downloading it.
Not the best method I agree, but it all depends on what you're looking for.
Two options for you to use
SQL Reporting Services - this has a requirement that you install a Microsoft SQL server with SRS but your reports themselves can connect to other databases, including MySQL (via ODBC) and you can then use the ReportViewer component in your C# applications to render it. There is no additional downloads for the user as the processing happens server side, plus it is easy to embed into web apps, SharePoint etc...
Visual Studio 2010 does ship with fantastic reporting controls which can use any data source. If you on 2008 you can use the out of band release of these same controls. In all cases these are just code so it's a few extra assemblies to deploy. You can see samples of these in: http://code.msdn.microsoft.com/mschart

Categories