Search code examples
crystal-reportscrystal-reports-2008crystal-reports-2010crystal-reports-2011

How does one dynamically take values from a Group, add it to an Array, and then print individual values in the Page Footer?


I have a report file, where the report provides information on a "Job" - so this is a "Job Ticket" report. Inside the Job Ticket, there is a group with details that provides information on individual "Components" of which there can be anywhere from 1 Component to 6 Components in any given Job. There is a field applied to each component which is a string and is the "ComponentType" ({sp_JobTicket.ComponentType}).

What I would like to do is put the value of each row of ComponentType into an Array, which I can then call in the Page Footer (i.e., so I can create a Text Object and in it call a value using something like "TypeforComponent[3]"), so even though every printed page will only show the full details of one component, the page footer for each page will provide an at-a-glance view of all the components and their types.

As it is right now, we just hand write the component types for all components on the printed page itself, but we can access the ComponentType through the database, so it seems like we should be able to get it to print on the report.

ComponentType List Printed in the Page Footer

Here is a full page preview of of a printed Job Ticket report that has 4 components (so in the Page Footer only 1-4 would have a value, 5-6 are empty), and where everything is currently laid out, and where we're hoping to get things placed: Full Report Preview


Solution

  • So it looks like the simpler and more straight-forward solution to my problem was to not use an Array, but to create a Subreport.

    Subreport

    I accomplished this by creating a new report, linked it to the stored procedure used by my Job Ticket (main) report, and imported the data fields I needed. I then proceeded to change the Page Size for the subreport to fit into the size on the page (1.5" x 1"), set the Details section to "Format with Multiple Columns" in the section expert which made available a new "Layout Tab" which I entered and selected "Format Groups with multiple column[s]." Then I saved that as a separate file and imported that report into my main report as a Subreport. Finally I set the Subreport Links to link to my "JobNumber" field which my main ticket uses as a parameter and that Field to the parameter.

    Setting Subreport Links

    Completed Successfully: Completed Successful Report