Assume that samples of a filtered version of a function in a shift-invariant space are avalaible. This work deals with the existence of a sampling formula involving these samples and having reconstruction functions with compact support. Thus, low computational complexity is involved and truncation errors are avoided. This is done in the light of the generalized sampling theory by using the oversampling technique: more samples than strictly necessary are used. For a suitable choice of the sampling period, a necessary and sufficient condition is given in terms of the Kronecker canonical form of a matrix pencil. Comparing with other characterizations in the mathematical literature, the given here has an important advantage: it can be reliable computed by using the GUPTRI form of the matrix pencil. Finally, a practical method for computing the compactly supported reconstruction functions is given for the important case where the oversampling rate is minimum.