No report is loaded in viewer through PHP

Stimulsoft Reports.PHP discussion
Super Bread
Posts: 36
Joined: Mon Aug 08, 2011 12:51 am

No report is loaded in viewer through PHP

Post by Super Bread »

hello,

I followed the sample instruction to load the report via php but it is no report content is loaded.

1. Type this in the URL.
http://localhost/stimulsoft/index.php?s ... leList.mrt

2. Show the viewer only.

3. I need to press the open button to view the report. However, I want to open it automatically from php.

Please help, thanks.
Attachments
1687.log.txt
(10.41 KiB) Downloaded 342 times
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

No report is loaded in viewer through PHP

Post by Vladimir »

Hello,

Please do the following:

1. In the 'config.xml' file the EnableDataLogger option set to True in Connection section.
2. Run the report viewer.
3. Click on the 'Save Log File' button in the viewer's Save menu.
4. Save the text file and send it to us for analysis.

Thank you.
Super Bread
Posts: 36
Joined: Mon Aug 08, 2011 12:51 am

No report is loaded in viewer through PHP

Post by Super Bread »

The log file is attached for your analysis.
Attachments
1688.log.txt
(10.41 KiB) Downloaded 350 times
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

No report is loaded in viewer through PHP

Post by Vladimir »

Hello,

Could you please send us an index.php file from stimulsoft folder that you use on your web server?

Thank you.
Super Bread
Posts: 36
Joined: Mon Aug 08, 2011 12:51 am

No report is loaded in viewer through PHP

Post by Super Bread »

index.php file is attached, please check. Thanks.

Note: please change the filename from index.bak to index.php because it cannot upload the index.php through your attachment screen. Thanks.
Attachments

[The extension bak has been deactivated and can no longer be displayed.]

Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

No report is loaded in viewer through PHP

Post by Vladimir »

Hello,

When loading a report the value of stimulsoft_report_key parameter is passed to the sti_get_report($report_key) method in the index.php file.

By default, this parameter is used as the name of the file that is loaded in the designer:

if (file_exists("../reports/$report_key")) return file_get_contents("../reports/$report_key");

This report file must be located in the following folder on your server:

http://localhost/stimulsoft/reports/

(the http://localhost/stimulsoft/reports/SimpleList.mrt file in you case).

You can change this behavior as you need by editing the sti_get_report method.

Thank you.
Super Bread
Posts: 36
Joined: Mon Aug 08, 2011 12:51 am

No report is loaded in viewer through PHP

Post by Super Bread »

Surely, that file (SimpleList.mrt) is located in http://localhost/stimulsoft/reports/SimpleList.mrt but it still cannot load the data in the report.

When I directly typed http://localhost/stimulsoft/reports/SimpleList.mrt in browser, it only can show the text on browser but not the report viewer.

Please help.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

No report is loaded in viewer through PHP

Post by Vladimir »

Hello,

Sorry, our error.

The report file must be located in the following folder on your server:

http://localhost/reports/SimpleList.mrt

Alternatively, you can edit the PHP code:

if (file_exists("../reports/$report_key")) return file_get_contents("../reports/$report_key");

replace to:

if (file_exists("reports/$report_key")) return file_get_contents("reports/$report_key");

Thank you.
Super Bread
Posts: 36
Joined: Mon Aug 08, 2011 12:51 am

No report is loaded in viewer through PHP

Post by Super Bread »

After your instruction, the report file is changed to http://localhost/reports/SimpleList.mrt

It can show the data on browser but it also shows the error message Error#1088. What's it mean? I just use your sample file to load. Thanks.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

No report is loaded in viewer through PHP

Post by Vladimir »

Hello,

Most likely, the report engine cannot find the data file. In the above mentioned reports directory shall be the following files:
SimpleList.mdc
SimpleList.mrt
SimpleListWithVariable.mrt
Demo.xml
Demo.xsd
Thank you.
Post Reply