I would like to put a color-filled frame (for example with tcolorbox package) around the caption of a longtable, which I put into \endlastfoot. I used the answer to this question: Boxed caption and figure, with colored caption for my other figures/tables, but cannot make it work in the longtable-environment. I have used the answer to this question Color a longtable to try to color the caption-multirow, but cannot make it look nice and framed.
\documentclass[a4paper, 12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,ngerman]{babel}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{5mm}
%Tabels:
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{caption}
%Adjusted Command to color the caption from https://tex.stackexchange.com/questions/345589/color-a-longtable/345602#345602
\definecolor{lightGray}{gray}{0.95}
\def\ColorTabelHeader{lightGray}
\newcommand*{\BeginHeadcolor}{%
\arrayrulecolor{gray}\toprule[0.7pt]
\rowcolor{\ColorTabelHeader}%
\noalign{%
\kern-\belowrulesep
\begingroup
\color{\ColorTabelHeader}\hrule height\belowrulesep
\endgroup
}%
}
\newcommand*{\EndHeadcolor}{%
\noalign{%
\begingroup
\color{\ColorTabelHeader}%
\hrule height\aboverulesep
\endgroup
\kern-\aboverulesep
}%
\toprule[0.7pt] \arrayrulecolor{black}
}
\makeatletter
\newcommand*{\LTBeginHeadcolor}{%
\arrayrulecolor{gray}\toprule[0.7pt]
\vadjust pre{\kern-\belowrulesep}%
\begingroup
\color{\ColorTabelHeader}%
\leaders\hrule height\belowrulesep\hfill
\endgroup
\cr
\rowcolor{\ColorTabelHeader}%
}
\newcommand*{\LTEndHeadcolor}{%
\multispan\LT@cols
\begingroup
\color{\ColorTabelHeader}%
\leaders\hrule height\aboverulesep\hfill
\endgroup
\cr
\noalign{%
\kern-\aboverulesep
}%
\toprule[0.7pt] \arrayrulecolor{black}
}
\makeatother
% Settings for Longtable
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\setlength{\LTcapwidth}{\columnwidth}
% To make it load faster
\setcounter{LTchunksize}{50}
\begin{document}
\renewcommand\arraystretch{0.8}
\begin{longtable}{c|c >{\columncolor[gray]{.9}}c c >{\columncolor[gray]{.9}}c c}
\LTBeginHeadcolor
\caption[]{\textbf{Caption:}
some information describing the content}\\
\LTEndHeadcolor \endfoot
\LTBeginHeadcolor
\caption[]{\textbf{Caption:}
this is a very long caption with some additional information regarding the parameters.\label{tab:Sample}}\\*
\rowcolor{\ColorTabelHeader}
\multicolumn{6}{c}{\parbox{\LTcapwidth}{{\footnotesize This Information is so long, that I had to put it in an extra paragraph with a smaller font}}}\\
\LTEndHeadcolor
\endlastfoot
\toprule
\multirow{2}[2]{*}[2mm]{\textbf{Parameter}} & & \textbf{BLH} & \textbf{0h} & \textbf{4h} & \textbf{8h} \\
& & Median (SD) & Median (SD) & Median (SD) & Median (SD) \\
\midrule \endfirsthead
\toprule
\multirow{2}[2]{*}[2mm]{\textbf{Parameter}} & & \textbf{BLH} & \textbf{0h} & \textbf{4h} & \textbf{8h} \\
& & Median (SD) & Median (SD) & Median (SD) & Median (SD) \\
\midrule \endhead
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
Parameter & Group1 & 1 & 2 & 3 & 4 \\*
{[unit]} & Group2 & 1 & 2 & 3 & 4 \\[0,3cm]
\bottomrule
\end{longtable}%%
\end{document}