A good easy way of removing tree sap off your windshield is to use some nail polish remover applied to the windshield.
Take a rag and dip it in some nail polish remover and then scrub the tree sap off the windshield and the nail polish remover should easily remove the tree sap from the windshield.
You can also use some rubbing alcohol to help remove the tree sap from your windshield however do not use the rubbing alcohol on your cars paint otherwise it can strip the paint away from your car.
But the rubbing alcohol or nail polish remover will remove the tree sap from the windshield.
Parking your car or vehicle under a tree helps give shade but the tree sap is usually not worth it or you could cover your windshield up with something to prevent the tree sap from getting onto the windshield.