crystal report only show one row of datatable - c#

I create a report with crystal report in my c# project. that have 5 pages. i add this pages in detail section. I want to show a table that bound from data table at the end of the last page(page 5).
but my datatable in report show only first row of my datatable

I add first pages in report header section. and important things was that I didn 't use group name field. when i use group name. my table show every rows of data table

does the report work in design mode?
if so
and if you use more than one table in report you may have linked the tables in the report. unlink them when reporting in ADO.net

Related

How to load two RDLC reports in same report viewer?

I have two reports the first one to show general information and the second one to show details and I need to show each one in a different page in report viewer
can you help me to do that
thanks
like the image
Hopefully, the following can help guide you into what you are looking for. First, you will need THREE reports and TWO datatables (or other lists as you have to build your report).
First, On the 3 reports I describe, I would not worry about any of the report final formatting to be perfectly aligned, bold, spacing... get it to work, then you can make it pretty after all is functional.
Next, create a bogus datatable "MyTable" for the sole purpose of creating two records. Even if a single column of "MyGroup" and having it as an int (just for sample purposes).
Now, create two records and set the values in each row to 1 and 2 respectively so your table has
MyGroup
1
2
Now, for the other two reports. It is my understanding that you want the first report to show a summary of each department's totals with a grand-total. The second report is showing the details of all the activity per department. So this is basically using the same dataset returned from whatever query. For this example, I will refer to the datatable as "SalesData".
CREATING THE REPORTS
Create your first report, put a table control on the report, full width you will have for your current reports as landscape or portrait as long as both the same size, you want this report to be the same. Ex: ALL will be portrait. Add your Report Data source to show the "MyTable" and assign that to the table control. Also add the "SalesData" table to the report as well so it is available to the future sub-reports.
On the table control, below where it shows the "Row Groups", add a "Group By" for the "MyGroup" column. This is so we can force a page-break between each group. Once added, right-click on the parent group "MyGroup" and select "Group Properties". This will show an option on the left side to allow you to set page breaks, click the checkbox for "Between each instance of a group". For now, just have the one column in the table control as the "MyGroup" column. Save the report ex: "MySalesRpt.rdlc". Then compile and run the report. You should get this simple report with 2 pages, each showing just the number 1 and 2 respectively. NOTE: You will also want to add the datatable reference for your secondary reports to this main report as well so they are available as sub-reports of the first.
Create a new report ex: "MySalesDetail.rdlc", add the "SalesData" to it. Add a table control to the report and set its source to the "SalesData" table. Include whatever for your detail columns you want to show of the sales activity. Add a data group based on the department, get your sum( salesDollarColumn ). Add a new row outside/below the group footer so you can have the report grand totals as a sum of all ex: SalesDollarColumn. You can test and run this report on its own until it looks correct.
Now, your third report. Copy/paste the MySalesDetail.rdlc report and change it to MySalesSummary.rdlc. So you don't this summary report showing every row that builds the grand total sum() per each department, right-click on the row that represents the details of the group and delete. It will ask if you want to delete rows and associated groups? Reply yes as it will just remove the details row, but keep the group footer that will retain your sum() total per department. Save, test / run this report.
Once all 3 reports work individually, now we can go back to the "MySalesRpt". Add an additional DETAIL row in this otherwise simple 1-detail report. Right-click on the existing detail row and then pick "Insert Row" -> "Inside Group - Below". This will now show as two rows.
Now, in the first row of the report where it did have just a simple textbox, go to your report Toolbox and pick Subreport and put one instance into each row.
On the first row, subreport, right-click and set properties. Set both the Name and "Use this report as a subreport" to the summary report "MySalesSummary". On the second row subreport, do the same but with "MySalesDetail".
Final step. Click on the Subreport representing the "MySalesSummary". Go to the properties of that and scroll down to the "Hidden" property. You want to have this value set to the expression: ex: "=Fields!MyGroup.Value = 2". This way the report will ONLY be generate when it is on the first record where MyGroup = 1.
Similarly, on the second subreport representing the detail, set the hidden equal to the opposite.. "=Fields!MyGroup.Value = 1". Hide when the MyGroup = 1. This way you can have each report on their own page, but only one will show up per group.
I know is sounds deep, but do it slowly and it should work for you. I already did and confirmed this process works. Sorry so many steps, but it has to be broken into multiple parts to tie them all together as you are requesting.
One rdlc in main local report and the other in subreport. Then set InteractiveSize in the main local report to break it to show each one in a different page in report viewer.

Split rows by name

My stored procedure gets info from SQL DB. Now I want to add the info to a crystal report and display the PDF with all the details.
I use Visual Studio with Crystal reports installed, coding in C# using Dataset to get my info from SQL. The info is a list of names with 3 other details that goes with those names (columns). At times it can be one name as a result, or it can be 3 names as a result.
My aim is to have a table on the report, and each table row lists a name in the first column, then in the 3 consecutive columns its corresponding details. Same look to the SQL table you get when pulling the info.
To setup the individual columns is easy, drag each field onto the report. But how can I split the names so that I have one name listed per table row? This is the result from query:
I want to populate it into my Crystal form which looks like this:
The solution that I have ended up with was to create a sub report, place it on top of the table I have created in my second picture. Then added the columns to the sub-report, took away any borders. And then between the container size on the report and with the paragraph options of the container I adjusted the line spaces. Now if I have more than one row in the list, it appears on each line as needed.

Dynamic Columns in the form of a table crystal report visual studio

I have a crystal report in which i want to show some columns in the form of table rows.
no. of rows in display table that is actually the columns in database table depends on registration date. anyone here to help me out how to do that.. so far have done this.. Sample Report is attached ..
i just want to that all the empty rows should not be displayed on the report

How to create multiple pages report with report viewer (c#)

i have one report that i created with report viewer. in my report i want to create letter with different data . now in my report only can show 1 rows data of query. if the rows that returned by query more than 1 my report still show just one rows of data. how to show more than 1 rows of queries in report viewer ?
You can use table, in the table have three kinds of row, the header, details and footer. Put your field in details row. It's should show all your data, each in one row.

rdlc report in vs2010, how do i repeat tables header on every page?

Hi all I am making rdlc report.
In report I am using more than one dataset.
Also, I am using more than one tables.
Different tables having diff dataset.
I need to repeat all those tables in second page for second record.
How can I achieve this thing?
Select the tablix you have created -> Properties -> in the section Column Header check the option Repeat header columns on each page
You can do the same for the row header if you have one

Categories