Creating autmated reprts using VBS AN 44 Applicatin Nte t the KLIPPEL R&D and QC SYSTEM Publishing measured results is imprtant t custmers and clients. While the KLIPPEL database cntains all infrmatin abut results and setups in ne single file, this frmat may be nt decent fr nn-technical peple. Using the KLIPPEL sftware, it is easy and fast t create HTML-templates based n peratins r bjects within KLIPPEL databases. If multiple reprts are required e.g. frm a series f measurements r n a regular basis, the user interactive methd f creating a reprt (pening database, navigating t peratin, selecting templates etc.) is time cnsuming and bring. Using the Autmatin Access t the KLIPPEL prprietary databases (*.klb), it is pssible t generate such reprts in an autmated way. In this Applicatin Nte the access f the data is shwn using windws scripting (VBS). This is a simple and pen prgramming language which can be edited and extended easily by the user. The VBS script can be started using a cmmand line. Hwever, a simple batch file is als prvided t shw the calling syntax fr the script. This slutin is cnvenient and extremely flexible at the same time. CONTENTS: Interactive Reprt... 2 Autmated Reprts... 3 Example 1 : Prcess ne database... 3 Example 2 : Prcess ne flder with databases... 4 Sftware... 4 Disclaimer... 5 Klippel GmbH Mendelsshnallee 30 01309 Dresden, Germany www.klippel.de inf@klippel.de updated April 4, 2012 TEL: +49-351-251 35 35 FAX: +49-351-251 34 31
AN 44 Creating autmated reprts using VBS Interactive Reprt Open Database Create reprt If the database is nt already pen (just after a measurement), duble click n any kdb-file t pen the database in db-lab. Select the bject and peratin fr which a reprt shall be generated. QC: Nte that fr all QC databases there is nly ne bject QC in the rt flder cntaining nly ne peratin als labeled QC. N lgin is required fr creating a reprt. R&D databases usually cntain multiple peratins in ne r mre bjects / flders. T create a reprt, select Prject / Reprt r click n the reprt icn: The reprt dialg will pen: Select a template Select Template / Open r click n the icn: t pen a template. Fr mst peratins generic templates are prvided frm KLIPPEL. Print / Save reprt Mdify Template Select Reprt / Save as r Print t publish the reprt as HTML-file r as printed utput (pdf, hard cpy). Mdify the saved HTML-file and lad the mdified file as template. All measurement results and graphs are replaced, but the mdified appearance (text, graphics, pictures etc.) is used frm the user mdified HTML-file. See als the db- Lab Manual fr mre infrmatin. Applicatin Nte KLIPPEL QC and R&D SYSTEM page 2
Creating autmated reprts using VBS AN 44 Autmated Reprts Autmatin Scripting using KLIPPEL Autmatin The KLIPPEL Analyzer Sftware can be cntrlled via sftware interface by external applicatins, such as Visual Basic, C++, C# r Scripting applicatins. Fr details see the cmprehensive Autmatin Dcumentatin Package. In this Applicatin Nte a simple windws scripting prgram is used t generate reprts frm KLIPPEL databases. The surce cde is prvided in the Sftware Package belnging t this Nte. The KLIPPEL Autmatin Sftware cmes with the db-lab installatin. Nte that the KLIPPEL Viewer Sftware and the db-lab Lite versin cannt be used. Use the installatin CD fr setup. Scripts run withut cmpilatin, s n further sftware tls are required. As the name says, scripts d nt prvide a nice graphical user interface. If this is required, use the script as template and implement yur prject using ne f the high prgramming languages. Example 1 : Prcess ne database Target A single peratin in a database shall be prcessed. QC databases typically cntain just ne peratin while R&D databases may cntain multiple peratins. In the batch file the peratin and the cntaining flder must be specified. After the generatin, the result shall be pened autmatically. Run the example Dwnlad and extract the sftware package AN44 Sftware (Creating autmated reprt).zip. Navigate t the flder prcess ne kdb-file. Start the batch file test.bat. A cmmand windw will pen and the used parameters are shwn in a shrt cnfiguratin message bx. Cnfirm with k. db-lab is nw called and the reprt is generated. The shell windw is clsed autmatically, and the reprt will be pened using a web brwser. Mdify the example Using a simple text editr (e.g. Ntepad), yu may change: names f files (database, template, reprt) usage f cmmand line parameter t invke names switching n/ ff the viewing f the cmpleted result creatin f sequences f reprt generatins. Applicatin Nte KLIPPEL QC and R&D SYSTEM page 3
AN 44 Creating autmated reprts using VBS Example 2 : Prcess ne flder with databases Target A flder with a set f databases shall be prcessed. In this example a typical QC test-lg flder is used. In such a flder databases are stred frm QC measurements. Each database cntains ne measurement. Fr each database a reprt with the same name shall be generated and stred in a subflder called reprts. While the first example shws the result, this ptin is disabled. The generatin is silent. Run the example Dwnlad and extract the sftware package AN44 Sftware (Creating autmated reprt).zip. Navigate t the flder prcess QC test flder and start the batch file test.bat A cmmand windw will pen. The target and surce flder are shwn. db-lab is nw called and the reprt is generated. The shell windw is clsed autmatically after all reprts were generated. Navigate t the utput flder: prcess QC test flder\mywfer\lg\reprts\ and pen ne HTML-file t verify the result. Mdify the example Using a simple text editr (e.g. Ntepad) yu may change: names f files and flders (database, template, reprt) scpe f the tree, where databases are searched kind and number f peratins t be prcessed usage f cmmand line parameter t invke names r flders Sftware db-lab Pr Windws script AN44 Sftware (Creating autmated reprt).zip db-lab Manual Autmatin Dcumentatin Package T generate reprts with user defined templates (custmized t cmpany style etc.), a db-lab Pr license is required. In mst cases a db-lab Pr license is included in the measurement system. Hwever, additinal licenses als fr clients r remte lcatins withut any KLIPPEL system can be purchased. If nt already installed n yur system, the windws scripting can be dwnladed frm the Micrsft website. Open the dc flder and check the web site links fr the actual sftware and a dcumentatin package. Tw examples are precnfigured t be used with this Applicatin Nte. Nte: The sftware is NOT t be used in custmer applicatins as it is. Additinal parameter checks and tests shuld be used t make the slutin rbust and safe. Hwever, it is beynd the scpe f this Applicatin Nte t prvide a cmplete slutin. The sftware included is intended t be used as a starting pint fr custmer specific slutins. Yu will find mre infrmatin n the Reprt System in the db-lab Manual. Detailed infrmatin abut the KLIPPEL Autmatin Interface including examples using several prgramming languages are prvided. Applicatin Nte KLIPPEL QC and R&D SYSTEM page 4
Creating autmated reprts using VBS AN 44 Disclaimer The sftware prvided with this Applicatin Nte is NOT t be used in custmer applicatins as it is. Additinal parameter checks and tests shuld be used t make the slutin rbust and safe. Hwever, it is beynd the scpe f this Applicatin Nte t prvide a cmplete slutin. The sftware included is intended t be used as a starting pint fr custmer specific slutins. Klippel GmbH Mendelsshnallee 30 01309 Dresden, Germany www.klippel.de inf@klippel.de updated April 4, 2012 TEL: +49-351-251 35 35 FAX: +49-351-251 34 31 Applicatin Nte KLIPPEL QC and R&D SYSTEM page 5