A quilting machine (10, 100, 200, 300, 400, 500, 600) is provided with a printing station (20, 125, 225, 325, 425, 525, 611, 626, 631) and a quilting station (44, 127, 227, 327, 427, 527, 627, 632), either on the same or a different production line. Ticking is preprinted with a plurality of different patterns, organized and coordinated by the computer so that a print head can scan the material and print different patterns of different panels (32). Identifying data (40) for matching the panels of a mattress product can be provided in data files and codes can be printed on the fabric. Panels can be matched and assembled into products based on the codes, and quilting, cutting, slitting and other operations can be controlled by printed codes and other data. The quilting and combining of the panels for assembly of a mattress product can be carried out manually or automatically using the data.