Hi good people at StackOverFlow,
This morning I have found myself having a few issues with getting the correct results when attempting to view reports in my C# application using Crystal Reporting.
I'm attempting to build reports based on a user's entry when selecting an 'Employee Number' from a drop-down list within my application, so far Iv'e got the drop-down list populated with the database column records but I just cannot find a way to build a report when users select an option.
Please could someone give me an insight on how this is done or even direct me into the right place to learn how to perform such an action, I'm here to learn and would rather find my way around this issue as a means to gain knowledge rather than just simply asking for a user to fix my problem...
Thanks people!
Create your report in design with your whole table to be displayed. Then you can either create a parameter in crystal reports to filter the value by your selected value from combo box or you can set your query while loading the report with the Filtered query.
eg:
string query = String.Concat("Select * from wharever where something like ",yourcombobox.text);
Then set this query as the query to produce the report.
Related
We use an MS SQL database directly as a data source for List & Label. All tables, columns and data records are then always available at once.
However, a created report should not always display all data, so we have selected the appearance condition within the report in such a way that only certain data of a table is displayed.
But we don't want to create and offer a separate report for each possible condition in a table, where each one has its own appearance condition. Also the user should not be able to change the report itself in the designer. Is there a simple and user-friendly way that the user can decide from "outside" for the report which data should be displayed?
The best way to achieve this is using a report parameter. You can configure them from Project > Report Parameters:
As you can see from the screenshot, the data for the report parameter can come from the database, but you can also offer a choice from a predefined list of entries or even allow the user to freely type a text. There are date pickers for date values etc.
These parameters are shown above the preview in desktop apps. In web apps, you have a separate pane - see the "Chart With Report Parameters" sample here.
Once you have configured the parameter as required, use it in the "Data Filter" property of your report container items. Note that you should look for a filter that translates to your database's syntax. This blog article has more details on the concept.
I am developing an win forms application for now i want to generate a crystal
report that is dynamically. Means if my table contains 30 fields so i will
design my 30 fields on front end just take checkbox or dropdown so, based up
on the user selection i want to generate report i.e,dynamically. So i have
already but i got a bunch of errors just like as asking prompt message for
enter a value.(If i have set list of values option as "Dynamic" too)
Those issues are not solvable me i irritated a lot.
Can you give me any reference or procedure to make report as dynamic in my
win forms using c# and database as SQL.
Thanks help me out.
In case of dynamic Report with dynamic fields, I afraid you have to create the report programmatically. So you can iterate over all existing objects in your report in ReportDocument and either take them out or add them to the report depending on the date you want to visualize.
I have a program which analyses some information in runtime and save the analysis results in certain variables. I have 15 of these variables, of which, 13 are string type, 1 integer and 1 bitmap image. I want to let the user to generate a report based on the analysis data. I have been trying to search the forums for help, but couldn't find a proper solution yet.
First of all, I don't want to save these analysed results in a database (SQL etc). All i want to do is just to display the report to the user based on analysis results and let him save or print it.
This is what I did so far based on numerous hints that I get from forums. I added a report.rdlc file and created a template for the report. I also created a dataset.xsd file and added the analysis parameters to the dataset. All the dataset values are added to the report template.
Now this is where I am stuck. I don't have an idea how to proceed from here and generate a report. Right now what my program does is, upon button click, the analysed parameters will be saved in their respective variables that I specified in the main program. What I want to achieve is to use these results and generate a report as in the template. Sorry that I am not able to post images here due to the user restriction.
Any guidance on how to achieve this is much appreciated.
Thank you!
From what I recall, reports support parameters which can be injected via the presentation control.
With little else to go on, I would look here first.
This is frustrating me to no end. I need to create a report based off a SQL query to be displayed in a report viewer on an asp page. Seems like it would be simple but I can't seem ti find an example of how to accomplish this. I don't need a stored procedure I need something I can add variables to like stringbuilder. The user will give an input and then the report will populate based off the query that the input was passed too. Simple seems like but anything dealing with a report seems to want the wizard. What can I do to get a report that looks good and I can use a sql query to bind data to? Thank you in advance.
You can use Gridview to display table from a database. A good start can be read here and here.
Please give us some additional info on what you need so that we can able to help more. :)
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.