Wednesday, May 19, 2004

Crystal Reports -- Render vs. PreRender

Crystal (more specifically, Web.CrystalViewer) does some special stuff during its PreRender handler. When adding Parameters to the viewer, you need to do it before the control's PreRender. Otherwise, the rendered content will just be "Programming Error." I figured this out the hard way by creating a handler for Page.Render, and config'ing the Web.CrystalViewer within. After receiving the error message mentioned (and scratching my head for a while), I moved all the code to my own PreRender handler. By setting everything in PreRender, calling base.OnPreRender (to let the other controls handle PreRender, and not overriding Render, everything began to work.

The Love-Hate relationship continues...

No comments: