the only way to travel from Cartagena to Panama by boat is via an organized tour company such as Gypsy Moth or Mamallena Tours. The trip takes normally 3 days and it's not cheap (around $500 depending on the boat) considering a one way flight is around $400, and thats for a 1 hour flight! Sailing to San Blas from Cartagena over 5-6 days just seems like a better deal!
My tip is to research before booking a boat. Try booking a bigger, newer catamaran boat like the Sailing Koala or Darien Gapster because it will make the open water crossing easier without feeling sea sick, plus they come with hot showers.
I remember doing this trip years ago, though I did it from Panama to Cartagena and the trip is not direct. The trip took 5 days and I sailed the entire group of islands and finish in the Colombian town of Sapzurro. From there I had to take a boat to Carpurgana, then a speedboat to Turbo and then a bus to Cartagena.