I am having an issue with a table with self relations lets call it Table1
I created a table with two fields Id and name
Then i created a one to many relation from this Table1 to Table1 where one parent record can have many child records
Then i created a page lets call it Page1
This page has an insert for where you enter the name and select a parent record
This issue is that when i create a record and select a parent record. the first time i reload the application it takes the parent and makes the parent of that parent the child record.
Example I enter the following data in the insert form
Id Name Parent
1 USA No Selection
2 Canada No Selection
3 Houston USA
4 Toronto Canada
5 Minute Maid Houston
This goes fine, but when I refresh the application the data changes to
Id Name Parent
1 USA Houston
2 Canada Toronto
3 Houston Minute Maid
4 Toronto Canada
5 Minute Maid Houston
if i change it back it stays correct until i make a new entry then the issue repeats. Any ideas on what is causing this issue?
Related
I just realised that im facing huge problem on my project. I have 3 tables- slimnica(Hospital), nodala(Department) and telpa(Room). There are hundreds of Hospitals, Departments and rooms. When im filling table Room, i must select ID from table Department, but the problem is, one multiple hospitals can have example, Surgery department. It means, when im filling up Room table, i can put autolookup Departments name, but then it will show multiple Surgery departments. Is there a way to also show name of Hospital in autolookup? I added link down below of my tables.
Tables: Slimnica(Hospital), nodala(Department), telpa(Room)
Example:
I have 3 different hospitals, but all of them has Surgery department. When im filling up Room table, i must select what depertment it is, so i select departments id(it will show department name, because of autolookup name) and it will show me 3 options - id 1, surgery. id 2, surgery. id 3, surgery. Is it possible to make a autolookup that will also show hospital where that department is??? example - id 1, surgery, Childrens traumatology hospital.
I want to put 3 Fields in the contact form 7. The first one is Country then the second is states and third one is cities. When I select India from the country list then shows states according to India in the states field.
Is there a way I can design a report (using VS2010, ASP.Net), which will list customers in the following format:
Id: 1
Name: Joe Bloggs
Address:Address 1
City
ZIP
State1
Id: 2
Name: Steve Brown
Address:Address 2
City2
ZIP2
State2
...
Can I have such a format?
Yes, use List to iterate through each record and add the item template for each employee.
In your case you should group your list by the EmplyeeID field, that will make each ListItem show a single record of an Employee.
Inside the List place: 5 labels for each field, e.g. ID, Name etc..
Next to each label place a text box and attach it to the DataSet fields provided by the list element.
here is an example for you: Using Lists - MSDN
i want to show one master and one detail data.
master data from sale table and detail data from phone table
there is no relation between two table only one field is common in two table that is country code.
in the first page i want to show data regarding UK like
UK details it is title country wise
-----------------------------------------------------------------------
Total Sale : 112300 Diag sale: 1300 Reman sale : 10000
Caller Name incomming call out going call call transfer
---------------- --------------------- ------------------- ----------------
keith 5 5 2
john 3 2 1
sam 8 4 5
in the next page same data will come but USA data will show. so in this way country specific data will show in each page.
i am new in ssrs so i am not getting any idea how to design this report with ssrs
my store will supply data and it will take only one parameter like country code. if i pass country code like 'GB,US,DE' then my sp will return two result set first result set will fetch data from sale table for country GB,US and DE like
total_sale, diag_sale, Reman_Sale, countrycode
112300 1300 10000 GB
10200 1200 4700 US
4200 1500 5600 DE
first result will look like above output
second result set will look like
callername incommingcall outgoingcall calltransfer countrycode
keith 5 5 5 GB
john 3 2 1 US
sam 8 4 5 DE
so discuss in detail how could i design this type of report with ssrs.
Good Morning,
In addition to anakulk's solution, you could display detail records using a sub report. You would create the master report which contains the data from your sales table. You would create another report that is based on the phone table.
On the master report, you would insert a sub report, select the report you built based on the phone table, and link it using the country code. This way, whenever you have the UK sales information displaying, the sub report will display the details from the phone table that have UK in the country code field.
Do you know about Datasets?
If yes then then in dataset query you can join two tables to get whatever you want on report.
Now on report:-
1)You can take a tablix
2)In that tablix ,on first row you can write expression for displaying CountryName
3)on second row of tablix, you can put "Total Sale : 112300 Diag sale: 1300 Reman sale : 10000 "
4)and finally on 4th row you can put the details fields.
5)You have make a row group ,group by CountryCode.
This just a brief idea..I hope this will help you a bit to atleast start..
I have a matrix report in SSRS 2005, and the rows have certain sections. Imagine along the left a series of
1 $100
2 $400
3 $150
4 $650
5 $500
6 $400
7 $900
And I want some rows to be able to be hidden. For example, row 7 are totals of row 5 and 6, so I'd want to +/- next to row 7 that will show/hide rows 5 and 6. (Note that I don't calculate these totals, they were done by an accountant and it is important that I use the values in the database and don't calculate the totals myself.)
Now I have this "parent/child" relationship in the database, and I could add that as a group on the row
4 1 $100
4 2 $400
4 3 $150
- 4 4 $650
7 5 $500
7 6 $400
- 7 7 $900
And then I could add the toggle to that first column, BUT I don't want the values to be subtotaled when they are rolled up. I simply want rows 5/6 to disappear and only show row 7. Kind of new to SSRS so any suggestions would be great.
So with one group toggled:
+ 4 4 $650
7 5 $500
7 6 $400
- 7 7 $900
Other gorup toggled:
+ 4 4 $650
+ 7 7 $900
Etc.
4 1 $100
4 2 $400
4 3 $150
- 4 4 $650
+ 7 7 $900
How can I accomplish this such that I am not recalculating the parent rows(rows 4 and 7 in this example)?
If there is a free web control that can accomplish this in ASP.NET I'd be glad to hear about it as well. I have a sinking feeling that I'm going to have to write some AJAX myself to accomplish this. I kind of wondered if there was some hack to embed some javascript into the report that could accomplish this.
Effectively you have two problems:
Report subtotals that come from the database, not calculated
Dynamically hide and expose detail rows
You can do this with a standard table report, as follows:
Report database subtotals
You can do this in plain SQL (D is the Detail table and G is the Group table):
SELECT D.ParentId, D.ChildId,
D.Description as DetailDescription, D.Amount AS DetailAmount,
G.GroupDescription, G.GroupAmount
FROM MyTable D INNER JOIN
(SELECT ChildId AS GroupId, Max(Description) as GroupDescription, MAX(Amount) AS GroupAmount
FROM MyTable
GROUP BY ChildId
WHERE ChildId IN (SELECT DISTINCT ParentId FROM MyTable)) G ON GroupId = D.ParentId
WHERE D.ChildId NOT IN (SELECT DISTINCT ParentId FROM MyTable)
So what we are doing is getting all the rows which aren't subtotals (that is, the rows where the ChildId is not a ParentId) and in the nested select we are also putting the subtotal on every detail line. Now, in the Group on the table, we can simply report the GroupTotal field from our dataset rather than an actual subtotal.
Dynamically hide and expose rows
Create a group in your table. Here is where you report the GroupTotal just as a field, not as a total (although you could MAX or MIN it if you wanted to).
Right-click the detail group and click Edit. On the Visibility tab, check the Visibility can be toggled by another report item checkbox and select the textbox name of the first textbox of the group above. Set the Initial Visibility to either Visible or Hidden as required.
Off the top of my head and untested but you should get the idea.
Edit to explain layout better (Note: SQL above also edited to show descriptions)
I'm working with a table here, not a matrix.
Layout would look like as follows (first column shows what group you are on):
Table Header Parent Id Child Id Description Amount
Group1 Header =Fields!ParentId.Value =Last(Fields!GroupDescription.Value) =Max(Fields!GroupAmount.Value)
Details Group =Fields!ParentId.Value =Fields!ChildId.Value =Fields!DetailDescription.Value =Fields!DetailAmount.Value
Group1 is set to Group on ParentId, only the header is displayed (no footer) and the ParentId Textbox on that group is called ParentIdGroup. Details Group has "Visibility can be toggled by another item" checked and "Report item" is set to ParentIdGroup.
I have mocked up this report now and it works as you describe - what looks like subtotals are actually database fields and the description shows on the group row.
I was able to accomplish this by setting the expression for the data field value to Last, since in my case the subtotals are always the last row of the series of rows. Whenever the rows are expanded, then Last displays the value for each row, since each row is it's own group. And then whenever I collapse using the PatenLineNumber toggle, then the Last shows the value of that parent row, since it appears as the last row in the group.
So my matrix report is something like this:
Amount
ParentLineNumber ChildLineNumber =Last(Fields!Amount.Value)
I am still having a seperate issue, but that is a seperate question.