Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
I have to handle external images in Development server and Production server.
Issue is i have developed to work in Development server, that is in D://
but in production server i have the images in C:// , every time i move the application i am changing the images location to work any way to how to handle this situation.
Thanks
You can use relative paths as well as the suggestion of the other members of using a variable.
If the folder structure is the same on both servers.
If say your qvw was in the a Folder Dashboard and you had the images in a sub folder images
you can use [..\Images\Yellow.png]
The variable idea do something like below
Let vPath D:\Program Files\Includes\Custom Load\QBR Images\ \\dev
\\Let vPath E:\QBR Images\ \\Prod
Then in your script change to
Yellow,$(vPath)\Yellow.png
Copy for the rest then you just need to comment out the one you are not using.
Mark
In this case you need variables for your path-parts, see: How to Use Environment Variables but in the long-term you should consider to use the same structures in development and production.
edit: Now I see my link is related to NPrinting, therefore here further hints:
Variables as file and table paths in load script
The $(Include) which you $(Must_Include) into your toolkit
And there are also possibilities to read certain settings direct, maybe per system-variables like WinRoot or per functions like getregistrystring().
Load from Windows' environment variables path?
- Marcus
Use a variable to hold the path as a string then you need only change the path in one location in your script. If you have a number of qvw files you are moving around you could use an include statement. This statement takes the text from an external file and this is acted upon when reloading. An include statement allows you to have one location (the external text file) where changes can be made that affect a number of qvw.
Hope this helps.
Below is the script i used,
Script
TrafficImages_Dev_Iqa:
Bundle LOAD * Inline [
Color,ImagesPath
Yellow,D:\Program Files\Includes\Custom Load\QBR Images\Yellow.png,
Red,D:\Program Files\Includes\Custom Load\QBR Images\Red.png,
Green,D:\Program Files\Includes\Custom Load\QBR Images\Green.png,
YellowRed,D:\Program Files\Includes\Custom Load\QBR Images\YellowRed.png,
..etc
TrafficImages_PRD:
Bundle LOAD * Inline [
Colors,ImagesPaths
Yellow,E:\QBR Images\Yellow.png,
Red,E:\QBR Images\Red.png,
Green,E:\QBR Images\Green.png,
YellowRed,E:\QBR Images\YellowRed.png,
...etc
Expression:
=if( FLD1='Yellow' and FLD2='Green','qmem://Color/YellowGreen' or 'qmem://Colors/YellowGreen',
if( FLD1='Yellow' and FLD2='Red','qmem://Color/YellowRed' or 'qmem://Colors/YellowRed',
if( FLD1='Yellow' and FLD2='Yellow','qmem://Color/Yellow' or 'qmem://Colors/Yellow',
if( FLD1='Red' and FLD2='Green','qmem://Color/RedGreen' or 'qmem://Colors/RedGreen'
....etc))))
this is not working any suggestions plz.
You can use relative paths as well as the suggestion of the other members of using a variable.
If the folder structure is the same on both servers.
If say your qvw was in the a Folder Dashboard and you had the images in a sub folder images
you can use [..\Images\Yellow.png]
The variable idea do something like below
Let vPath D:\Program Files\Includes\Custom Load\QBR Images\ \\dev
\\Let vPath E:\QBR Images\ \\Prod
Then in your script change to
Yellow,$(vPath)\Yellow.png
Copy for the rest then you just need to comment out the one you are not using.
Mark
To use only one script you could replace the path-parts like:
TrafficImages:
Bundle LOAD Color, replace(ImagesPath, 'D:\Program Files\Includes\Custom Load', 'E:') as ImagesPath Inline [
Color,ImagesPath
Yellow,D:\Program Files\Includes\Custom Load\QBR Images\Yellow.png,
Red,D:\Program Files\Includes\Custom Load\QBR Images\Red.png,
Green,D:\Program Files\Includes\Custom Load\QBR Images\Green.png,
YellowRed,D:\Program Files\Includes\Custom Load\QBR Images\YellowRed.png,
..etc
And your expression contained an OR-statement within the THEN-part - this couldn't work. I think this will be helpful:
- Marcus
Thanks mark this helped me.