This Code worked on a separate class but does not work on another class

Printable View