Sideways picture shown on wrong page

My picture and my section won't be on the same page. I have tried the float package with [H] and [!] and so on but it won't work

\documentclass[a4paper]{report}
\usepackage{float}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{pdflscape}
\usepackage{mwe}

\begin{document}
\newpage

\appendix

\section{LabVIEW-kod}
\begin{sidewaysfigure}[h]
\includegraphics[height=0.3\textheight]{lab_12.png}
\caption{}
\end{sidewaysfigure}
\end{document}


Note from editor

Added packages rotating and pdflscape as I found here to recover from environment sidewaysfigure undefined, and of course I have gotten a file not found error, so I looked for how to use example images, and I found this, and therefore added mwe and used the examples. Here is the resulting output:

(p. 1)

(p. 2)

• @ArunDebray Isn't this question asking the opposite i.e. how to put it on the current page rather than a new one? – cfr Jan 27 '16 at 23:07
• @cfr: thank you; that was my mistake. I've retracted my vote. (It's still likely that this has been asked before, though.) – Arun Debray Jan 27 '16 at 23:11
• @ArunDebray I agree, but it needs to be marked as a duplicate of a question which asks the same thing ;). – cfr Jan 27 '16 at 23:13
• @cfr I have searched for an answer but didn't find one that said something that helped. The response is often use \usepackage{float} and use [H] But it doesn't work. – rikard Jan 27 '16 at 23:31
• Perhaps it is just too large for the space? That is the most common reason, I think. – cfr Jan 27 '16 at 23:44

You cannot mix some text (section title) and sidewaysfigure on the same page. In your case, if the image is shorter than rest of vertical place on the page and you like to have both on the same page, just can rotate only image:

\documentclass[a4paper]{report}
%\usepackage{float}
\usepackage[margin=25mm,showframe]{geometry}
%\usepackage{rotating}
%\usepackage{pdflscape}
\usepackage{mwe}

\begin{document}

\appendix
\section{LabVIEW-kod}
\begin{figure}[h]
\centering
\rotatebox{90}{\includegraphics[height=0.85\textwidth]{example-image}}
\caption{}