I need to create a RDLC report from a MySQL db that needs to show timecard info per user, per day between 2 dates (user choice) Like this eg:
UserFirstName UserLastName
2019-01-11 InTimeStamp OutTimeStamp TimeSpan
2019-01-12 InTimeStamp OutTimeStamp TimeSpan
2019-01-13 InTimeStamp OutTimeStamp TimeSpan
2019-01-14 InTimeStamp OutTimeStamp TimeSpan
Total: totalTimeForThePeriod
I need this for every user within the dates provided by the user.
I have already setup the HR report page and the date choice (works perfectly) but I can`t seem to be able to format my RDLC report to show the info as requested. How can I seperate the data to acheive this? My dataset gets all the data from the db (query works great). All I need to do now is to show it properly in the report. Any ideas on how I can acheive this?
I've tried using a simple table but that does'nt work.
I also tried a matrix, but I can't seem to show the data as requested.
You'll want to go one by one creating your rows. Also have your Grouping window open, so you can see your grouping. First right click where you want your first row and click Add Group -> Parent Group. In the Group by: drop down select a UserFirstName. Then it should add UserFirstName to your grid. To the right of it add UserLastName. Next in your grouping window under Row Groups click the drop down arrow on (UserFirstName) and click Add Group->Child Group. This time group by [TimeStampDate]. This will create a new row under your original row that is a sub group of UserFirstName. Add in the addition data in this new row. Lastly in the grouping window under Row Groups click the drop down on TimeStampDate then click Add Total->After. This should add a total row under the TimeStampDate row. You can change the [Sum(TimeStampDate )] to [totalTimeForThePeriod]. This should get you what you need.
[UserFirstName] [UserLastName]
[TimeStampDate] [InTimeStamp] [OutTimeStamp] [TimeSpan]
Total: [totalTimeForThePeriod]
I struggled with the same issue for hours, so I hope this helps!
Related
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.
I want to display data-set record in different pages . i am using rdlc reporting in c# win form.
in rdlc design i am using text-box which show only single data.
i want to display all data but in separate separate pages.
actually i am printing multiple cards in bulk , it should be in different pages so i am unable to do.
kindly help me.
I already try page-break in rdlc report but its not working
this.sp_bulkprintTableAdapter.Fill(this.db_ShopDataSet10.sp_bulkprint, date1, date2, Convert.ToInt32(catname));
See the image here to understand what i want. i want to print this type of cards in bulk from database using simple select query. what i am facing problem is textbox is not showing multiple records and each record on different page.
i have done with it by performing following steps
1) add table in rdlc report
2) remove header row and two default columns remaining single row and single column.
3)enlarge the table
4)remove the default textbox in table
5)add rectangle --- add page break here
6) add textboxes. (multiple).
Now each row of my data is printing on different page.
Make sure that your page size is correct.
I found that I could just drop a List (Toolbox: Report Items -> List) component on the page. Stretch it to fill the area you desire and drag fields into appropriate locations. Works great for making individual labels for each data row.
Net 6 mvc web project using Microsoft.Reporting.NETCore.
I've created 4 Data GridView Dynamically. The Data Source of each of the gridviews is a DataTable. It has 3 columns, first column type being string, second and third column being DateTime. The First Column has static data. On clicking the second and third column cells, I want a DateTimePicker to come allowing user to select DateTime Value.
You may need a template Row, see details here:
http://social.msdn.microsoft.com/Forums/br/netfxbcl/thread/2677158c-76a3-4e65-8ae4-18373a80516e
Try something like this - Make a new DataTable (that has the schema you need). Then add 2 or 3 controls (one for string input, and either CheckBox or 2 radioButtons that will determine which DateTime column will be filled). When user clicks on DateTimePicker, it will fill one column, then he can selects/deselects the CheckBox, and select the second date. When all values are properly set, user can click the Submit button that:
- Fills the DataTable with proper data.
- Changes the DataGridView's DataSource
This is just my idea on how you can solve this, there may be another way.
I think it might be possible to do changes doing DataBindings, but I choose not to look into it.
Instead of attaching DataTable as DataSource, I took e.g mentioned here MSDN customised it as per my needs and then created DataGridViewColumns and iterated over Rows of DataTable to fill up content. I did write any template code.
I have a crystal report within a crystal report viewer that the datasource is set to a List<objects>. The crystal report is showing all of the records, my question is how do I set the report to only show the first record and then I can allow the user to iterate through each of the List<objects> on at a time.
Right-click the Detail section (assumedly where you have the fields placed) and select 'Section Expert...'. Choose 'New Page After'. Each row in the Detail section will on a separate page. The user can use the cursor buttons (First, Previous, Next, Last) to move between each page--the buttons resemble those on a DVD player.
Fixed it myself. I had to use custom buttons to manually load in each data record and refresh the report.
I have a scenario which is as follows:-
A form containing 2 grids. The grid on the left contains a list of groups. When a group is selected the grid on the right populates with another list with check boxes.
I would like to be able to select group A and select some random check boxes and then switch to group B and select some other check boxes. However when I select group A again I would like to be able to restore the previously selected check boxes.
This would allow me to preload the settings from the database and also update the changes in one go rather than expecting the user to select apply after the changes for each group.
I'm unsure of the best way to approach this problem. Any feedback is appreciated.
Thanks
Sean.
I've done something like this using DataTables and DataViews to implement client-side filtering.
You have a dataTable with the tickboxes that contains all groups of data.
Then when you click grid 1, you update the DataSOurce of the grid to a new DataView(DataTable,"GroupID=1")
,"",CurrentRows) (i.e. Sets the filter proprety of the DataView to filter on the selected group
THen when you're done, the DataTable has all the tick boxes you just saev the DataTable to the database.
Hope that makes sense.
I'd start with coming up with a database table to store your data - let's say MyTable(UserId, GroupId, ItemId, Selected). When the app starts I'd read the data from the table based on the UserId. I'd process this data into a couple of collections that I could associated with the grids - one having unique groups, the other items associated with a group and the selection status. Set up some event handlers to keep the collections in sync with the user input. Implement some save routine upon hitting a button or form closing and you should be good !