SSRS Report: List Control show data inside a table - reporting-services

I need to create an SSRS report in Visual Studio 2017 in which I need to show students information. Only the interest section of student should be shown inside a table
I have the following information.
STUDENT ID: 1234
NAME: ABC
CLASS : X A
INTEREST | SINGING | DANCING | SPORTS | INSTRUMENTS
| YES | NO | YES | YES
STUDENT ID: 4321
NAME: XYZ
CLASS : X A
INTEREST | SINGING | DANCING | SPORTS | INSTRUMENTS
| NO | NO | YES | NO
The above is a list control which shows each student details class info and interest info. Here the interests section should be shown inside a table.
Could you please tell me how to do this.
Thanks in advance

Related

How to generate filtered report for records of all employees in table.in access

I have a table and report generator form in ms access, my form has 3 combobox, 1 for start date , 2nd for end date and 3rd for employee name. So basically this form generates a report for the records, which has the given start date to the given end date from the "date" colum of the table for the given name of employee from the "AdvisorName" column of table, on click of a submit button. Here is the query i use in macro to generate and filter the report :
Mau_con![Action Date] Between DateValue(Forms!frmReportFilter!txtStartDate) And DateValue(Forms!frmReportFilter!txtEndDate) And Mau_con![AdvisorName]=Forms!frmReportFilter!cmbAdvNam
the combo box for name takes the values from a table, now I want this name combobox to have another option, "All", which should generate records of all the employees from the given start date to end date, instead of just pulling out reports for one employee.
I do not know the procedure for this neither I have any clue for the best query to drag the data.
Any help on this please.
Edit - if you feel I have not provided enough info or the question is not clear then please ask, marking down the question will revoke my access to ask further questions since i am a new user. Hence, request you guys to please atleast ask first else you will just stop my learning.
Edit 2(as table needed to answer the question) -
+-------------+-------------+
| Action Date | AdvisorName |
+-------------+-------------+
| | |
| | Shiv Kumar |
| 13/10/2017 | Adarsh |
| 13/10/2017 | Varun |
| 13/10/2017 | Shiv |
| 13/10/2017 | Debbie |
| 13/10/2017 | dasd |
| 12/10/2017 | sdasd |
| 13/10/2017 | Chesfeeda |
| 13/10/2017 | Nishant |
| 16/10/2017 | shiv |
| 16/10/2017 | shiv |
| 16/10/2017 | shiv kumar |
| 16/10/2017 | asdas |
| 16/10/2017 | shiv |
| 16/10/2017 | shiv kumar |
+-------------+-------------+
So this is my table name "Mau_con" I have total 14 columns in this, but as of now have nothing to do with others columns hence I have not pasted other columns
Combobox RowSource will have to be a UNION query to add the "All" item. However, "All" is not a valid parameter for the report (unless actually have someone named All). Could use "*" as the choice for users in the combobox but this is not intuitive. So, change the report WHERE clause to:
AND Mau_con![AdvisorName] LIKE IIf(Forms!frmReportFilter!cmbAdvNam = "All", "*", Forms!frmReportFilter!cmbAdvNam)

Group results in Crystal Reports where linked column has multiple related results

I have two tables that are linked. The first table is a list of prescribed medications ('medications' table) and the other is a list of actions that relate to the medication when it has been prescribed ('PMP' table)
For each prescribed medication, there can be multiple actions such as authorise, comment, stop etc.
What i am trying to do is to call all prescribed medications along with every other action for that drug.
I can do this using the code below.
select medications.oid, medications.drug, PMP.action_dte, PMP.actions
from medications
left join PMP on medications.oid = PMP.fk2_oid
This works fine and i get everything i need. But the medications that have multiple actions are returned once for each action.
My issue comes when i want to put it in to a Crystal Report.
I have a subreport called Drugs and i want to list all of the authorised drugs on the left and then all the actions for that drug on the right. But what i get is.
OID | MEDICATION | ACTION DTE | ACTION
| | |
1 | Paracetamol 200mg | 01.01.17 | Authorised
| | |
| | |
1 | Paracetamol 200mg | 03.01.17 | Comment
| | |
| | |
1 | Paracetamol 200mg | 10.01.17 | Stop
| | |
| | |
2 |Ibuprofen 100mg | 05.01.17 | Authorised
| | |
| | |
2 |Ibuprofen 100mg | 06.02.17 | Comment
Where as i would like
OID | MEDICATION | ACTION DTE | ACTION
| | |
1 | Paracetamol 200mg | 01.01.17 | Authorised
| | 03.01.17 | Comment
| | 10.01.17 | Stop
| | |
2 | Ibuprofen 100mg | 05.01.17 | Authorised
| | 06.02.17 | Comment
| | |
I have played around with grouping by oid and fk2_oid. As well as trying to link two sub reports on those fields but i am getting no where.
Is anyone able to suggest a formula or preferably a modification to the code which will allow the crystal report to display the drug on the left ONCE along with every action related to that drug on the right.
Thanks in advance!
EDIT ----------
I forgot to mention that there is a date field in the equation. Which is PMP.action_dte. Edited the original query and description.
Apologies for any confusion caused.
EDIT 2 ---------
Apparently my original post was misleading.....modified to hopefully clarify. I would like the drug grouped by OID with every action allocated to that drug listed along with the action date, as shown above.
Bring in your results
Under Report > Group Expert, group by Drug.
Then I deleted Drug in Details
In Group Header 1, Section Report, check on Underlay Following
Section
Remove Bold for Group #1 Medication
You can download the Crystal Report here

DataReport data from multi tables help required

I am facing a problem that I have to show database results from 3 different tables on a single report these three tables have are used for different purposes and want to show their headings details separately. I am using VB6, MS Access and designing this report in DataReport a common feature for this.
Table1 is for Menu Details
Having following fields: Bill_ID, Menu Type, Cost
Table2 is for Services Details:
Having following fields: Bill_ID, Service Name, Cost
Table3 is for Extra Details:
Having following fields: Bill_ID, Description, Cost
Now structure I want to is like this using common Bill ID, and want to show the headings for each table and then details of each table one by one like this
Bill ID: 1234567890
Menu Details
+-----------+--------+
| Menu Type | Amount |
+-----------+--------+
| Prod1 | 100 |
| Prod2 | 60 |
| Prod3 | 75 |
+-----------+--------+
Service Details
+--------------+------+
| Service Name | Cost |
+--------------+------+
| Service1 | 15 |
| Service2 | 17 |
+--------------+------+
Extra Details
+-------------+------+
| Description | Cost |
+-------------+------+
| Extra1 | 11 |
| Extra2 | 12 |
+-------------+------+
Total Amount: $xxxx
It has been a long time since I used Data Reports in VB6, but I would have created 3 sub reports from 3 different tables and linked the subreports using the Biil_ID after embedding them into the main report.
I tried posting this as a comment, but I dont have enough reputation to post a comment and hence I have posted this as an answer

How to save language skill levels correctly in a database

I think I am before a problem where many of you were before. I have a registration form where a user can pick any language of the planet and then pick his skill level for the respective language from a selectbox.
So, for example:
Language1: German
Skill: Fluent
Language2: English
Skill: Basic
I'm thinking what's the best way to store these values in a MySQL database.
I thought of two ways.
First way: creating a column for each language and assigning a skill value to it.
--------------------------------------------------
| UserID | language_en | language_ge |
--------------------------------------------------
| 22 | 1 | 4 |
--------------------------------------------------
| 23 | 3 | 4 |
--------------------------------------------------
So the language is always the column's name and the number represents the skill level (1. Basic, 2. Average ... )
I believe this is a nice way to work with these things and it is also pretty fast. The problem starts when there are 50 languages or more. It doesn't sound like a good idea to make 50 columns where the script always have to check them all if a user have any skill in that language.
Second way: inserting an array in one of the table's column. The table will look like this:
----------------------------------
| UserID | languages |
----------------------------------
| 22 | "ge"=>"4", "en"=>"1" |
----------------------------------
This way the user with ID 22 has skill level 4 for Germany and skill level 1 for English. This is fine because we don't need to check 50 additional columns (or even more) but it's not the right way in my eyes anyway.
We have to parse a lot of results and find a user with, for example, has level 1 for Germany and level 2 for Spanish without looking for the English skill level - it will take the server's a longer time and when bigger data comes we are in trouble.
I bet many of you have experienced this kind of issue. Please, can someone advise me how to sort this out?
Thanks a lot.
I'd advise you to have a separate table with all the languages:
Table: Language
+------------+-------------------+--------------+
| LanguageID | LanguageNameShort | LanguageName |
+------------+-------------------+--------------+
| 1 | en | English |
| 2 | de | German |
+------------+-------------------+--------------+
And another table to link the users to the languages:
Table: LanguageLink
+--------+------------+--------------+
| UserID | LanguageID | SkillLevelID |
+--------+------------+--------------+
| 22 | 1 | 1 |
| 22 | 2 | 4 |
| 23 | 1 | 3 |
| 23 | 2 | 4 |
+--------+------------+--------------+
This is the normalised way to represent that kind of relations in a DB. All data is easily searchable and you don't have to change the DB scheme if you add a language.
To render a user's languages you could use a query like that. It will give you a row per lanugage a user speaks:
SELECT
LanguageLink.UserID,
LanguageLink.SkillLevelID,
Language.LanguageNameShort
FROM
LanguageLink,
Language
WHERE
LanguageLink.UserID = 22
AND LanguageLink.LanguageID = Language.LanguageID
If you want to go further, you could create another table fo the skill level:
Table: Skill
+--------------+-----------+
| SkillLevelID | SkillName |
+--------------+-----------+
| 1 | bad |
| 2 | mediocre |
| 3 | good |
| 4 | perfect |
+--------------+-----------+
What I've done here is called Database normalization. I'd recommend reading about it, it may help you design further databases.

How can I save semantic information in a MySQL table?

I wish to save some semantic information about data in a table. How can I save this information in MySQL, such that I can access data and also search for the articles using the semantic data.
For example, I have a article about Apple and Microsoft. The semantic data will be like
Person : Steve Jobs
Person : Steve Ballmer
Company : Apple
Company : Microsoft
I want to save the information without losing the info that Steve Jobs and Steve Ballmer are persons and Apple and Microsoft are companies. I also want to search for articles about Steve Jobs / Apple.
Person and Company are not the only possible types, hence adding new fields is not viable. Since the type of the data is to be saved, I cannot use FullText field type directly.
Update - These are two options that I am considering.
Save the data in a full text column as serialized php array.
Create another table with 3 columns
--
--------------------------------
| id | subject | object |
--------------------------------
| 1 | Person | Steve Ballmer |
| 1 | Person | Steve Jobs |
| 1 | Company | Microsoft |
| 1 | Company | Apple |
| 2 | Person | Obama |
| 2 | Country | US |
--------------------------------
You're working on a hard and interesting problem! You may get some interesting ideas from looking at the Dublin Core Metadata Initiative.
http://dublincore.org/metadata-basics/
To make it simple, think of your metadata items as all fitting in one table.
e.g.
Ballmer employed-by Microsoft
Ballmer is-a Person
Microsoft is-a Organization
Microsoft run-by Ballmer
SoftImage acquired-by Microsoft
SoftImage is-a Organization
Joel Spolsky is-a Person
Joel Spolsky formerly-employed-by Microsoft
Spolsky, Joel dreamed-up StackOverflow
StackOverflow is-a Website
Socrates is-a Person
Socrates died-on (some date)
The trick here is that some, but not all, your first and third column values need to be BOTH arbitrary text AND serve as indexes into the first and third columns. Then, if you're trying to figure out what your data base has on Spolsky, you can full-text search your first and third columns for his name. You'll get out a bunch of triplets. The values you find will tell you a lot. If you want to know more, you can search again.
To pull this off you'll probably need to have five columns, as follows:
Full text subject (whatever your user puts in)
Canonical subject (what your user puts in, massaged into a standard form)
Relation (is-a etc)
Full text object
Canonical object
The point of the canonical forms of your subject and object is to allow queries like this to work, even if your user puts in "Joel Spolsky" and "Spolsky, Joel" in two different places even if they mean the same person.
SELECT *
FROM relationships a
JOIN relationships b (ON a.canonical_object = b.canonical_subject)
WHERE MATCH (subject,object) AGAINST ('Spolsky')
You might want to normalize your data table by making 2 tables.
----------------
| id | subject |
----------------
| 1 | Person |
| 2 | Company |
| 3 | Country |
----------------
-----------------------------------
| id | subject-id | object |
-----------------------------------
| 1 | 1 | Steve Ballmer |
| 2 | 1 | Steve Jobs |
| 3 | 2 | Microsoft |
| 4 | 2 | Apple |
| 5 | 1 | Obama |
| 6 | 3 | US |
-----------------------------------
This allows you to more easily see all the different subject types you have defined.