The LCD screen connector may not be fully connected. It's possible for this to happen during normal use, but it usually happens right after doing a repair on the tablet. The only way to fix this is to take the tablet apart and push the LCD screen connector all the way into the port. Follow the Battery Replacement guide until you get the tablet's back cover off - there's no need to remove the battery. Then remove and re-insert the LCD screen connector, making sure to push it in all the way. Then replace the back cover of the tablet.
Even when you restart the tablet, some settings can remain in the system. To enable screen rotation, access the notification curtain by swiping down from the top of the screen. Touch the screen rotation icon, which looks like a lock encircled by arrows. This will unlock screen rotation and allow the screen to rotate when the tablet rotates. If that does not work, the accelerometer (the interior device that recognizes movement) may be defective. In this case the motherboard will have to be replaced since the accelerometer is embedded in the main circuitry of the tablet. Using the motherboard replacement repair guide for the HP Slate 7, you can see how to replace the motherboard and get your screen functioning properly again.