Dynamic Crystal report viewer control
-
I am working on the reporting part of a big project. The problem is that the users of the product can have either version 8.5 or 10.0 of crystal reports. The task is to identify the version of the crystal report they have on the system and then create the relative activeX control either 8.5 or 10.0 from the code using its dlls to display the reports. I know that I can extract the version and the path of the dlls from the registry of the system. The actual problem arises when i need to use that dll to create the control dynamicallyfrom the code at runtime and use it to display the reports. Hope some one could help me out. Thanx in advance. ..RR..
-
I am working on the reporting part of a big project. The problem is that the users of the product can have either version 8.5 or 10.0 of crystal reports. The task is to identify the version of the crystal report they have on the system and then create the relative activeX control either 8.5 or 10.0 from the code using its dlls to display the reports. I know that I can extract the version and the path of the dlls from the registry of the system. The actual problem arises when i need to use that dll to create the control dynamicallyfrom the code at runtime and use it to display the reports. Hope some one could help me out. Thanx in advance. ..RR..
hi rahim, suppose if the two version dll's are named as crystal32_8.dll and crystal32_10.dll. then u register the both the dll's in the registry, then instantiate both the dll's classes. Then in the reporting function try to read the version of the report file and based on the version call the appropriate object. { // in the main class CCrystal_8 m_cry8 ; // object used to get the services of crystal32_8.dll CCrystal_10 m_cry10 ; // object used to get the services of crystal32_10.dll } { //in the area of reporting the file int ver ; 1. get the version info of the report file and store it in the ver 2. if(ver == 8) //use the object m_cry8 to show that file else //use the object m_cry10 to show that file } naren