How to Use some DataTable for a Client Report? - c#

I have a client report (RDLC) with these specifications. and I am using VS 2008 to implement this
I have a DataSet with 4 Different DataTable for each section. and note that all of the report located in a List in order to print a large group of Data with one request.
Description
all of the report located in a List // to print some different data with one request
At top (in the list) we have a rectangle which include some Textbox to represent common Information
At Middle I have 2 different List which include some TextBox To represent List of Professor and Managers ( it also has to show their Picture, with Name and etc)
Then I have another List to represent The Organizations Information. ( it use some TextBox inside of a List to represent All of the Organizations Information)
As Client Report work with One Dataset. I provide four DataTable for my different Report Sections.
Each DataTable Has an ID for Grouping
The Common DataTable ID use to group the entire of the list for another Object (Here University)
How Can I implement Such a report, While I can't use Different DataTable for grouping because If I do such a Thing I can Display only the First Field of the groups
Any Help is Appriciated
Thank you in advance

The simplest way will be to create an unnormalized data-view by joining your four data tables and then bind your report to it. You have group on ID (that is common to all data tables).
Yet another option would be to use sub-reports but IMO, its more complicated/inefficient to use them instead of above option.

Related

Ms Lightswitch - add dynamic (from code behind) items choice list

I am using Microsoft LightSwitch framework, need to add dynamic items in choice list. So far I found different posts saying that choice list is only for static items and you have to use a separate table if you need to populate it in non-static means.
In my case, table will also not be a good option, I want to add items manually from C# code. Actually I need to populate years combobox, for this I need to add last 3 years, current year, and one next year. This I could not achieve through static data or TABLE will also be not a good idea.
just create a lookup table and add a relationship and LS will do the rest
You can always dynamically populate the new table
Although you won't be able to delete records that have children

How to generate dynamic multi-dimensional list or array and insert data accordingly based on a dynamic SQL Server table in c#?

I want to create a dynamic 2-dimensional array (or any other structure) based on a dynamic database table in C# or T-SQL, which means the data source (which is a database table) is dynamic too.
EDIT:
Table structure:
For example:
If User1 meets the condition of Admin and Group1, it will be inserted into (Admin, Group1). And the users are constantly added in with different user type and group. So, every cellular can have as many as users.
And the problem is I don't know how many user types and groups there are, because new user types and new groups are added constantly too.
For now, I think I need to parse every data to find if it meets the existing conditions. If yes, insert it into the specific condition; if not, create a new condition and insert data into it.
But I don't have any idea about how to implement it? Do you have any ideas or algorithms?
Thanks very much for any suggestion or information.
I've solved this statically with Tuple, but not dynamically. I think I should re-fresh my tuple list periodically. But at least, it works now!
Any suggestions are welcome! Thanks!

Moving an entire slice of data to another database using LINQ

I have a database with many tables and constraints (but not much data). The database contains a few separate entities that are bound together by an ID directly or indirectly, as illustrated below:
My target is to move one entire slice of data (including data from all tables in the database) to another physical database in an easy and safe way. It's OK if it doesn't perform very well. In the above example, I would want to move the company with a certain Id as well as all employees of that company and all data related to the employees etc. through all the tables.
I want to do it with a safe compile-checked method, as I want to catch errors whenever I change my database.
The IDs in the database are mostly guids, but there are a few tables using auto incremented IDs.
note
The "Companies" table contains perhaps 5 rows, one for each company. I need to move ONE row from that table, along with all data directly or indirectly related to that row.
Suppose you want to copy data from from a detailsview(tableName=Jobs) to another table(tablename=Company)
string apply = "INSERT INTO Company (JobTitle,CompanyName) select JobTitle,CompanyName from Jobs";
this is just an idea hope it help.
UPDATE :
So this will help you
MSDN - Multiple Bulk Copy Operations (ADO.NET)
With example

Creating repeatable columns for a Sharepoint 2010 List

I'm trying to create a list that allows me to store multiple instances of a single column.
Say I have a column names "steps" which is a single line of text, and I want the user to be able to add as many as possible.
Can I do this currently in Sharepoint Lists?
Bonus points for allowing me to do it in a LoopUp column, for more complex types.
You will need to create a "Custom Field Type" to do this. Then you can delimit your different lines somehow (the internal columns link Multi-lookup, multi-choice etc use ;# as a delimiter but you can use whatever)
http://msdn.microsoft.com/en-us/library/ms446361.aspx
http://msdn.microsoft.com/en-us/library/bb684919(v=office.12).aspx
http://sharepointmagazine.net/articles/customizing-the-user-experience-of-sharepoint-custom-fields-deep-dive-part-5-of-6

C# Reordering the Tables in a Dataset

I create a custom dataset that I pass off to a black boxed component. The dataset consists of usually 5-6 tables (with unique names assigned by me). The component takes the dataset and builds a drop down combo box based off the table names. What I am needing to do though is to change the ordering of the tables within the dataset. I need to do this so I first offer up to the user the appropriate selection in the drop down (based off what section in the application they are in). So for instance...if they are in "Section A" then that is the first table name shown in the drop down list...if the user goes to "Section F" then that is what is shown in the list first...so on and so forth.
The more code intensive way is of course to just change the ordering in which I add the tables to the dataset. This would work, but I thought there had to be some way to do this more elegantly and with less code.
I am working in C# with the 3.5 framework.
Remember that DataSets and their contents are stored on the heap, so you can have a DataTable object in more than one place in the DataSet.
Simply create your DataSet with a dummy DataTable in position zero. Then, based on whatever section they'e in, you put the corresponding table in position zero. Your table name will appear twice in your DropDownBox, once as the 'default' and again below in its proper context and order with the other tables.
public class ThisThing
{
private DataSet myDS = new DataSet();
//Populate your DataSet as normal
public DataSet ChangeLocation(int CurrentSectionNumber)
{
myDS.Table[0] = myDS.Table[CurrentSectionNumber]
}
}
I'm not sure trying to force your ordering information into the DataSet's data structure is the most intuitive approach. You might consider passing an ordered list of DataTable instead of (or in addition to) the DataSet.

Categories