From
《史记·李将军列传》:
大将军使长史急责广之幕府对簿 - General Wei Qing sends an aide to summon Li Guang to respond to charges on the written dossier (
簿). The original
对簿 meant 'to answer to the document';
公堂 was added later, when the idea settled into 'facing each other in court.'