I would like to ask how can I display only certain rows of a table based on a condition from another table. In other words I want to relate the tables.
More concrete, I have a table with header data. I created a hotspot for the field "Purchase Order No". I want to display the line items for a particular purchase order by clicking on the some purchase order number in the header table. The issue is the following: When I click on some purchase order number in the header table, I open the table with all line items accross all orders. How can I get only the line items for the particular order and not the whole table?
How can I do this using the class CL_SALV_TABLE? Thank you in advance and sorry for the silly question.
I believe you are displaying the Header data as ALV list with Hotspot set on Purchase Order Field. If so, in the event handler method of Hotspot_click, just get the selected purchase order number with the help import parameters and filter the item data based on it and call factory method of SALV class.
Related
Guys!
I'm working on a project with Bizagi Suite - Version 11.1. I'm new to it and I will really appreciate your help, because I'm having a hard time creating a dynamic combobox control.
So my case is the following:
Data Model: 3 master tables: Program, Order and Order-Program (m-m relationship). In table Program users fill out year, positions and amounts for each position. In table Order, they fill out info about the order and they have to specify from which program they want to take the money out for the order. The Program itself has a lot of records with different positions and amount. And I want when the users fill out the order to select the year, the position and the amount they want to take out of the program. So I need to have a dynamic combobox for the field 'position' which loads when user select year.
In other words I need to load combobox with filtered records of master table.
Do you have any ideas how I can do that?
Thank you in advance!
Best regards,
A.Mincheva
You must define your combobox with the full content of the master table.
Then ,you can define a Filter expression to dynamically filter the combobox content.
In the filter expression, you need to retreive the value of selected Year with XPath and use this value to filter the records.
In the form designer, you go to "Actions & Validations" to define the following action :
When "Year" changes <=The display name of the input field
Then Refresh "Program" <=The display name of your dynamic combobox
I have two tables that I am creating a report from. One is Orders, and the key is called OrderID.
I have another table called Parts, also containing OrderID. They have a relationship as well. On my Order forms, I have a listbox and populate that based on the two OrderID's.
Now, I have a report with the data source as Orders. I also added a listbox and set the Row Source/Type to Table/Query pointing to my Parts table. However, when I set the criteria of the two OrderID's to match to display on the corresponding Parts per the Order, it only picks up the Order in the first detail, and repeats it for each successive detail. How can I get the listbox to only display where the two OrderID's match>
Code used
Report results
Consider using a subreport. Here are steps:
Create a smaller Parts report separately which contains all your listed fields (PartNumber, PartDescription, PartQty, etc.) bound only to the Parts table. Be sure to not put any controls in Page Header/Footer of this subform (as they will not show on main report). Put field headers in this subreport's Report Header section.
Then, on your main Orders report stretch out the detail section and place the Parts subreport just below the records in the same manner as your screenshot. Subforms are the newspaper icon in control section close to the very end which automates a walk-through Wizard -might be slightly different in AC2003 .mdb files.
In the wizard, select the Parts subreport created above and confirm the matched OrderID between parent form and child subform. If relationships are set up matched keys should be auto-linked waiting for user confirmation.
Doing this your original main report will now have correctly aligned Orders and Parts for each distinct OrderID of Order table.
Gonna need some VBA to do that, or base it off a query. The key here is that you need to INNER JOIN the tables to each other, on the OrderID. Also, adding the DISTINCT qualifier will only return unique values, thereby removing dupes. So, something like this (which will need to be changed based on your actual table names and field names):
SELECT DISTINCT Orders.OrderID
FROM tblOrders Orders
INNER JOIN tblParts Parts
ON tblOrders.OrderID = tblParts.OrderID
Then, if you're looking for a specific order, you can filter that by adding a WHERE clause.
I am trying to make a simple form that 'registers' users into a meeting. I'm trying to get the form to submit the meeting 'id' into the database but I wish to display a different value for the user (so that they do not stumble through meeting id's). I've added two columns to the query (meeting id and meeting information) but I am unsure how I would get the form to submit the meeting ID but display the meeting information for the current user.
EDIT: I've tried your method Chris but it doesn't seem to work.
Edits made:
http://i.stack.imgur.com/6IUuD.png
http://i.stack.imgur.com/3PTTZ.png
You need a rowsource query with TWO values because you have two columns. For example:
SELECT meeting_id, meeting_name
FROM meetings
In this case the 'bound column' property would be '1' because in the example you first select the meeting_id.
In the 'column width' property you then type "0cm;4cm". 0cm means that the first column (the IDs) will not be shown.
go to design view of the form and change the bound column to the number that represents the column you desire to have displayed. eg.
You can add the query at the Row Source as in the image a query builder will appear and you just create the query and save it.
I cannot seem to figure this out. I have made it very far with this database but now i am at a loss. I am going to post screenshots and details below and I hope it will be enough info.
This is my main form (dashboard). It shows the status of calls my employee has received. I need to implement a search. I would like it to search by customer or part.
My Goal is to have someone enter a string in the search field and retrieve matches to display on my details from (that contains a subfrom)
This is the detail screen. It shows the customer and the part(s) on the subform. All the customer info is unbound due to the way it is handled. I have a customer master table my employee can search from and add to the call. If the customer is not in my master table he can enter one manually. The unbound boxes are tied by a CustomerID field.
These are my Relationships for the database
This is the function that matches the CustomerID to fill the unbound boxes
This is my table for the detail form
And finally my table for the subform
I am working on Windows Forms Projects.
I am creating a report for customers.
The report data is pulled from a "CustomerDetails" table.
A field in the table is called "CustPhotoName", this holds a string which relates to an image file.
I Currently have a report set up which runs for a single customer by passing in a customer ID. Then using the passed in ID to populate a Dataset with an ImageRow and then a sub report with the image from the dataset.
I am wanting to set up this report where I can pass in an array of customer IDs and produce the reports (1 page per customer with image (if CustPhotoName has value))
Please can someone let me know how is the best way to do this for the multiple customers.
Add a CustomerID parameter to the report. Type Number. Set it to allow multiple values. In the report's record-selection formula, add the following:
AND {table.customer_id} IN {?CustomerID}
You probably want to group the report by {CustomerID} as well. In the group's footer, select Section Expert and check New Page After. This way each customer will start on a new page.