I have two tables in my database namely Employees and TimeLogs. Basically I want to create a Daily time record using rdlc. So, what I wanted is to display each employees' time logs.
Like:
I tried to list within a list but it doesn't work. Tried subreport within a table, but I get errors. Tried list within a subreport that's within a list.
Can some one have a much better way of doing it?
In Tablix you can add Groups to organize your data.
In your case you can group by employee and display times as details.
Related
Since i haven't find a way to merge colunms cells in rdlc, I've tried to concatenate 2 tablixes horizontaly- one is "standard" table, and the other is one field (those were my needs).
Running my sp on my rdlc, it works fine where there is one record to display.
However, when the result is multiple records, and I'm saving results in .pdf file, the 2 tables are not "synchronized" together any more - the gaps between results of each records are different.
I've tried to surrender the tablixes in rectangle and define a page break after rectangle - table still not synchronized...
Please advice..... ☺
Combine your two tablix into one. You can create the appearance of having two by putting an empty column between the two "sides" with no borders on top or bottom of the cells. It will look like two tables side by side, even though it is one table, and the rows will be forced to line up horizontally.
Another possibility for you is to have a sub-report. Create a simple report of just the tablix of the second table in question of the field(s) you want to include.
Then edit your primary report to include the sub-report. I cant direct in detail now how to link-up the sub reports and parameter link them, but suggest some reading up on it. So Each detail row in the parent report would be a group by (its PKID for example), then add the sub-report to it. This way as many rows at the sub-level go if 1 or more...
For one of my projects I need to allow the user to select some products out of a table.
This table will be paged (+2k records in DB).
So the user needs to be able to select items on different pages without losing them.
I was thinking about using 2 tables. One table to select items from and another table(also with paging) where the selected items will be displayed.
But I have no idea how to persist the selected items without using Sessions...
If anybody has a better idea please share it.
Edit:
It is possible(won't happen that much) to select all products (+2k records).
I don't know how mvc will behave if you have 2k hidden fields.
Also lets say i use hidden fields and have the following in my viewmodel
public List<int> SelectedIds {get;set;}
I can then use hidden fields with "SelectedIds[i]" as name(replacing i by an integer).
But the user can also deselect the items again.
And I don't think the binding will work when you skip numbers.
ex: 2 hidden field with these names "SelectedIds[0]" && "SelectedIds[2]"
This is something I'll have to test when i am home...
From time to time, I need to create an input control which allows multiple rows of input, the type of input and number of columns could be different in each case but typically it would be represent a database table being edited, so it should also be possible to store an id value within each row. It should also be possible for the user to add new rows to the input if they have more data to input.
I have tried a couple of approaches to this but they are all very long winded for what seems like such an obvious and common scenario. I'm thinking that there must be a simple way to do this that I have missed.
The way that I usually solve this is by using a list view, enter all of the input controls required within the item template and use a html table for formatting, with each item being a row of the table. If there is existing data to be edited, I would load the data from the database, add a blank object to the results and bind it to the list view. If there is no existing data, I would create a collection with a blank record in it and bind it to the list view. I add a button for adding a new row. When clicked, this button retrieves all of the existing data from the list view by iterating all of the listview items and populating the data into a collection, which I would then add a blank object to and rebind the listview with the results. When saving, I would retrieve the results by iterating the listview items again and using a hidden field within each row to store the record id. This would determine whether a new record was added or an existing record was edited.
This approach works for me but I'm sure there must be simpler ways to achieve this. Looking forward to seeing how other people solve this.
For web forms, use a GridView. You can set its properties to allow editing, deleting, new rows, sorting, and paging.
Check out the MSDN example here that shows how to use it. If you bind a datasource to it, it will figure out the columns and adjust dynamically then, or you can predefine the columns you want for more customability.
You are talking about bulk insert/update. You could use XML insertion/updation for this purpose. Get all the data to a DataSet ds variable. Then use ds.GetXml() method to convert the dataset to XML string. Pass this to an XML parameter into SQL server which has the datatype 'XML'
INSERT INTO YOURTABLE
SELECT
V.VOI.value('(.)[1]', 'int')
FROM
#Input.nodes('/DATASETNAME/DATATABLENAME/') V(VOI)
Use this link to learn more
You need dynamic table with Add, View,Edit and delete operations on each data.
I would suggest using DataTable Jquery component. there are tons of examples on Data operations, and you can plug this with any Server technology including ASP.net
http://editor.datatables.net/
I want to create a type of Summary report for an account. The report should have a chart of account data from one data source AND a grid of different account data from another data source.
I want to use all of the data from table one where account_ID = X AND I want to use all of the data from table two where account_ID = x.
Crystal Reports will let me add two different datasources, but It wants to link them to create a sub report in a Master / Details kind of way. I need to report on ALL of the data in table one, and all of the data in table two.
I'm a bit confused on how to do that.
Note: When I'm doing this for one report only, I just create a datatable from a view filtered by the account_ID and then set that as the datasource for the report. That way the heavy lifting is done before Crystal Reports gets the data. Again, not sure how to do that for two different datasources.
If the datasets are different enough that a JOIN doesn't make sense, you'll want to use a sub-report. First, create the report as if you were only using one of the data sets. Then, insert a sub-report where you want the second grid to show up (go to Insert --> Subreport); usually putting it in a new section. Build the sub-report using only the second dataset -- it may help to think of it as a full report in itself, as if the main report didn't exist.
Right-click the sub-report "field" in the main report and select Change Subreport Links. Add the account_ID field and you'll automatically get a parameter, Pm-Table.account-ID, and basic select expert in the sub-report itself.
Double-click it, and you'll get a new tab for just the sub-report. In the long run, you'll want most of the sections suppressed, so the output is just the grid.
Once all that is done, running the main report will display both sets of results.
This might be a pretty simple question but I'm a Crystal Reports newbie...I have a report where I want specific pages that have a corresponding column omitted. So for example say it has someone's name and information on every page, how would I use a column that for example has the state on it, to omit certain results, like I don't want any pages in the report generated from states that have the "state column" from the database equal to like "TX" or something. This isn't what I'm actually doing, but it's an example of the functionality I want.
I'm thinking it would be in either the group or record selection formulas but I'm not sure how to go about putting it together to not create a page for the results when a certain column is equal to a value.
-Thanks from a total Crystal Reports noob.
So each page of the report is one record in the result set (someone's name and information) and you want to exclude some pages based on the value of one of the columns?
Perhaps I'm not understanding the problem correctly but can't you just change the datasource query?
WHERE state <> 'TX'