Reference to documents not annexed to pleadings

We instituted a suit in one of the Courts in the city. Unfortunately, we lost the case because we were denied to refer to certain documents. According to the Court, these documents were neither mentioned nor attached in the pleadings.  We are a bit confused about this. Why did the Court deny our right to be heard?
BM, Mbeya

We are sorry to hear about your loss. Since we do not have all the facts of your case, we will confine our advice to the pleadings. In simple terms, a pleading is a formal written document that states the reasons for bringing a legal action against someone else. Pleadings are essential in a civil suit as they explain the facts of the case; the cause of action; prayers and evidence relied upon by the parties. It is a cardinal principle of pleadings that the parties to the suit should always adhere to what is contained in their pleadings unless an amendment is permitted by the Court. The rationale behind this proposition is to bring the parties to understand the issues in dispute and not to take the other party by surprise. Any party seeking to make reference to any document not pleaded and/ or annexed to the pleadings must seek  the Court’s leave to amend the pleadings so as to enable him make reference thereto. This legal position has been expounded in a number of decisions of the Court of Appeal of Tanzania and it is therefore settled law in Tanzania. You may want to ask your lawyer for further advice.