Commit 1b3bc2a2 authored by Claes Sjofors's avatar Claes Sjofors

Report, tmp file location moved to pwrp_lis

parent ecbd777d
...@@ -251,8 +251,9 @@ void rt_report::create_report( pwr_sClass_Report *o) ...@@ -251,8 +251,9 @@ void rt_report::create_report( pwr_sClass_Report *o)
pwr_tStatus sts; pwr_tStatus sts;
char address[40]; char address[40];
pwr_tFileName cnvfile; pwr_tFileName cnvfile;
pwr_tFileName tmpfile = "$pwrp_tmp/report.tmp"; pwr_tFileName tmpfile = "$pwrp_lis/report.tmp";
pwr_tString256 conf_cmd; pwr_tString256 conf_cmd;
int first = 1;
dcli_translate_filename( fname, o->TemplateFile); dcli_translate_filename( fname, o->TemplateFile);
fin.open( fname); fin.open( fname);
...@@ -271,10 +272,16 @@ void rt_report::create_report( pwr_sClass_Report *o) ...@@ -271,10 +272,16 @@ void rt_report::create_report( pwr_sClass_Report *o)
fout << "<topic> index <style> report" << endl; fout << "<topic> index <style> report" << endl;
while ( fin.getline( line, sizeof(line))) { while ( fin.getline( line, sizeof(line))) {
if ( cdh_NoCaseStrncmp( line, "<execute>", 9) == 0) { dcli_trim( newline, line);
if ( first && strcmp( newline, "") == 0)
continue;
if ( cdh_NoCaseStrncmp( newline, "<execute>", 9) == 0) {
parse( &line[9]); parse( &line[9]);
} }
else { else {
first = 0;
replace_value( newline, sizeof(newline), line); replace_value( newline, sizeof(newline), line);
fout << newline << endl; fout << newline << endl;
...@@ -295,23 +302,23 @@ void rt_report::create_report( pwr_sClass_Report *o) ...@@ -295,23 +302,23 @@ void rt_report::create_report( pwr_sClass_Report *o)
case pwr_eDocumentFormatEnum_PDF: case pwr_eDocumentFormatEnum_PDF:
// Convert to pdf // Convert to pdf
sprintf( cmd, "co_convert -f -d %s %s", sprintf( cmd, "co_convert -f -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report.pdf"); strcpy( cnvfile, "$pwrp_lis/report.pdf");
break; break;
case pwr_eDocumentFormatEnum_Html: case pwr_eDocumentFormatEnum_Html:
// Convert to pdf // Convert to pdf
sprintf( cmd, "co_convert -s -d %s %s", sprintf( cmd, "co_convert -s -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report_index.html"); strcpy( cnvfile, "$pwrp_lis/report_index.html");
break; break;
default: default:
// Convert to text // Convert to text
sprintf( cmd, "co_convert -j -d %s %s", sprintf( cmd, "co_convert -j -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report.txt"); strcpy( cnvfile, "$pwrp_lis/report.txt");
} }
...@@ -391,9 +398,9 @@ void rt_report::create_report( pwr_sClass_Report *o) ...@@ -391,9 +398,9 @@ void rt_report::create_report( pwr_sClass_Report *o)
// Convert to text // Convert to text
sprintf( cmd, "co_convert -j -d %s %s", sprintf( cmd, "co_convert -j -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report.txt"); strcpy( cnvfile, "$pwrp_lis/report.txt");
replace_symbol( str, o->Recipient); replace_symbol( str, o->Recipient);
...@@ -488,10 +495,10 @@ void rt_report::create_report( pwr_sClass_Report *o) ...@@ -488,10 +495,10 @@ void rt_report::create_report( pwr_sClass_Report *o)
pwr_tCmd cmd; pwr_tCmd cmd;
sprintf( cmd, "co_convert -n -d %s %s", sprintf( cmd, "co_convert -n -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report.ps"); strcpy( cnvfile, "$pwrp_lis/report.ps");
dcli_trim( conf_cmd, o->PrintCmd); dcli_trim( conf_cmd, o->PrintCmd);
if ( strcmp( conf_cmd, "") == 0) if ( strcmp( conf_cmd, "") == 0)
...@@ -513,30 +520,30 @@ void rt_report::create_report( pwr_sClass_Report *o) ...@@ -513,30 +520,30 @@ void rt_report::create_report( pwr_sClass_Report *o)
case pwr_eDocumentFormatEnum_PDF: case pwr_eDocumentFormatEnum_PDF:
// Convert to pdf // Convert to pdf
sprintf( cmd, "co_convert -f -d %s %s", sprintf( cmd, "co_convert -f -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report.pdf"); strcpy( cnvfile, "$pwrp_lis/report.pdf");
break; break;
case pwr_eDocumentFormatEnum_Html: case pwr_eDocumentFormatEnum_Html:
// Convert to pdf // Convert to pdf
sprintf( cmd, "co_convert -s -d %s %s", sprintf( cmd, "co_convert -s -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report_index.html"); strcpy( cnvfile, "$pwrp_lis/report_index.html");
break; break;
case pwr_eDocumentFormatEnum_Postscript: case pwr_eDocumentFormatEnum_Postscript:
// Convert to Postscript // Convert to Postscript
sprintf( cmd, "co_convert -n -d %s %s", sprintf( cmd, "co_convert -n -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report.ps"); strcpy( cnvfile, "$pwrp_lis/report.ps");
break; break;
default: default:
// Convert to text // Convert to text
sprintf( cmd, "co_convert -j -d %s %s", sprintf( cmd, "co_convert -j -d %s %s",
"$pwrp_tmp", tmpfile); "$pwrp_lis", tmpfile);
system( cmd); system( cmd);
strcpy( cnvfile, "$pwrp_tmp/report.txt"); strcpy( cnvfile, "$pwrp_lis/report.txt");
} }
// Rename file to target filename // Rename file to target filename
...@@ -893,7 +900,7 @@ int rt_report::parse( char *line) ...@@ -893,7 +900,7 @@ int rt_report::parse( char *line)
if ( num > 1 && cdh_NoCaseStrcmp( line_array[1], "graph") == 0) { if ( num > 1 && cdh_NoCaseStrcmp( line_array[1], "graph") == 0) {
ofstream fout; ofstream fout;
pwr_tFileName fname; pwr_tFileName fname;
pwr_tFileName tmpfile = "$pwrp_tmp/report_print.rtt_com"; pwr_tFileName tmpfile = "$pwrp_lis/report_print.rtt_com";
pwr_tCmd cmd; pwr_tCmd cmd;
if ( num < 4) if ( num < 4)
...@@ -905,6 +912,7 @@ int rt_report::parse( char *line) ...@@ -905,6 +912,7 @@ int rt_report::parse( char *line)
return 0; return 0;
fout << "open graph /hide " << line_array[2] << endl; fout << "open graph /hide " << line_array[2] << endl;
fout << "wait 2 " << endl;
fout << "export graph /graph=" << line_array[2] << " /file=\"" << line_array[3] << "\"" << endl; fout << "export graph /graph=" << line_array[2] << " /file=\"" << line_array[3] << "\"" << endl;
sprintf( cmd, "rt_xtt_cmd -i -q @%s", fname); sprintf( cmd, "rt_xtt_cmd -i -q @%s", fname);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment