Select or Deselect Report Columns in Runtime - c#

i want to build a payroll report that user can select or deselect columns as user wanted. for example for each employee user can select check boxes that represent each column in a list like - Nic, Net salary , Nopay day , etc in any combination.i think all columns are returned in the SP and only shows selected columns.Can you please give me some idea how to do it..

Tilan. I'm not aware of a crystal reports presentation app that you can get that will make your job any easier, but I'd not be surprised if you are spoilt for choice. SAP offer report serving software and their material on Dashboard Design and Crystal Server may be worth looking at (SAP Crystal Reports). However, this may be overkill for your purposes.
An alternative approach is to try to define "loose" columns (I don't know the professional term!). I distinctly recall pulling this off some years ago, but don't recall the specifics and no longer have access to the report (previous employer). This article covers the steps. It's ugly and has a range of disadvantages (huge gaps where columns have been suppressed being a big one), but it might solve your problem.
This guy creates generic columns in his report then builds his query on the fly. His form only caters for the one report, but I think you could adapt his solution to suit your needs.
Cross-tabs may be exploited to suit your purposes (I think). I have little experience with these, but it seems a little tweaking might allow dynamic columns.
The better alternative (by far) is to handle this in your presentation. You've tagged WinForms and C#, so I can assume you've created a win app with a report viewer on it. Assuming you define your dataset in the report, your code should be able to handle the creation of columns at runtime (or suppress/enable and reposition) by looking at the report's DataDefinition. I've read that creating columns at runtime is somewhat dependent on your CR/VS version which I can only guess at.
Hope this helps.

If you can narrow the combination of selected columns to a manageable minimum you can create a subreport for each combination and suppress all subreports except the right one.

Related

Best method for generating documents/reports in visual studio

I’m looking at options to send user input data from my application (mainly strings and doubles) into a stylised document (such as a quotation or invoice)
I have done quite a bit of research however am even more confused in which method would suit me best, so am looking for some input, as which direction to go, I have found some of the following options:
Crystal Reports - although I think this is more for reporting data from SQL databases, not to mention it looks as though people struggle with running there applications in different environments on different machines.
MajorSilence Reporting (formerly FyiReporting) - a Crystal Report alternative that’s open source so would alleviate a lot of problems again though I think it’s for databases and hasn’t been worked on since2015
Word Or Excel Document - Seems I would have to have a template file of some sort and I did want to control as much as I could in program not to mention it just seems kind of unprofessional in a way when used by other users at my work.
PrintForm - where I print direct from a form in the application while hiding the buttons but this may be hard to do over two pages.
If anyone has any input on the above or new ideas or even if I’m on the correct track to how this is usually done, I would be very appreciative.

C# ReportViewer Control Alternative

Good day,
I would like to know if anyone can suggest an alternative to Visual Studio's built in report Viewer control.
The simple reason being that we work with large amounts of data and the built in report Viewer can't hanndle the load (to be more specific we use reports which relies on close to 30 000 records). SQL Server Reporting Services (SSRS) is not an option since we use both Oracle and SQL Server Databases depending on the environment. We did implement a "batch run" solution to our current system where we only handle an x amount of records at a time but this solution doesn't work with the large amount of records we now use.
For more info we currently rely on rdlc files for your individual reports and based on which report needs to be generated the Database query is constructed and executed and the report viewer is then used to show the results. (The real problem is the ReportViewer Control it simply can't handle the sheer amount of data).
The alternative can be a free or pay to use solution.
Any help would be appreciated.
I can recommend Fast Report. I've worked with the VCL solution for years and if the .NET version is anything close, it's worth a try. You can download a trial version from their website afaik.

Create a report with its respective chart from a chosen LINQ query in C#

I'm quite busy reading different posts over how to create reports from dynamic queries. I have the next problem and maybe someone here can help me with this:
I have a class where I can create a dataGridView from a dynamic dataTable in a project made with C# from VS 2010. I populate my DataTable with one of 9 different linq queries that I have according to the user requirements, which also are saved in a register in my database. Starting from this point, I need to make a report where I can show of the same way the data selected.
I have found the code from the website got ReportViewer and it works quite good. Only I have a last problem. I need my report to show a chart according to the parameters passed via the DataTable. I saw the examples that they have there for the charts but they work quite restrict with what I need, and the code for the chart generator that is incluided in the Dynamic Table project is quite extense and a bit complex for a beginner like me.
Do you know any other examples that maybe I can find to use to make the code in my project? Many thanks in advance :).
I found another way to do it:
Now I'm using classes as datasources and filling arrays of these classes with the contect of the datatable.
I pass these arrays as my datasources for the project.
I group my data by the number of fields I want to display and then I choose between pre made .rdlc files where I show my data to the user.

Crystal Reports in ASP.NET/Visual Studio 2010

Is it possible to generate a CrystalReport without using the wizards of the DataSets and CrystalReports?
If so, which is the best way to tackle it?
So far, I've created an empty DataSet and an empty CrystalReport, and linked the CrystalReport to the latter DataSet using the wizard. Afterwords, I am creating a DataTable, putting this table into the DataSet and displaying it into a report. But an exception always generates telling me that no table was found. This is definetly not the case, since the same table is being viewed as a GridView at a previous stage.
Any help is highly appreciated,
Thanks
I think the CrystalReport will generate some kind of schema - so when you first show it a empty set it won't find the table afterwards. There should be some kind of "refresh database" inside the wizard.
Normaly you wan't to create a typed-dataset (with the VS-Designer) and show this to the wizard. Then everything works rather fine.
OT:
But as a long time user of CR let me tell you: this tool is a pain in the A. - if there are more than one version of it on a system (and chances are pretty high for this) you will witness all kind of really bad behaviour.

c# Crystal Report

AoA, Hello
i am writing an application for financial solution. in short i ve to get out print of report that is generated. Crystal report is what i want to use....
my problem is that i just want to preview report and allow to insert any change that user want to make. Or easily we can say want to allow edit entries.
is there any method to preview?.... Note that i am newbie ..... so apology if i am unable to deliver correct question. Hope you understand and will help me.
take care.
You don't say what type of project you are working on (ASP? Winforms?)... but I suspect the answer may be similar in all cases.
While a preview control is available in Crystal Reports (at least version XI, for WinForms based solutions), I am 95% certain that the preview is non-editable. I believe that if you wanted to change fields within the report you would need to "re-run" the report processing before you could get an updated preview.

Categories