java example exception in viewer.jsp

Stimulsoft Reports.JAVA discussion
xiaohaoxifei
Posts: 34
Joined: Mon Sep 18, 2017 6:07 am

Re: java example exception in viewer.jsp

Post by xiaohaoxifei »

Hi, sorry but have to trouble you again.
Have a json data source and want to generate a report.
Below is the baisic structure of the json list.

Code: Select all

	{
		"eventId": 598334,
		"deviceType": 0,
		"deviceNo": "RNG0010720000301",
		"generateDt": "03/01/2015 05:11:12",
		"eventCode": 70,
		"collectDt": "03/01/2015 06:11:12",
		"collectSource": null,
		"eventTag": "Supervision monitor threshold exceeded",
		"autoRunId": 2015010305,
		"isNotify": null,
		"notifyDt": null,
		"code": null,
		"c": {
			"eventCode": 70,
			"eventName": "Supervision monitor threshold exceeded",
			"eventDesc": "Indicates that the supervision monitor threshold has been exceeded.",
			"eventType": null,
			"eventLevel": 3,
			"eventCateId": 3,
			"cimNo": null
		},
		"dataEventDets": null,
		"generalParam": {
			"deviceType": "DCU",
			"eventLevel": "Low"
		}
	}
I need to display both the first level data and the second level data in one table. Data achieved from the first level is OK, e.g, "deviceType" or "generateDt" works just fine. But "eventName" inside the data node "c" doesnot work properly. Only the first line is displayed OK, other values are just the same as the first ones. Why?
Attachments
event_analysis.json
(575.79 KiB) Downloaded 238 times
data_list.png
data_list.png (49.8 KiB) Viewed 5604 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: java example exception in viewer.jsp

Post by Alex K. »

Hello,

Please send us your report with test data which reproduces the issue for analysis.

Thank you.
xiaohaoxifei
Posts: 34
Joined: Mon Sep 18, 2017 6:07 am

Re: java example exception in viewer.jsp

Post by xiaohaoxifei »

The report and data file is uploaded, please check.
Attachments
event_analysis.json
(575.79 KiB) Downloaded 251 times
error_display_column.png
error_display_column.png (51.26 KiB) Viewed 5601 times
event_analysis.mrt
(38.99 KiB) Downloaded 396 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: java example exception in viewer.jsp

Post by Alex K. »

Hello,

In this case, you should add Relation between tables and use the following expression:
DataSourceName.Relation.ColumnName

Thank you.
Attachments
event_analysis_modified.mrt
(36.56 KiB) Downloaded 403 times
xiaohaoxifei
Posts: 34
Joined: Mon Sep 18, 2017 6:07 am

Re: java example exception in viewer.jsp

Post by xiaohaoxifei »

Thanks for the reply.
Still not working, firstly I created a relation like you did.
Secondly I Wrote the expression in the form as you taught me "{dataList_generalParam.Relation_general.eventLevel}", which does not work. After removing the "Relation_general" from the expression, the preview result is just like no relation is added.
Attachments
relation.png
relation.png (190.45 KiB) Viewed 5586 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: java example exception in viewer.jsp

Post by HighAley »

Hello.

Please, check our modified report template.
There is another data band. We don't see it on your screenshot.

Thank you.
Vadim
Posts: 362
Joined: Tue Apr 23, 2013 11:23 am

Re: java example exception in viewer.jsp

Post by Vadim »

Hello.
We made some enhancements in Java relations, please try next build 2017.2.4 it will available soon.
xiaohaoxifei
Posts: 34
Joined: Mon Sep 18, 2017 6:07 am

Re: java example exception in viewer.jsp

Post by xiaohaoxifei »

Thanks.

I've got some questions for you.

1, In the report, I've used the system variable 'time' to display. Since my operating system is Chinese copy windows, I got something like '11/28/2017 09:13:50 上午', but our client is not Chinese. How is the time variable created? So can we display it in 24 hours form, or can we remove the '上午' field?

2, I've purchased the license for the java version and set the key with the 'com.stimulsoft.base.licenses.StiLicense.setKey' function, viewer and designer pages are both displayed OK, but in the previewing page, the 'trial' is still displayed, why?

3, I want to set the viewer width to the page width when the viewer is loaded, is there some function like 'options.setWidth("Page Width")'?

Thanks in advance.
Vadim
Posts: 362
Joined: Tue Apr 23, 2013 11:23 am

Re: java example exception in viewer.jsp

Post by Vadim »

Hello.
1. You can change field format as your needs.
timeformat.PNG
timeformat.PNG (37.78 KiB) Viewed 5504 times
2. What is preview page? Maybe you use different webapps, so you must set key for every webapp.
3. You can use option options.getToolbar().setZoom(); zoom by PageWidth = -1; zoom by PageHeight = -2;
xiaohaoxifei
Posts: 34
Joined: Mon Sep 18, 2017 6:07 am

Re: java example exception in viewer.jsp

Post by xiaohaoxifei »

Thanks for your quick reply.

2. What is preview page? Maybe you use different webapps, so you must set key for every webapp.

The preview page is the window when the "preview" button is clicked in the designer page.
Attachments
trial.png
trial.png (35.83 KiB) Viewed 5503 times
Post Reply