Placing multiple subreports on a page

I need to design a work order which is a single page for each selected record from an Orders table. Each order also has multiple detail records from up to 6 related tables, for which I will use subreports. I am having a bit of a problem placing the subreports on the page in the way that the client wants them. The layout is difficult to explain so I have created a drawing of it which you can see by clicking the link below.

I plan to create a master band for the top section (Design, Posting, Pressing and Grinding areas) and a child band for the bottom (Finishing and Shipping areas), each containing the appropriate subreport. My problem is with the Pressing and Grinding sections since these are alongside the Design and Posting sections, but underneath each other. Since two subreports can't be placed under each other in the same band like this I am wondering how to achieve this layout.

Glenn

Click here to see layout

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:42AM
    glen can you post some sample data in the binaries newsgroup.
  • edited 5:42AM
    I don't have any sample data available yet as I'm in the process of converting the data from another system. But I don't know why you would need sample data to answer this question. Isn't the layout enough?
  • gordkgordk St.Catherines On. Canada.
    edited 5:42AM
    the layout is great for a general layout,however their is a number of ways to try and accomplish this as it is not as simple as it appears.
    in mamy cases I have found that when sample data is supplied i usually find something that was overlooked.
    Also will framelines be needed or are just using them to show the areas?
    is there a limit to the number of records in each detail table per order table record or could any of the whole layout force a second output page to be produced?
    There is a possibility that this may be as simple as a couple of child bands stretched and alow split using memoviews with code in their obp event to iterate through the records of each detail table dataset and use the memo.lines.add method to add the text we want to each memo.








  • edited 5:42AM
    I don't think you need to worry about my overlooking something about the data. The detail records will generally consist of two fields from the detail table. The first is one character and the second is a short text field, maybe 20 characters or so. There will only be a few records per detail table at most. The space allocated will be enough to hold them and no second page will be needed. The framelines are needed, but I will probably just do them as line objects so I don't think they are a problem.

    In retrieiving the data, I will be using queries, not tables. I will run a query to get all the necessary orders and in the OnScroll event of this query I will run 6 queries to get the detail records. I have tried this with some other data on a simple layout and it works fine. I actually did think about creating a bunch of calculated memo fields in the query to hold each set of detail data, similar to what you are saying but done at the database level rather than in the report. In that case the 6 queries would possibly be run in the OnCalcFields event rathen than OnScroll. Of course the iteration to create the memo fields would have to be in OnCalcFields. Actually this method would completely eliminate the need for subreports. In each place on the layout where I have indicated a subreport I would simply place one of these memo fields. What do you think of this idea?
  • gordkgordk St.Catherines On. Canada.
    edited 5:42AM
    Seems possible. I expected you would be using queries.
    BTW the right hand side the 2 subreports you show could possibly be 1 subreport using 2 masterbands and 2 headers.
    you can also use engine object to set and control curx cury props for bands and objects.
  • edited 5:42AM
    That's an interesting alternative to the memo method. I could put the dividing line in the header of the second band. But to get that band to be at a fixed position regardless of the length of the first one, would I need to use the engine object to position it or is there another way?
  • gordkgordk St.Catherines On. Canada.
    edited 5:42AM
    yes you could in obp event of second header if engine.cury < value then engine.cury := preset value;.
    generally i usually use frames of memos for horizontal lines and some the shapeview for diagonal lines and shapes. when the output page is always the same like a preprinted form i usually use and overlay band to handle lines adding the overlay to the design page last and below the last band and large height in design mode from page settings. I also usually design in pixels
  • gordkgordk St.Catherines On. Canada.
    edited 5:42AM
    Glen here is some sample code for memos
    memo 3 located in master band below other memos has a fixed height and we wanted detail data from tclientdataset connected to master tclientdataset in this memo.
    placed a non visible detailband on design page connected to detaildataset for for access to props and navigation.
    procedure Memo3OnBeforePrint(Sender: TfrxComponent);
    var i: integer;
    begin
    memo3.lines.clear;// clear design note text then insert
    for i := 0 to detaildata1.dataset.recordcount -1 do
    begin
    memo3.memo.Insert(i,<ISP.Phases."Phase">);
    detaildata1.dataset.next;
    end;
    end;
  • edited 5:42AM
    I can't find any documentation or examples on overlay bands but it appears that they are basically like watermarks that cover the whole page.

    I'm not sure yet if I'll use the memo method or the subreports with your suggestion of combining the two on the upper right into one with two master bands. What would be your preference?

    Also, if I do use memos, I'll create them in the OnCalcFields as I mentioned before, rather than in the report. I prefer to do as much coding as possible in the app itself rather than in the report.

  • gordkgordk St.Catherines On. Canada.
    edited 5:42AM
    overlay is a bit of a misnomer, underlay would be a better description, it is actualy the first band handeled by the engine when it exists. it actualy starts printing at the page top so locating objects in it is relatively easy, top of band corresponds to top of printable page.
    IMHO i prefer to do all coding in a report , since this means that if a report needs to be modified I don't need to make changes in the app itself and have to recompile and re distribute to clients.
    When designing layouts that seem to be difficult, i do as you have
    make a sketch of the layout decide which bands & objects to use.
    add bands to design page with 1 memo in each with some meaningful static text & back color.
    add data bands in the same fashion but do not connect to data source/set , set the record count property of the band to the num of records you think the dataset will return .
    save and preview to check the output, you can now play with record counts etc to see what happens in the output.
    FWIW i would move to fr4 as that is where further development/improvements is happening.
    Also look in the news groups there are many examples and demos in the binaries.
  • edited 5:42AM
    I keep all the reports in the EXE rather than using FR3 files. I prefer to have everything in one file if possible, and recompiling and redistributing is no problem.

    I appreciate your help and will get back to you on this if necessary. Right now I'm just scoping out what's involved in this app but it may be a while before I"m actually doing any coding.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.