Web Designer connection issues

Stimulsoft Reports.JAVA discussion
torenic
Posts: 13
Joined: Wed Mar 18, 2020 10:23 am

Web Designer connection issues

Post by torenic »

I am interested in your product and thinking about purchasing Reports.Java in the future, but as everyone else, I've tried the trial version to find out if it suits my needs.
Despite some problems I managed to run instance of Reports Web Viewer on my stateless REST API running with Microsoft SQL database which works pretty good. Secondly, I've tried to run Reports Web Designer but with some problems I could not resolve myself for a couple of hours so I was forced to ask in here.

The web designer shows up in browser, but I'm having problem with database connection.
The main goal is to provide a database connection to web viewer so the person who will be able to create reports will no need to configure it every time manually.

To the problem:
I've implemented StiWebDesigerHandler where I'd like to use configured DataSource (javax.sql) as Connection provider.

Code: Select all


javax.sql.DataSource myDataSource;

public void onNewReportTemplate(StiReport report, HttpServletRequest request) {
   StiMsSqlDatabase db = new StiMsSqlDatabase();
   db.setName("Database");
   db.setAlias("Database");
   db.setConnection(myDataSource.getConnection()); //get connection from datasource
   report.getDictionary().getDatabases().add(db); //put the database to report dictionary
}
On FIle-New the database is here but it's not working as expected in these cases:

1. when the connection is local (localhost database) the database connection is closed after first interaction with database.
For example on New Data Source -> "Databse" -> New Query -> Run it shows that SQL Select executed successfully:
Image
but when I hit the button again it throws error:
Image

I do not know if this is the problem on my side but I don't understand why the designer tries to connect to the database when it has Connection instance or why it closes the connection when it executes the select.

2. when the connection is remote (remote database) nothing actually works when doing the same as above - the window fields are blank and buttons are not responding to clicks:
Image

3. When trying MySQL (default is MsSQL) I am not able to connect to database (using desktop version of Designer):
Image

Is there something I am doing wrong?
Are those problems affected by trial license by any chance?
May the first issue be caused by statelessness of the API?

Thanks.
Vadim
Posts: 363
Joined: Tue Apr 23, 2013 11:23 am

Re: Web Designer connection issues

Post by Vadim »

Hello.

You can use db.setConnection(myDataSource.getConnection()); only in Viewer or while exporting report. (not in Designer)
In Designer you must create "New Data Source"
torenic
Posts: 13
Joined: Wed Mar 18, 2020 10:23 am

Re: Web Designer connection issues

Post by torenic »

Hello, thanks for response.
Could you provide example for the "New Data Source"? I wish it was possible to do it with existing Connection (or DataSource) as I am using Spring Boot and the DataSource is being injected from current's application context (the one used for JDBC via JPA). and I would like to avoid setting the connection string because for some reasons it does not working for me (somehow remote server address is being changed to localhost).

EDIT:
If I understand correctly there is no way for the Report designer (person) to write its own SELECT queries?
Vadim
Posts: 363
Joined: Tue Apr 23, 2013 11:23 am

Re: Web Designer connection issues

Post by Vadim »

Hello.

You can see how to create "New Data Source" here https://www.stimulsoft.com/documentatio ... source.htm
You can design report with "connection string" & when export/viewer replace it with necessary Connection.
torenic
Posts: 13
Joined: Wed Mar 18, 2020 10:23 am

Re: Web Designer connection issues

Post by torenic »

Thanks you,Vadim, for your replies.
But unfortunately I didn't make it to work as expected. When setting connection string (without setConnection) the connection to database is successful in the web designer (it actually lists all tables in that schema in Schema Wizard) but when the "New Query" is clicked the dialog opens up blank (like image under 2. in first post) and buttons are not responding. In desktop version, doing the same will fill up the dialog (name in source, name, alias ...) and allows to interact - execute queries, fetch columns etc. - is something like this possible in web designer as well?
Vadim
Posts: 363
Joined: Tue Apr 23, 2013 11:23 am

Re: Web Designer connection issues

Post by Vadim »

torenic wrote: Thu Mar 19, 2020 12:22 pm Thanks you,Vadim, for your replies.
But unfortunately I didn't make it to work as expected. When setting connection string (without setConnection) the connection to database is successful in the web designer (it actually lists all tables in that schema in Schema Wizard) but when the "New Query" is clicked the dialog opens up blank (like image under 2. in first post) and buttons are not responding. In desktop version, doing the same will fill up the dialog (name in source, name, alias ...) and allows to interact - execute queries, fetch columns etc. - is something like this possible in web designer as well?
Hello.
Did you remove setConnection from onNewReportTemplate event ?
torenic
Posts: 13
Joined: Wed Mar 18, 2020 10:23 am

Re: Web Designer connection issues

Post by torenic »

Yes I did (and replaced with setConnectionString) because my goal is that when new report is selected the program will automatically bind the database and set permissions for databases to view only (so user can write new selects (datasources) on that database, but can't modify, view it or add more databases.

Despite (quite a lot) of problems I managed to run it properly on Oracle DB and SQL statements are executing properly - that's great, thank you.
But there is another problem (I hope the last one). When receiving columns I get following error:
Image

What could I be doing wrong?
Vadim
Posts: 363
Joined: Tue Apr 23, 2013 11:23 am

Re: Web Designer connection issues

Post by Vadim »

Hello.

Because of unsupported column type ROWID.
We fixed it, you can try new pre-release jars https://drive.google.com/open?id=1FmXOL ... 8p9wSNshLk
torenic
Posts: 13
Joined: Wed Mar 18, 2020 10:23 am

Re: Web Designer connection issues

Post by torenic »

Thank you very much for your responses.
Yes, the new version resolved the problem, good job out there.
But unfortunately the blank window for MS SQL is still present in the new version as well.
Vadim
Posts: 363
Joined: Tue Apr 23, 2013 11:23 am

Re: Web Designer connection issues

Post by Vadim »

Hello.

Do you have errors in java console or in browser console ?
Post Reply