
819 N.E.2d 1205 (2004)
353 Ill. App.3d 830
289 Ill.Dec. 405
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Chayse R. KELLER, Defendant-Appellant.
No. 2-03-0820.
Appellate Court of Illinois, Second District.
December 3, 2004.
Rehearing Denied January 5, 2005.
*1206 G. Joseph Weller, Deputy Defender and Kim M. DeWitt (court-appointed), office of the state appellate defendEr, elgin, for chaysE R. Keller.
Paul A. Logli, Winnebago County State's Attorney, Rockford, Martin P. Moltz, Deputy Director, Mary Beth Burns, State's Attorneys Appellate Prosecutor, Elgin, for the People.
Justice CALLUM delivered the opinion of the court:
Defendant, Chayse R. Keller, appeals from the dismissal of his "Petition for Declaratory Judgment." He asked the trial court to find that the Department of Corrections was misapplying the mandatory supervised release (MSR) provision of the Unified Code of Corrections (730 ILCS 5/5-8-1(d) (West 2000)) in interpreting his sentence. He now asserts that the court erred in dismissing his petition summarily pursuant to section 122-2.1 of the Post-Conviction Hearing Act (Act) (725 ILCS 5/122-2.1 (West 2002)). Because the "Petition" was, in substance as well as in form, a complaint for declaratory judgment, the court erred in reconstruing it as a postconviction petition and in using the procedures of section 122-2.1 of the Act to dismiss it. We vacate the dismissal and remand for further proceedings on defendant's petition.

BACKGROUND
Defendant was charged by indictment with one count of armed robbery while armed with a firearm (720 ILCS 5/18-2(a)(2) (West 2000)). He pleaded guilty pursuant to a fully negotiated plea agreement *1207 in which the State agreed to amend the indictment to allege that defendant was armed with a dangerous weapon and to recommend a sentence of 12 years' imprisonment. Before accepting the plea, the court admonished defendant that, under the amended indictment, the sentencing range would be 6 to 30 years' imprisonment, whereas under the original indictment, both the maximum and minimum would be 15 years higher. It also asked defendant if he understood that "on a sentence to the Department of Corrections you would also serve 3 years of mandatory supervised release." Defendant stated that he understood, and the court accepted the plea. The court sentenced defendant to 12 years' imprisonment.
On May 2, 2003, defendant filed a document entitled "Petition for Declaratory Judgment." He named the warden of the Dixon Correctional Center, the chairman of the Prisoner Review Board, and the Director of Corrections as respondents, and asked the court to "find that respondents[] are misapplying the MSR statute contrary to legislative intent." He contended that "the sentencing judge must have intended that any imposition of MSR would be inclusive within petitione[r]'s sentence." (Emphasis in original.) The respondents interpreted his sentence to require him to serve his term of MSR after he completes his term of imprisonment, and their "misapplication and Administrative imposition of the 3 year term of MSR attached to the end of his judicially imposed sentence has effectively increased his sentence without due process of law." (Emphasis in original.) Defendant also contended that the Unified Code of Corrections' delegation to the Prisoner Review Board of the power to reimprison defendants who violate the terms of their MSR is unconstitutional. The latter contention seems to be a matter of pleading in the alternative: "Fundamental Fairness should apply and [the court should] either rule section 5-8-1(d) of the Unified Code of Corrections unconstitutional or have the petitioner's sentence modified [so that his term of MSR is included within his term of imprisonment, rather than added to the end of it]."
The court summarily dismissed the petition pursuant to section 122-2.1 of the Act. Defendant appeals, contending that the dismissal was procedurally improper under the Code of Civil Procedure (Code) (735 ILCS 5/1-101 et seq. (West 2002)).

ANALYSIS
Whether the trial court followed the proper procedure in dismissing defendant's pleading is an issue of law, and therefore our review is de novo. See Woods v. Cole, 181 Ill.2d 512, 516, 230 Ill.Dec. 204, 693 N.E.2d 333 (1998).

Propriety of the Recharacterization as a Postconviction Petition
To determine what procedure the court should have applied to defendant's pleading, we must first determine how the court should have classified it. The State cites People v. Helgesen, 347 Ill.App.3d 672, 677, 283 Ill.Dec. 113, 807 N.E.2d 718 (2004), for the proposition that the substance of a pleading, not its title, should determine its classification. It argues that defendant's pleading is in substance a postconviction petition and that the court was right to treat it as such. We disagree. We need not address the finer points of when the substance of a pleading justifies its reclassification as a postconviction petition: defendant's pleading conforms in substance to the requirements for a complaint for declaratory judgment far better than it does to those for a postconviction petition. The core contention of defendant's pleading is that the Department of *1208 Corrections has misinterpreted his sentence. Were this so, the remedy would not be under the Act. The Act provides a vehicle for a prisoner's claim "that in the proceedings which resulted in his or her conviction there was a substantial denial of his or her rights under [the United States or Illinois Constitution]." (Emphasis added.) 725 ILCS 5/ 122-1(a) (West 2002). Defendant's primary claim is not cognizable under the Act because it does not relate to any flaw in the proceedings before his conviction. However, the "essential requirements of a declaratory judgment action are: (1) a plaintiff with a legal tangible interest; (2) a defendant having an opposing interest; and (3) an actual controversy between the parties concerning such interests." Beahringer v. Page, 204 Ill.2d 363, 372, 273 Ill.Dec. 784, 789 N.E.2d 1216 (2003); see 735 ILCS 5/2-701(a) (West 2002) ("the court may, in cases of actual controversy, make binding declarations of rights, * * * including the determination * * * of the construction of any statute"). Both defendant's primary claim and his secondary claim, regarding the constitutionality of section 5-8-1(d) of the Unified Code of Corrections, are cognizable in an action for declaratory judgment. Thus, the substance of the pleading matches its form, and the trial court erred in recharacterizing it as a postconviction petition.

Propriety of Summary Dismissal
Because the court should have treated defendant's pleading as a complaint for declaratory judgment, an action under the Code, the issue presented here is similar to those we considered in People v. Marino, 349 Ill.App.3d 197, 285 Ill.Dec. 466, 812 N.E.2d 55 (2004), People v. Winfrey, 347 Ill.App.3d 987, 283 Ill.Dec. 623, 808 N.E.2d 589 (2004), and People v. Pearson, 345 Ill.App.3d 191, 280 Ill.Dec. 461, 802 N.E.2d 386 (2003). In those cases, we held that, unlike the Act, the Code does not allow for a trial court to dismiss a proceeding on its merits sua sponte and without giving the petitioner notice of the impending dismissal and an opportunity to be heard on the issues upon which the court would base the dismissal. Marino, 349 Ill.App.3d at 200, 285 Ill.Dec. 466, 812 N.E.2d 55; Winfrey, 347 Ill.App.3d at 989, 283 Ill.Dec. 623, 808 N.E.2d 589; Pearson, 345 Ill.App.3d at 194-95, 280 Ill.Dec. 461, 802 N.E.2d 386; see also People v. Shellstrom, 345 Ill.App.3d 175, 177, 280 Ill.Dec. 456, 802 N.E.2d 381 (2003) (applying portions of the Code specific to mandamus actions). The reasoning in those cases applies here as well. An action for declaratory judgment is simply a form of civil action for which the Code explicitly provides. 735 ILCS 5/2-701 (West 2002). The only procedural provision specific to the declaratory judgment law is that "if a declaration of rights is the only relief asked, the case may be set for early hearing as in the case of a motion." 735 ILCS 5/2-701(b) (West 2002). Although this provision obviously contemplates a prompt resolution of cases that raise only issues of law, it does not authorize summary dismissal.

Due Process Considerations and Summary Dismissal
Our reasoning here and in Marino, Winfrey, Pearson, and Shellstrom is in harmony with the proposition that summary dismissal under the Act is consistent with the provision of due process to those who file petitions invoking the Act. Notice of a proposed dismissal and an opportunity to respond are requirements under the Code, but are not, in a proper framework, invariable requirements for due process (see State ex rel. Schatz v. McCaughtry, 263 Wis.2d 83, 94, 664 N.W.2d 596, 602 (2003)). Summary dismissal is acceptable *1209 within the Act, where a defendant has advance notice that it is a possibility, but not in other settings.
Summary dismissal provides due process in a framework that makes it fair. See Schatz, 263 Wis.2d at 94, 664 N.W.2d at 602; 5A C. Wright & A. Miller, Federal Practice and Procedure § 1357, at 301-02 (2d ed.1990). Wisconsin has in effect the Prisoner Litigation Reform Act, which allows a court to sua sponte dismiss any pleading filed by a prisoner. Wis. Stat. § 802.05(3) (1999-2000). In Schatz, a prisoner whose suit was dismissed sua sponte and without notice or an opportunity to respond claimed that this violated his right to due process. The Wisconsin Supreme Court found that section 802.05(3), which clearly provides for sua sponte dismissal, gave the prisoner adequate warning that he or she may not receive notice until the court has dismissed the pleading.
Similarly, section 122-2.1 of the Act clearly states that the court shall evaluate a postconviction petition on its own and need give the defendant notice only after it has acted. 725 ILCS 5/122-2.1 (West 2002). A defendant petitioning under the Act can draft his or her petition with the advance knowledge that he or she has only one opportunity to make his or her case to the court. However, a defendant who files a pleading under the Code will find nothing to suggest the possibility of summary dismissal, and thus such a dismissal is patently unfair.
Our recognition of the importance of a procedural framework that has been clearly fixed in advance leads us to reject the reasoning of People v. Bramlett, 347 Ill.App.3d 468, 282 Ill.Dec. 663, 806 N.E.2d 1251 (2004),[1] in which a Fourth District panel suggested that, because summary dismissal under the Act satisfies due process requirements, summary dismissal of actions under the Code must also do so. Bramlett, 347 Ill.App.3d at 472-73, 282 Ill.Dec. 663, 806 N.E.2d 1251. The Bramlett court seems to believe that the trial courts may mix and match elements of the various procedural provisions without the parties knowing in advance what procedure will be used. We believe that the better approach is to adhere to the procedural framework established in Shellstrom, Pearson, and their progeny.
We are mindful of the consequence of holding that summary dismissal (often done as here, by explicit referral to section 122-2.1 of the Act) is not available for pleadings filed under the Code. The recurrent nature of the issue shows that our trial courts are grasping for any tool that will allow them to cope with the endless flow of prisoner pro se filings. In using section 122-2.1 this way, our courts are making it serve a function similar to that of legislation in other jurisdictions designed to lessen the burden on the courts of prisoner-initiated and in forma pauperis litigation. For instance, the United *1210 States Code requires district courts to screen prisoner complaints against the government to determine whether they are frivolous or malicious, fail to state claims on which relief may be granted, or seek monetary relief from defendants who are immune from such relief. 28 U.S.C. § 1915A(b) (2000). If any of these apply, the court must dismiss the complaint sua sponte (Grayson v. Mayview State Hospital, 293 F.3d 103, 111 (3d Cir.2002)) and  perhaps  with prejudice (compare McGore v. Wrigglesworth, 114 F.3d 601, 612 (6th Cir.1997) (a dismissal under the section must be with prejudice), with Grayson, 293 F.3d at 111 (disagreeing with McGore)). We have already noted the existence of Wisconsin's Prisoner Litigation Reform Act, which is similar in its provisions. If summary dismissal outside the Act is necessary to ease the burden on our trial courts, it is up to the General Assembly to provide for summary dismissal under the Code. We cannot craft those provisions judicially.
Even under the status quo, trial courts have tools to dispose of bad pleadings expeditiously that do not require a resort to summary dismissal, such as striking the pleadings under section 2-612(a) of the Code (735 ILCS 5/2-612(a) (West 2002)). See Marino, 349 Ill.App. 3d at 200-01, 285 Ill.Dec. 466, 812 N.E.2d 55. At the worst, the State will need to file a motion to dismiss or for judgment on the pleadings, the court will give the prisoner an opportunity to respond, and the court will decide the motion, without oral argument, if that is appropriate. See Marino, 349 Ill.App.3d, at 201 n. 1, 285 Ill.Dec. 466, 812 N.E.2d 55. While such compliance with the Code is more burdensome that dismissal under the Act, it is not nearly burdensome enough to justify disregarding the Code's mandatory procedures.

Harmless Error Analysis
The court erred in summarily dismissing defendant's pleading. We will not deem that error to be harmless. In Shellstrom, we described such error as "inherently prejudicial" (Shellstrom, 345 Ill.App.3d at 179, 280 Ill.Dec. 456, 802 N.E.2d 381); in Pearson, we refused to treat the error as harmless because it changed the fundamental process, extinguishing its adversarial character. Pearson, 345 Ill.App.3d at 196, 280 Ill.Dec. 461, 802 N.E.2d 386. We recognize that this analysis has met with disagreement from the First District in People v. Anderson, 352 Ill.App.3d 934, 288 Ill.Dec. 350, 817 N.E.2d 1000 (2004), which held that summary dismissal is harmless error where the defects in a pleading are patently incurable. The Anderson court recognized that "[n]otice of impending judicial action and the opportunity to be heard prior to that action are fundamental principles of justice." Anderson, 352 Ill.App.3d at 942, 288 Ill.Dec. 350, 817 N.E.2d at 1007. It also recognized that even violation of fundamental rights, such as the right to a jury trial protected by the principles of Apprendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000), is subject to harmless error analysis. Anderson, 352 Ill.App.3d at 947, 288 Ill.Dec. 350, 817 N.E.2d at 1011, citing People v. Thurow, 203 Ill.2d 352, 368-71, 272 Ill.Dec. 185, 786 N.E.2d 1019 (2003). We acknowledge the weight of the point. Nevertheless, we maintain that harmless error analysis is inappropriate in these circumstances.
Harmless error analysis is a creature of necessity, not a fundamental principle of justice. If, for instance, a reviewing court reverses a conviction because of an evidentiary error, the defendant generally must receive a new trial. That has both economic and social costs, and we have good reason to insist that the defendant show *1211 real prejudice. In cases like these, by contrast, a remand places little burden on the trial court. In this respect, the supreme court's decisions regarding attorneys' failures to file certificates pursuant to Supreme Court Rule 604(d) (188 Ill.2d R. 604(d)) (e.g., People v. Janes, 158 Ill.2d 27, 34-35, 196 Ill.Dec. 625, 630 N.E.2d 790 (1994)) are closer to these circumstances than is Apprendi.
When an attorney represents a defendant on a motion to withdraw a guilty plea, he or she must certify in writing that he or she has consulted with the defendant to determine the defendant's contentions of error, has reviewed the record in the case, including transcripts of the proceedings, and has made any needed amendments to the motion. 188 Ill.2d R. 604(d). The Janes court held that rule 604(d) was an important protection against unintended waivers of rights by defendants. Janes, 158 Ill.2d at 35, 196 Ill.Dec. 625, 630 N.E.2d 790. Further, "`[a]dherence to a rule of strict compliance with the certificate requirement will not place an onerous burden on defense counsel, and, significantly, it will eliminate unnecessary appeals.'" Janes, 158 Ill.2d at 35, 196 Ill.Dec. 625, 630 N.E.2d 790, quoting People v. Dickerson, 212 Ill.App.3d 168, 171, 156 Ill.Dec. 426, 570 N.E.2d 902 (1991). Because of this, harmless error analysis was inappropriate. Janes, 158 Ill.2d at 35, 196 Ill.Dec. 625, 630 N.E.2d 790. If Rule 604(d) violations are not subject to harmless error analysis because the rule is important and the burden reasonable, then it should not apply here when the burden is similar and the rule involved is one needed to protect "fundamental principles of justice." Anderson, 352 Ill.App.3d at 942, 288 Ill.Dec. 350, 817 N.E.2d at 1007.
The analogy with Apprendi fails for a more basic reason: victims of Apprendi violations may have been denied the right to a jury trial, but they nevertheless could participate in their trials. What if the trial court simply declared a defendant guilty at the close of the State's evidence? Would the Anderson court deem the error harmless if the State's evidence were so overwhelming that nothing the defendant could have presented would have made a difference? We seriously doubt it. No matter what the ultimate merits, parties are entitled to make their cases to the courts. If that must be by a single document, fundamental fairness requires this be clear in advance. To deem an error harmless when it eviscerates the right to be heard is to allow it to annul the most basic of procedural safeguards. Whatever the merits of defendant's claims, those claims must be heard.

CONCLUSION
For the reasons stated, we vacate the order of the circuit court of Winnebago County and remand the matter for further proceedings consistent with section 2-701 of the Code.
Vacated and remanded.
BOWMAN and HUTCHINSON, JJ., concur.
NOTES
[1]  We also acknowledge the existence of Owens v. Snyder, 349 Ill.App.3d 35, 285 Ill.Dec. 251, 811 N.E.2d 738 (2004), cited by the State in support of its position. That case, which states that Winfrey, Shellstrom, and Pearson found the prisoner who filed the initial pleading to be prejudiced by the court's failure to serve the "defendant," appears to be the result of an unfortunate confusion over the designation of parties. Because the nature of the pleading has been at issue in all these cases, we have referred to the prisoner filing the pleading as "defendant," no matter how he designated himself on his pleading. Because the Owens court understood us to be concerned with notice to the party whom the prisoner designated as the defendant or respondent, it never addressed the question of whether the prisoner was entitled to notice of the impending dismissal. Owens is thus relevant only in that, in passing, it applies harmless error analysis. Owens, 349 Ill.App.3d at 45, 285 Ill.Dec. 251, 811 N.E.2d 738.
