iTextSharp table on every page - itext

I need to make a PDF document with a table containing multiple rows and columns that shows client information.
I also need to show the products of this client. I create a loop which creates a new table with multiple rows and columns and the product information.
This works fine. I start with the client table and next I have multiple product tables. I've set KeepTogether to True and SpacingAfter = 20f. So after each product table I have some white space.
When the client has many products the product tables continue on the next page. Exactly what I want.
But on the new page I want to start with the client table again. What is the best workflow to do this?

Related

Limit table in spotfire based on marked rows in another table

I have 2 tables in my visualization. One is a list of tasks to be done, and one is a list of repairs that have been done at each location. I want to be able to filter the repairs table by the locations of the highlighted tasks. Ergo if you marked a task that takes place at location 1, the second table would filter to only show repairs for location 1. Is that something that's doable?
Thanks in advance
This is pretty easy to do. You need to create a relation on the Location column between your two tables (Data table properties, Relations tab). Then create a details visualization (right click on "parent" table and select details visualization). Because you have created the relation already, it will ask you which table you want to be the "child". After selecting which table, you will be able to click on the parent, and it will filter in the child table. Also note, using the right click menu is engaging the data limiting with marking, which you will be able to see in the properties dialog, data menu. You don't have to use the right click menu to setup details visualizations. It's just easy.
I've written a lot about how to use relations and column matches. See links below. Relations integrate filtering, which is what you want. Column matches integrate marking.
https://www.bigmountainanalytics.com/apply-relations-and-column-matches-in-spotfire/
https://www.bigmountainanalytics.com/how-to-use-relations-in-spotfire/
https://www.bigmountainanalytics.com/how-to-use-column-matches-in-spotfire/

Access 2010 - Parent and child forms share the same table

I'm writing a budget database, and while planning out the tables went fine, forms are proving to be trickier.
I have a 'transactions' table, and two queries based off it. The tables and column names are below
'people_to_reimburse' : payee_name, total
'unwritten_checks' : payee_name, amount, description, date_incurred
I'd like to make a form where you can go through the people to reimburse, and there's a subform showing which checks are theirs. Obviously, the payee_name would be the field to link on.
However, in Access's Form Wizard, when I select these two tables, I get an error of:
You have chosen fields from record sources which the wizard can't connect. You may have chosen fields from a table and from a query based on that table.
How would I set up a form like this, if it's possible? If not, why can't I?

Filemaker - Can I use a portal like a drop-down value list?

I am trying to work around a limitation that Filemaker 12 seems to have. In a value list that links to an ODBC attached SQL Server database, it doesn't display every piece of data. If there are 2 people with the same last name for example, it only displays the first person with that last name in the list. This is verified by the following in the Filemaker documentation (which I found after a lot of digging)
If the value list is defined to display information from two fields, items will not be duplicated for the field on which the value list is sorted. For example, if the value list displays information from the Company field and the Name field, and if the values are sorted by the Company field, only one person from each company will appear in the value list.
Portals on the other hand will find all the related data, I just don't understand how do something with the data once I get it in the portal. I essentially thus wish to use a portal AS my drop-down value list, and then to use it as I would have a value list (which is then to act as the key to do the rest of the lookups on the page to fill out the invoice.
The major issue here (other than this maddening choice Filemaker seems to make) is that the external file I am pulling the data from is an ODBC mounted SQL Server file, so I can't do something easy like a calculated field which would give me last name & " " & first which would make almost every person unique. Filemaker won't let me do that because it says I can't do that with a field that is not indexed. Any help would be greatly appreciated!
Assuming that we're starting with table MyTable and we're trying to get a ID from the People table for the selected person, which we'll call ID so that we can put it into MyTable::PersonID
Start by creating a new Table Occurrence of your People table and call it PeopleWhoCanBeSelected. If you want every person in the People table you can connect it to MyTable with the X relationship. If you want to show just a subset of the people you can build a different relationship.
Now, on a layout displaying records from MyTable you will make a portal showing records from the PeopleWhoCanBeSelected table.
In the portal put a button. When that button is pressed use the Set Field script step:
Set Field MyTable::PersonID to:
PeopleWhoCanBeSelected::ID
That should do it. You can make the button an invisible overlay on the entire portal record if you like, so that the user clicks on "the name" instead of "the button next to the name".
Now, if you want to pull additional data through to the MyTable record, you'll need to create a second Table Occurrence, called People with the relationship MyTable::PersonID = People::ID. Then you can get information on the specifically chosen person through that relationship.

How to create update process for single entry form in APEX 4.1

I'm new to APEX. I am sure this solution might be available, but was unable to find a proper answer anywhere.
Here is the case scenario: (Provide user a capability to update a particular report row).
Page 1 has report A in which there is a particular column say column B which has links to all its row, by clicking on one particular row user navigates to the new page (Page2).
Page 2 has single entry form in region one which has list of items (around 10) and on region 2 of the same page (page 2) it has a tabular form.
Some of the items in region 1 of page 2 are populated based on the information from page 1 report details. Some items have LOVs and some item user can add information.
The tabular form in region 2 of page 2 is generated based on line item id which can be edited by the user. The tabular form is associated to one table only.
There are two buttons on the page, cancel button takes back to the report page, whereas the save button will save the data to the database tables. The single form items will update 2 tables, whereas tabular form will update one tables.
How the process needs to be establish for updating the underlying tables through apex.
Right now Tabular form has MRU update built in process(but I am not sure can I use this process in coordination with single entry form or it is better to create a separate process which handles both updates)
Can anybody give me an idea how this can be accomplished, or a link where such process has been explained?
You will need to manually create plsql processes to process the submitted values and apply them to your tables. You can not use the built-in row processing to do this: you can not define 2 per page. (That makes sense because you can not indicate which column maps to which table. You can only define "database column" as source for an item. This means that even if you were to have 2 processes, these columns would be attempted to process on both processes, which would lead to errors.)
Take a look at this post for some ideas on how to set the processes up: https://stackoverflow.com/a/7877933/814048
if :P42_ORDER_STATUS in ('IP','OW') then
begin
FOR I in 1..APEX_APPLICATION.G_F01.COUNT LOOP
update sales_mst set ORDER_STATUS = 'DR'
where id = to_number(apex_application.g_f01(i));
end loop;
end;
end if;

APEX - Creating a page with multiple forms linked to multiple related tables... that all submit with one button?

I have two tables in APEX that are linked by their primary key. One table (APEX_MAIN) holds the basic metadata of a document in our system and the other (APEX_DATES) holds important dates related to that document's processing.
For my team I have created a contrl panel where they can interact with all of this data. The issue is that right now they alter the information in APEX_MAIN on a page then they alter APEX_DATES on another. I would really like to be able to have these forms on the same page and submit updates to their respective tables & rows with a single submit button. I have set this up currently using two different regions on the same page but I am getting errors both with the initial fetching of the rows (Which ever row is fetched 2nd seems to work but then the page items in the form that was fetched 1st are empty?) and with submitting (It give some error about information in the DB having been altered since the update request was sent). Can anyone help me?
It is a limitation of the built-in Apex forms that you can only have one automated row fetch process per page, unfortunately. You can have more than one form region per page, but you have to code all the fetch and submit processing yourself if you do (not that difficult really, but you need to take care of optimistic locking etc. yourself too).
Splitting one table's form over several regions is perfectly possible, even using the built-in form functionality, because the region itself is just a layout object, it has no functionality associated with it.
Building forms manually is quite straight-forward but a bit more work.
Items
These should have the source set to "Static Text" rather than database column.
Buttons
You will need button like Create, Apply Changes, Delete that submit the page. These need unique request values so that you know which table is being processed, e.g. CREATE_EMP. You can make the buttons display conditionally, e.g. Create only when PK item is null.
Row Fetch Process
This will be a simple PL/SQL process like:
select ename, job, sal
into :p1_ename, :p1_job, :p1_sal
from emp
where empno = :p1_empno;
It will need to be conditional so that it only fires on entry to the form and not after every page load - otherwise if there are validation errors any edits will be lost. This can be controlled by a hidden item that is initially null but set to a non-null value on page load. Only fetch the row if the hidden item is null.
Submit Process(es)
You could have 3 separate processes for insert, update, delete associated with the buttons, or a single process that looks at the :request value to see what needs doing. Either way the processes will contain simple DML like:
insert into emp (empno, ename, job, sal)
values (:p1_empno, :p1_ename, :p1_job, :p1_sal);
Optimistic Locking
I omitted this above for simplicity, but one thing the built-in forms do for you is handle "optimistic locking" to prevent 2 users updating the same record simultaneously, with one's update overwriting the other's. There are various methods you can use to do this. A common one is to use OWA_OPT_LOCK.CHECKSUM to compare the record as it was when selected with as it is at the point of committing the update.
In fetch process:
select ename, job, sal, owa_opt_lock.checksum('SCOTT','EMP',ROWID)
into :p1_ename, :p1_job, :p1_sal, :p1_checksum
from emp
where empno = :p1_empno;
In submit process for update:
update emp
set job = :p1_job, sal = :p1_sal
where empno = :p1_empno
and owa_opt_lock.checksum('SCOTT','EMP',ROWID) = :p1_checksum;
if sql%rowcount = 0 then
-- handle fact that update failed e.g. raise_application_error
end if;
Another, easier solution for the fetching part is creating a view with all the feilds that you need.
The weak point is it that you later need to alter the "submit" code to insert to the tables that are the source for the view data