
536 N.W.2d 68 (1995)
3 Neb.App. 940
John JESSEN, and all Taxpayers of the City of Bloomfield, State of Nebraska, Similarly Situated, Appellant,
v.
Lyle A. DeFORD et al., Appellees.
No. A-93-900.
Court of Appeals of Nebraska.
August 22, 1995.
*71 Vince Kirby, Norfolk, for appellant.
Daniel D. Jewell, and, on brief, J. Mark Barnett, of Jewell, Gatz, Collins, Fitzgerald & DeLay, Norfolk, for appellees.
HANNON, IRWIN, and MUES, JJ.
MUES, Judge.
This is an appeal from the decision of the Knox County District Court sustaining defendants' individual motions to dismiss plaintiff's petition with prejudice at the close of plaintiff's case. Plaintiff-appellant is John Jessen, a resident taxpayer and property owner in the city of Bloomfield, Knox County, Nebraska. Defendants-appellees are the mayor of Bloomfield, Lyle A. DeFord; the individual members of the city council, Don Eggen, Harry Sage, Jr., Kenneth Carlow, and Douglas Hefner; the city treasurer, Ryan Bloomquist; and the city clerk, Gerald L. Clausen. For the following reasons, we affirm.

I. BACKGROUND
On August 7, 1991, Jessen filed a petition on behalf of all taxpayers of the city of Bloomfield to recover approximately $300,000, alleging that defendants illegally diverted public funds to pay for a sidewalk improvement project in downtown Bloomfield and neglected to follow statutory procedure. Each defendant demurred to the petition on the grounds that the petition failed to state a cause of action and that there was a defect of parties' defendant and amended the demurrer to include the allegation that Jessen did not have legal capacity to sue. The district court overruled the amended demurrers, specifically finding that the action was derivative in nature, that the petition stated facts sufficient to state a cause of action, that there was no defect of parties' defendant, and that plaintiff had legal capacity to sue. Each defendant then filed answers, which were amended prior to trial. The original and amended answers each contained, inter alia, *72 a general allegation that the petition failed to state a cause of action against the answering defendant.
A pretrial conference was scheduled for December 7, 1992. It was canceled upon the appearance of Jessen's and defendants' counsel who advised the court that such conference would be unnecessary in that each had agreed to timely exchange lists of witnesses and evidence. No subsequent request for a pretrial conference was made by either Jessen or defendants. The record contains no pretrial order.
On August 17, 1993, the case was tried to the court, a jury having been waived. At the commencement of the trial, defendants objected to Jessen's introduction of evidence of an illegal and unauthorized transfer of money, basing the objection on the grounds that the petition failed to state a cause of action. The court overruled the objection but granted defendants' continuing objection on the basis of relevancy to the admission of all evidence offered by Jessen. Jessen then put on his case and rested.
At the close of Jessen's evidence, each defendant moved for a dismissal of Jessen's petition with prejudice on the grounds that Jessen failed to allege and prove a demand upon the city of Bloomfield to commence the action and to allege and prove a refusal by the city to bring the action, or show facts that such a demand was useless; that the proceeding constituted a collateral attack and the proper remedy was a petition in error; and that the evidence was insufficient to support the cause of action. One defendant, Bloomquist, moved to dismiss with prejudice on the additional ground that the evidence was generally insufficient that Bloomquist conspired or acted in any illegal or improper manner.
The court sustained the motions to dismiss with prejudice, finding that Jessen failed to allege or prove any special injury and that the action was derivative in nature, being brought on behalf of all taxpayers. The court recognized that as a derivative action, it was necessary for Jessen to prove a demand made upon the city to bring the action itself and a refusal by the city to do so, or to offer proof that such a demand was useless. In sustaining the motion and dismissing Jessen's petition with prejudice, the court noted that there had "been no allegation in the petition that demand was made upon the city to bring the action, nor ha[d] there been any allegation in the petition that such demand would be useless." The court further found that there had "been no proof offered by the plaintiff that demand was made upon the city nor that demand would be useless."
On August 19, 1993, Jessen filed a "Motion to Amend or, in the Alternative, a Motion for New Trial." The "Motion to Amend" seeks an order granting Jessen leave to withdraw his rest for purposes of amending his petition to allege that demand would have been useless because defendants would have had to take action against themselves and to allege that he suffered special damages. The "Motion for New Trial" alleged several grounds, all of which are repeated, verbatim, as his assignments of error to this court. The motion was overruled. In overruling the motion, the court found that in addition to the failure of proof on the "demand" issue, it had reviewed all the evidence and concluded that Jessen had failed to prove a prima facie case, specifically noting that there was "no evidence of improper conduct" by defendants. This appeal followed.

II. ASSIGNMENTS OF ERROR
Jessen alleges the district court erred in (1) dismissing his petition at the close of his evidence "`with prejudice' on the basis of the lack of an essential jurisdictional allegation"; (2) dismissing his petition at the close of his evidence with prejudice, denying him the opportunity to withdraw his rest to amend his petition and offer additional proof; (3) failing to sustain defendants' demurrer initially and at the beginning of his case in chief; (4) failing to hold a pretrial conference; (5) "allowing counsel to sit by idly and then, for the first time, to move for dismissal at the close of plaintiff's case"; and (6) reversing the court's position on defendants' demurrer at the end of Jessen's case without granting him leave to amend.

III. STANDARD OF REVIEW
In a court's review of evidence on a motion to dismiss, the nonmoving party is *73 entitled to have every controverted fact resolved in his favor and to have the benefit of every inference which can be reasonably drawn therefrom, and where the plaintiff's evidence meets the burden of proof required and the plaintiff has made a prima facie case, the motion to dismiss should be overruled. Knaub v. Knaub, 245 Neb. 172, 512 N.W.2d 124 (1994).

IV. ANALYSIS

1. DISMISSAL WITH PREJUDICE
Jessen brings this action as a resident taxpayer on behalf of himself and other taxpayers in the city of Bloomfield. Jessen pled no special injury peculiar to himself. The district judge, in overruling defendants' demurrers, determined that Jessen's action was a suit on behalf of all taxpayers. Jessen did not thereafter seek to amend his petition to otherwise challenge that order. Although Jessen seeks money, not injunctive relief, neither party challenges the order defining the nature of this suit. Therefore, we express no opinion in that regard. Moreover, defendants do not challenge Jessen's status as a resident taxpayer.
A resident taxpayer, without showing any interest or injury peculiar to himself or herself, may bring an action to enjoin the illegal expenditure of public funds raised for governmental purposes. Professional Firefighters of Omaha v. City of Omaha, 243 Neb. 166, 498 N.W.2d 325 (1993); Nebraska Sch. Dist. No. 148 v. Lincoln Airport Auth., 220 Neb. 504, 371 N.W.2d 258 (1985). A taxpayer, for the benefit of a municipal or public corporation, may commence and prosecute to judgment an equitable action to enforce a right of action which the governing body has refused to enforce. Taxpayers' League v. Wightman, 139 Neb. 212, 296 N.W. 886 (1941). "To plead a resident taxpayer's action the plaintiff must allege a demand made upon the municipal or public corporation and a refusal by the corporation to bring the action itself, or facts which show that such a demand would be useless." Nebraska Sch. Dist. No. 148, 220 Neb. at 508, 371 N.W.2d at 261-62 (citing Sesemann v. Howell, 195 Neb. 798, 241 N.W.2d 119 (1976)).
Jessen's first assignment of error alleges that the district court erroneously dismissed his petition because it lacked "an essential jurisdictional allegation." That is not the basis upon which the district court dismissed Jessen's petition. While it is true that Jessen did not allege in his petition that a demand had been made on the city or that a demand would have been useless, the district court dismissed the petition, having found that Jessen failed to prove either of those necessary elements, not that he failed to plead them. Our review of the record confirms that omission of proof.
Jessen argues that because he has alleged that defendants were, at all times material, the entire governing body of the city and that each defendant is accused of making specific illegal expenditures, that "it is reasonably inferred that demand from the alleged wrongdoers would be obviously useless inasmuch as it would be untenable that the defendants would sue themselves." Brief for appellant at 8. Jessen points to no evidence other than the status of the named defendants and their resistance to the suit to support his contention that proof of demand was unnecessary. It is true that the authorities cited above provide that if the making of a demand would have been useless, the failure to prove such a demand is unnecessary. In Wightman, supra, the city of Wayne was joined as a party defendant. The city answered and resisted the plaintiffs' taxpayer suit. The Supreme Court, although finding no specific proof of a refusal of the city to join in the suit, observed that its answer and its resistance were sufficient to show such refusal and that a "demand would have been an idle ceremony." Id. at 219, 296 N.W. at 887. But see Lake v. Piper, Jaffray & Hopwood Inc., 212 Neb. 570, 324 N.W.2d 660 (1982) (public corporation's demurrer to prior lawsuit held insufficient to waive necessity to prove prior demand).
The facts of Wightman, supra, are not the facts here. Jessen has not sued the city of Bloomfield. It is not a party to these proceedings. The essence of Jessen's cause of action is that it is for the benefit of the city and a precondition to that cause of action in that the city has refused to enforce its own *74 rights. The named individual defendants were the governing body of the city of Bloomfield at some point in time, but there is no evidence that they still enjoyed that status at the time the suit was filed in August 1991 or at the time one or more demurred, answered, or testified at trial. In fact, the evidence shows that as of August 19, 1991, only two of the seven named defendants, Carlow and Clausen, were still members of the governing body of the city of Bloomfield. The fact that the individual defendants resisted Jessen's suit, therefore, was not the resistance of the city and does not lead to the conclusion that a demand on the city would have been useless. The resistance does not, as was the case in Wightman, relieve Jessen of proving that the appropriate governing body of the city of Bloomfield had refused to enforce the rights which Jessen had then asserted on the city's behalf in this suit.
"`Public officers are always presumed, in the absence of any showing to the contrary, to be ready and willing to perform their duty; and until it is made to appear that they have refused to do so, or have neglected to act under circumstances rendering this equivalent to a refusal, there is no occasion for the intervention of the citizen for the protection of himself and others similarly situated.'"...
... In order for the plaintiff to rebut this presumption, he must first allege and prove that [the municipal or public corporation] had done something wrong, that it was pointed out to [the municipal or public corporation], and that it would have rejected his demand.
Piper, Jaffray & Hopwood Inc., 212 Neb. at 576, 324 N.W.2d at 663.
It was Jessen's burden to adduce evidence to rebut the presumption that the appropriate governing body of the city of Bloomfield was ready and willing to perform its duty with regard to the rights of the city as alleged in his petition. There is evidence in the record that the governing body of the city was aware that the suit was filed and in fact authorized the hiring of counsel for the individual defendants at the city's cost. That body did not seek intervention by the city in the suit to either join with, or resist, Jessen's suit. However, we cannot conclusively infer from such inaction that the city chose to ignore its rights and those of its taxpayers. Indeed, the fallacy of such an inference becomes at once apparent when one reads the allegations of the amended answer, filed by the individual defendants, that the city, after suit was filed by Jessen, took action to address the alleged misdoings of the individual defendants. Whether true or not, those allegations evidence that more than one reasonable explanation can be made of the city's failure to join this proceeding. Jessen's petition was properly dismissed at the close of his case in chief because he failed to prove that the city refused to enforce its right of action or that a demand on the city to enforce such right would have been an "idle ceremony."

2. LEAVE TO WITHDRAW REST
Jessen's remaining assignments of error combine in support of one contention  the district court abused its discretion in not allowing Jessen to withdraw his rest, amend his petition, and offer new evidence on the "demand" element of his case. Upon the sustaining of a demurrer, the court must grant leave to amend the petition unless it is clear that no reasonable possibility exists that amendments will correct the defect. See Dalition v. Langemeier, 246 Neb. 993, 524 N.W.2d 336 (1994). However, "[i]f a motion to dismiss is sustained, the case ends," (emphasis supplied) Anderson v. Matthis, 246 Neb. 215, 219, 518 N.W.2d 94, 97 (1994), and "[a]ny amendment thereafter is a judicial grace and not a right," Reller v. Ankeny, 160 Neb. 47, 50, 68 N.W.2d 686, 688 (1955).
Jessen relies exclusively upon Newman Grove Creamery Co. v. Deaver, 208 Neb. 178, 302 N.W.2d 697 (1981), in support of all his arguments on appeal. In Deaver, the plaintiff brought suit on a promissory note, and in the answer, the defendants alleged duress as an affirmative defense. The plaintiff first challenged the sufficiency of that defense after he rested, demurring ore tenus on the grounds that the answer failed to state facts which constituted duress. A pretrial order entered in the case required that all motions be filed 10 days before the trial. In overruling *75 the sustainment of the demurrer, the Supreme Court found that "[t]he defect in the answer did not affect the substantial rights of the plaintiff and the objection, coming when it did, should have been disregarded." Id. at 183, 302 N.W.2d at 701. The court found that the plaintiff should have addressed the claim of duress by motion or a demurrer timely filed. Deaver is clearly distinguishable from the action before us in that the present action involves a motion to dismiss, rather than demurrer; here no pretrial order restricting motions had been entered; and defendants repeatedly challenged the sufficiency of the petition starting with a demurrer, continuing the objection by answer, and objecting at the commencement of Jessen's evidence. Jessen's reliance on Deaver is misplaced.
The reopening of a case to receive additional evidence is a matter within the discretion of the district court and will not be disturbed on appeal in the absence of an abuse of that discretion. See Corman v. Musselman, 232 Neb. 159, 439 N.W.2d 781 (1989). Among factors traditionally considered in determining whether to allow a party to reopen a case to introduce additional evidence are (1) the reason for the failure to introduce the evidence, i.e., counsel's inadvertence, a party's calculated risk or tactic, or the court's mistake; (2) the admissibility and materiality of the new evidence to the proponent's case; (3) the diligence exercised by the requesting party in producing the evidence before his or her case closed; (4) the time or stage of the proceedings at which the motion is made; and (5) whether the new evidence would unfairly surprise or unfairly prejudice the opponent. 75 Am.Jur.2d Trial § 382 (1991).

(a) Reason for Failure to Introduce Evidence
A common theme throughout Jessen's arguments is the notion that he was deceived or tricked by the pretrial proceedings into not offering proof of demand or its uselessness and that he was surprised by being faced at trial with motions to dismiss on the grounds that he failed to allege and prove that element of his case. Although it is difficult to reconcile this position with Jessen's argument at trial and before us that he had sufficiently proved this element, we will address it in the interest of fully answering the issues raised.
First, Jessen asserts that the district court erred in failing to sustain defendants' demurrers and in reversing its position on defendants' demurrers. We understand this as contending that Jessen relied upon the district court's action in this regard and that he was somehow lulled into a false sense of security in his belief that his petition contained all allegations necessary to a cause of action. This argument distorts the office of a demurrer.
Upon demurrer, the petition is to be construed liberally in determining whether it states a cause of action and the demurrer should be overruled if as so construed the petition states a cause of action. S.I. v. Cutler, 246 Neb. 739, 523 N.W.2d 242 (1994); Gibb v. Citicorp Mortgage, Inc., 246 Neb. 355, 518 N.W.2d 910 (1994). A motion to dismiss is properly sustained if the nonmoving party has failed to prove his or her prima facie case even when every controverted fact is resolved in his or her favor and when given the benefit of every reasonable inference. See Knaub v. Knaub, 245 Neb. 172, 512 N.W.2d 124 (1994).
In denying defendants' demurrer, the trial court obviously construed the petition liberally and gave Jessen the benefit of the doubt. This did not relieve Jessen of offering evidence at trial to support a prima facie case. Faced with a motion to dismiss and lack of proof on an essential element of Jessen's prima facie case after he had rested his case in chief, the court had no option but to sustain the motion to dismiss. Jessen's argument, logically extended, is that having liberally construed his petition and saved it from amendment on defendants' initial demurrers, the court was compelled to overrule a motion to dismiss even though proof on a necessary element was lacking. That argument has no merit. A demurrer and a motion to dismiss are two distinct procedures. See Anderson v. Matthis, 246 Neb. 215, 518 N.W.2d 94 (1994).
*76 Second, Jessen contends that the district court erred in failing to hold a pretrial conference. We understand this to simply argue that because there was no pretrial, there was no disclosure of issues and he was surprised by the issue of demand at trial. The record indicates that the pretrial conference was scheduled by the court, but waived upon the mutual agreement of counsel for both parties. No subsequent request for a pretrial conference is contained in the record. A party cannot complain of error which the party has invited the court to commit. Terry v. Duff, 246 Neb. 524, 519 N.W.2d 550 (1994); Norwest Bank Neb. v. Bowers, 246 Neb. 83, 516 N.W.2d 623 (1994).
Third, Jessen argues that defendants sat "by idly, and then, for the first time, [moved] for dismissal at the close of plaintiff's case." This contention hardly justifies comment. Defendants' pleadings consistently maintained that Jessen's petition failed to state a cause of action. Moreover, by demurring ore tenus at the beginning of Jessen's case in chief, they continued to voice that objection. It is true that the answers did not specify in exactly what way the petition was defective in stating a cause of action. Yet there is no indication that Jessen sought such specificity in the pleading, discovery, or pretrial stages of this proceeding. Moreover, at trial, when defendants attempted to explain the basis for their continuing objection, Jessen's counsel objected to such explanation and Jessen's objection was sustained.
Underlying Jessen's arguments is the notion that the trial judge or defense counsel had some duty to ensure that Jessen was aware of the essential elements required to establish his prima facie case. Jessen directs us to no authority to support such a view. The adversarial nature of our system of justice defies that proposition.

(b) Admissibility and Materiality of New Evidence
In Jessen's motion following the district court's order of dismissal, Jessen submitted no proposed amended petition and offered no proof of what evidence he would expect to adduce if allowed the opportunity to withdraw his rest, amend his petition, and present additional evidence. He points to no such evidence on appeal. Therefore, we have no basis for determining the admissibility or materiality of the new evidence he sought to adduce, nor did the district court. Jessen has abandoned on appeal any suggestion that he suffered special damages such that the nature of his suit was personal rather than derivative. He has never argued that there is evidence that a demand was made to the city itself to prove the suit. Presumably, Jessen would attempt to prove that demand was useless, but the new evidence he proposes in that regard is not before us, nor was it ever before the district court.

(c) Diligence Exercised and Timing of Motion
Jessen did not seek leave to withdraw his rest and to move for leave to amend, upon learning the basis for defendants' motions to dismiss. Instead, Jessen submitted the case to the court on the facts before it, arguing that the facts proved a demand would be useless. It was not until 2 days after the court's adverse judgment that Jessen filed his motion seeking leave to withdraw his rest to amend his petition and present additional evidence. One cannot silently tolerate error, gamble on a favorable result, and then complain that one guessed wrong. Lincoln Branch, Inc. v. City of Lincoln, 245 Neb. 272, 512 N.W.2d 379 (1994); Wolfe v. Abraham, 244 Neb. 337, 506 N.W.2d 692 (1993). Jessen's current position is inconsistent with that which he maintained at trial. Jessen submitted the issue on the facts and pleadings before the court, and only upon an adverse ruling did he seek the opportunity to withdraw his rest, amend his petition, and try again.
"If a trial court feels that there has been a failure to introduce available evidence upon a material issue in the case of such a nature that in its absence there is serious danger of a miscarriage of justice, it may properly permit that evidence to be introduced...." 75 Am.Jur.2d Trial § 386 (1991). In overruling Jessen's "Motion to Amend or, in the Alternative, a Motion for New Trial," upon a review of all the evidence, the district court concluded that Jessen failed *77 to prove a prima facie case, not only because of the failure of proof on the "demand" issue, but the court also specifically noted that there was "no evidence of improper conduct" by defendants. Thus, the court obviously concluded that even had Jessen proved the "demand" element of his case, the evidence was insufficient to support a verdict in Jessen's favor. There was no "serious danger of a miscarriage of justice" requiring the reopening of the case to allow admission of additional evidence on the demand issue.

(d) Unfair Surprise and Prejudice to Opponent
We presume that defendants were prepared to meet the demand issue in their case in chief. However, having nothing before us to indicate precisely the type of evidence Jessen would have introduced had he been allowed to reopen his case, we are unable to determine whether that evidence would have unfairly surprised or prejudiced defendants. Jessen sought the reopening of his case. It was his burden to advise the court of what he wanted to offer.
Considering all the factors enunciated and examined above, the district court did not abuse its discretion in denying Jessen's request to withdraw his rest after judgment had been rendered. See Corman v. Musselman, 232 Neb. 159, 439 N.W.2d 781 (1989).

3. MOTION FOR NEW TRIAL
Although Jessen has not assigned the denial of his motion for new trial as an error on this appeal, we observe that if an appellant has assigned errors properly presented in a motion for new trial, then the appellant need not also assign as error the overruling of the motion for new trial. Welch v. Welch, 246 Neb. 435, 519 N.W.2d 262 (1994). A district court's denial of a motion for new trial will be affirmed when the court's decision is neither erroneously prejudicial nor an abuse of discretion. Robison v. Madsen, 246 Neb. 22, 516 N.W.2d 594 (1994); Goeke v. National Farms, Inc., 245 Neb. 262, 512 N.W.2d 626 (1994); Kopecky v. National Farms, Inc., 244 Neb. 846, 510 N.W.2d 41 (1994). Based upon our above discussion of the issues raised by Jessen's motion for new trial, we conclude that the district court did not abuse its discretion in denying Jessen's motion for a new trial.

V. CONCLUSION
Because Jessen failed to offer proof on an essential element of his cause of action, the district court properly sustained defendants' motion to dismiss. We find no abuse of discretion in the district court's denial of Jessen's request to withdraw his rest to amend his petition and adduce further evidence or in the denial of his motion for a new trial. The judgment of the district court is affirmed in all respects.
AFFIRMED.
