Cook the tagliatelle in salted water until al dente. Drain and set aside in the sieve.
Cut the ham into small cubes, grate the Gruyère cheese. Drain the sauerkraut.
Grease a baking dish with butter. Put half of the sauerkraut in it, half of the ham on top, then half of the pasta and half of the grated cheese. Repeat the process with the rest of the ingredients and finally pour the cream over the casserole. Bake in the preheated oven on the middle rack at 200 degrees for about 30 minutes. Serve fresh from the pipe.