The Iowa Loan & Trust Company is an Iowa corporation that since 1881 has been doing a loaning business, and issuing and selling its own obligations, called “debentures,” wherein the company promised to pay a specific sum with interest on a specified date. The debentures so sold were secured by real estate securities, in the form of notes and mortgages, which were desposited with trustees appointed by the company, in accordance with a written agreement between said company and the trustees. The agreement among other things provided: “The debentures of the said company, to be issued hereafter, shall be in series of one hundred thousand dollars each, but the several bonds composing any series may be of different denominations, as may be found convenient. Each series shall become due at a fixed date, to be expressed upon the face of the bond; but may reserve an option of payment after a date specified, before maturity, at the pleasure of said company. As security for the payment of debentures as aforesaid, the said Iowa Loan & Trust Company may, from time to time at its pleasure, set over, transfer, and assign to said trustees, real estate securities, to be held by said trustees, in trust for the benefit of the purchasers of *68said debentures; whereupon.the said trustees shall indorse their certificate of such fact -upon debentures not exceeding one thousand dollars for every one thousand and fifty dollars of securities so transferred to them. Each series of debentures shall be wholly independent of any other series, in the matter of securities, and said trustees shall not certify or countersign any debentures for which they do not hold at least five percent of securities in excess of the bonds so countersigned. It is expressly agreed that, whenever the said Iowa Loan & Trust Company shall produce and surrender any of the debentures which have been countersigned by said 'trustees, said trustees, when requested by said company so to do, shall redeliver a pro rata share of the securities pledged for the payment of said series; whereupon the debentures so surrendered shall be canceled.” The trustees are George M. Ilippee, C. A. Dudley, and J. G. Hounds. C. II. M.urrow, as treasurer of Polk County, assessed these trustees as agents and trustees for unknown owners, nonresidents of the state, on property alleged to have been omitted from assessment for the years 1903 to 1907, inclusive. The trustees appealed to the district court, and upon the trial of said appeal the treasurer filed a petition, asking that the Iowa Loan & Trust Company and its president, W. C. Coffin, and its secretary, Edwin Ilult, be required to produce in court “all books containing a registry of the debentures and names of the owners outstanding of the Iowa Loan & Trust Company for the years 1902, 1903, 1904, 1905, 1906, and 1907, and all canceled and paid debenture bonds, between the years 1898 and 1907 both inclusive.” After full argument by both sides, the court made an order requiring the company and its officers to show7 cause why the records asked for should not be produced for the inspection of the court and counsel. In this order the court said that the records appeared to be necessary and material for the purpose of determining whether the holders of the debenture bonds were residents or non*69residents of the state. Thereafter an amendment to the petition was filed, and resistance to the application was made. The matter was again fully argued, and finally, on. the 12th of November, 1908, the court made a written order finding that the treasurer was entitled to an order for the production of the records, and it was accordingly made. The Iowa Loan & Trust Company refused to comply therewith, and at once commenced this proceeding. It is, of course, not claimed that the legality of the assessment of the trustees by the treasurer can be reviewed in this proceeding.
_ i. Evidence: production of books and papers. The principal contention of the petitioners is that the residence of the owners and holders of the debenture bonds issued by the trust company is immaterial, because the holders of the debentures do not own the securities that are in the hands of the trustees for their protection. Section 4654 of the Code provides that the court may in its discretion require the production of any books or papers which are material to the just determination of any cause pending before it “for the purpose of being inspected and copied by or for the party thus calling for them.” Section 4655 requires the petition for a rule for the production of books and papers to show wherein they are material, and it further says that the rule shall thereupon be granted. The petitioners’ position is that the books and papers to be produced must be material, and the materiality thereof must be shown by the petition, and be determined by the court before an order can be made for their production. The sections of the statute under consideration authorize a rule for the production of books and papers only when it is made to appear by the petition therefor that the same are material to the just determination of the cause then pending before it. While the court is given discretion in the matter, it is the plain intent of the statute that no rule shall be granted unless it is made to appear to the court, either by *70the petition or upon a hearing where the issuance of the rule is resisted, that the books and papers are material to the issues then before the court. Beebe v. Ins. Co., 76 Iowa, 129; Sheldon v. Mickel, 40 Iowa, 19. The trial court did determine that the books of -the loan and trust company were material to the determination of the issue between the treasurer and the trustees. This is apparent from his order to show cause, from his order for their production, and from the running argument between the court and counsel on both sides while the application was being heard. The court had jurisdiction of the subject-matter and of the parties in the appeal case in which the books were wanted. The statute makes no distinction between the books and papers belonging to or' in the possession of a party to the suit and those belonging to a stranger. All are subject to the rule upon a proper showing. In ordering the books, then, the trial court was exercising a discretion given to it hy the statute under which it acted, and the order can not he reviewed by this court on certiorari.
2. Same: certiorari:. scope of review. The question presented by the writ is whether the defendant exceeded his jurisdiction, or otherwise acted illegally. If his action was merely erroneous, a writ of certiorari will not lie. The distinction be- , i i *n i tween an erroneous order and an illegal one is thus stated in Tiedt v. Garstensen, 61 Iowa, 334: “When the law prescribes proceedings to be had by an officer or tribunal in cases pending before them, the omission of such proceedings is in violation of law, and the court or officer omitting them would therefore act illegally. In a word, if a tribunal, when determining-matters before it which are within its jurisdiction, proceeds in a manner contrary to law, it acts illegally. But, if a discretion is conferred upon the inferior tribunal, its exercise can not be illegal. If it be clothed with authority to decide upon facts submitted to it, the decision is not *71illegal, whatever it may be, if the subject-matter and the parties are within its jurisdiction, for the law intrusts the decision to the discretion of the tribunal.” See, also, Wise v. Chaney, 67 Iowa, 73; Medical College Ass’n v. Schrader, 87 Iowa, 659; Voting Machine Co. v. Hobson, 132 Iowa, 38; Finn v. District Court, 145 Iowa, 157. As we have heretofore said, there was a rule to show cause, and the whole matter was argued out. The petition alleged that. the books were material, and alleged what they would prove. We think the question of their materiality was therefore sufficiently pleaded. At any rate, no objection seems to have been made to the sufficiency of the petition, nor to the time of making same. The petitioners seem to fear that the trial court will permit their records to be used for improper purposes, not connected with the determination of any issue before the court. We can not presume, and counsel are not warranted in presuming, that the trial court will permit any undue examination of or license with the books. While providing for the just determination of a cause, the court should also see that instruments of evidence are not misused.
3 Same: constitutional law: search and seizure. The constitutional guaranty against unreasonable searches and seizures is not in our judgment violated by the order. Nor will it be by an execution thereof. The provisions of the Constitution have no referenee regularly prescribed and statutory methods for obtaining evidence, and the acquiring of evidence in the statutory manner to be used in a case is not a search or seizure within the meaning of the Constitution. Cooley’s Constitutional Limitations, 364; Robinson v. Richardson, 13 Gray (Mass.) 454; In re Chapman, 166 U. S. 661 (17 Sup. Ct. 677, 41 L. Ed. 1154); Finn v. District Court, supra. While many other points are argued by the petitioners, we believe that we have discussed and determined the one vital question in the proceeding, and we need not extend this opinion by *72a discussion of questions which must necessarily arise when the case between the treasurer and the trustees is finally tried.
We. think the order of the trial judge should be affw'med and the writ dismissed.