Report

Q:

On click “Generate Report”-> Lianja.evaluate(“report_htm()”)
Name:  lj-report.jpg Views: 18 Size:  73.0 KB

In server script “report_htm.prg”, I only have the following codes:

 

 

Code:
m.cFile = "htmlfile&(getpid()).htm"
m.cStr=FileToStr("rpt_template.htm")
m.nResult=StrToFile(m.cStr, m.cFile)

I tested in the console Lianja.evaluate(“_testreport()”), and it does create a file. However, when I run it a browser it fails. I also tried fwrite without success.

A:

Try this:

Code:
m.cFile = tmpnam(".htm")
m.htmlrep = "c:\lianja\cloudserver\tenants\public\wwwroot\\zzzzw\rpt_template.htm"
m.cStr=FileToStr(htmlrep)
m.nResult=StrToFile(m.cStr, m.cFile)

That saves to the default temporary directory: C:\lianja\server\tmp\ (can be changed in the Lianja Server Manager-> Settings) and specifies where to find the rpt_template.htm. (I’ll check re the App dir, should be able to do that without hard-coding).


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s