I was thinking to buy tickets from German Railways, but I have heard that the Czech Railways cannot read (scan) german tickets, is that right?
Hmmm... sounds a bit strange. If German Railways sell you ticket for certain route, as in your case Dresden-Vienna via Czech Republic, then they obviously guarantee you the actual service throughout the whole route the ticket is valid for. So there is simply no reason whatsoever why Czech conductor might question your ticket.
Anyway, we never heard about any problems of such kind. Maybe you can give a link where it was discussed/you heard it from?
As a rule, the problems with self-printed ticket might arise only if you print it in low quality, so scanner simply can't read the bar code on it, but such situation doesn't have anything in common with German railways issued tickets within Czech republic, because it is a general thing and applies to any self-printed tickets.
In this case I have to take tickets from Prague to Bratislava and from there to go by bus or by train to Vienna.
Yes, if you want to catch discounted, in your case discount is called SparNight, ticket then you need to buy ticket in advance from Czech Railways eShop (
https://www.cd.cz/eshop/international/search_int.aspx?tt=2). Input Praha-Holešovice-Bratislava-Vinohrady (R411, 22:32-6:43), same train departs from Praha main station at 00:04 and arrives to Bratislava main station at 5:40am, so you can actually get on it later and get off earlier, depends on which stations you prefer in Praha and Bratislava.
And remember, that in both case, either with German discounted tickets or Czech discounted tickets it is better to purchase them good in advance, since they are limited and might be sold out for your date if you would want to buy them like couple days before departure.