#26 2019-04-19 13:34:25

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Hi,
In the new version 3.0.6-6007 the example with EXPORT stll doesn't work (no new button is shown)
...

P.S. I didn't change database to new one but I don't think it is connected (I have database from version: 3.0.6-6006)

Last edited by Patryx (2019-04-19 13:37:45)

Offline

#27 2019-04-23 08:19:12

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

I just tested again and in my case it works. I noticed a small error (two missing imports) in the script here, though: https://reportserver.net/en/guides/scri … Executors/
We already corrected the documentation and tested again with the exact code found here: https://reportserver.net/en/guides/scri … Executors/

With this configuration, I see the button in the export list if I open my report by url. The url is: http:...#inlinereport/id:2078898
I see the following:

FluxBB BBCode-Test

Please check again with the exact code in our documentation and restart your reportserver after putting the files in onstartup.d and onlogin.d respectively. Please test with a dynamic list and let me know.

Patryx wrote:

P.S. I didn't change database to new one but I don't think it is connected (I have database from version: 3.0.6-6006)

ReportServer upgrades the database automatically if needed, so you don't need to do anything here. In this case, though, the database is the same as with 3.0.6-6006.

Regards,
Eduardo

Offline

#28 2019-04-24 11:29:33

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Hi Eduardo,
Still there is no button. According to your documentation:

import net.datenwerke.rs.base.client.reportengines.table.dto.decorator.TableReportDtoDec

/* obtain ClientExtensionService */
def ces = GLOBALS.services['clientExtensionService']

/* register format */
ces.addReportExportOutputFormat new TableReportDtoDec(), "My Format", "MY_CUSTOM_FORMAT", ""

""

What does it mean "" in last line - it looks strange?
I cannot find what every argument means for calling addReportExportOutputFormat.

Last edited by Patryx (2019-04-24 11:30:13)

Offline

#29 2019-04-24 13:48:30

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

strange. Are you using the exact code in the documentation including this last line ("") and everything else?

The "" is the return value: https://reportserver.net/en/guides/scri … ng-Scripts

The method addReportExportOutputFormat is from the net.datenwerke.rs.scripting.service.scripting.scriptservices.ClientExtensionService class:
public void addReportExportOutputFormat(ReportDto reportType, String title,
            String outputFormat, String icon)

Can you post some screenshots showing your exact configuration, your scripts and the output? Did you check the logs for any error ?

Regards,
Eduardo

Offline

#30 2019-04-24 13:53:18

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

You wrote Eduardo:
public void addReportExportOutputFormat(ReportDto reportType, String title,
            String outputFormat, String icon)

You missed in documentation brackets for addReportExportOutputFormat() and according to the method there are 4 arguments, in the example are 5 ("" as the last one) smile
Unfortunately beside such correction it still doesn't work...

Last edited by Patryx (2019-04-24 13:54:45)

Offline

#31 2019-04-24 14:02:06

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

the method has 4 arguments:
ReportDto reportType, String title, String outputFormat, String icon

so we give 4 arguments to the method:
1: new TableReportDtoDec(), 2: "My Format", 3: "MY_CUSTOM_FORMAT", 4: ""

The last line ("") as I mentioned, is the return value of the script: https://reportserver.net/en/guides/scri … ng-Scripts

Regarding the brackets (I suppose you mean parenthesis): groovy doesn't need parenthesis in this case, so this is valid:
ces.addReportExportOutputFormat new TableReportDtoDec(), "My Format", "MY_CUSTOM_FORMAT", ""

Regards,
Eduardo

Offline

#32 2019-04-25 07:06:21

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Ok, I understand but as I mentioned, it doesn't work.
I copy-paste your example and create two files under onlogin.d.
Then I restarted Tomcat Server and Apache Web Server, opened reportserver, logged in, opened my variant report in report execution view and there was still no new button added into export buttons. What's more I tried to open by url (inline) my report and no new button shown.

I paste code of my files:

File "customDynamicListExporter.groovy"

import net.datenwerke.rs.base.service.reportengines.table.output.generator.TableOutputGenerator
import net.datenwerke.rs.base.service.reportengines.table.hooks.TableOutputGeneratorProviderHook
import net.datenwerke.rs.base.service.reportengines.table.hooks.adapter.TableOutputGeneratorProviderHookAdapter
import net.datenwerke.rs.core.service.reportmanager.engine.basereports.CompiledXHtmlReport

import java.io.OutputStream

import net.datenwerke.rs.base.service.reportengines.table.entities.Column.CellFormatter
import net.datenwerke.rs.base.service.reportengines.table.entities.TableReport
import net.datenwerke.rs.base.service.reportengines.table.output.object.TableDefinition
import net.datenwerke.rs.core.service.reportmanager.engine.CompiledReport
import net.datenwerke.rs.core.service.reportmanager.engine.config.ReportExecutionConfig
import net.datenwerke.rs.core.service.reportmanager.output.ReportOutputGenerator
import net.datenwerke.security.service.usermanager.entities.User
import net.datenwerke.rs.core.service.reportmanager.parameters.ParameterSet

def HOOK_NAME = "MY_ADDITIONAL_GENERATOR"

/* specify the generator */
class MyGenerator implements TableOutputGenerator {
	def writer = null
	int rows = 0

	void initialize(OutputStream os, TableDefinition td, boolean withSubtotals, TableReport report, TableReport originalReport, CellFormatter[] cellFormatters, ParameterSet parameters, User user, ReportExecutionConfig... configs ){
	    writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(os)));
		writer.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>" +
				       "<html xmlns=\"http://www.w3.org/1999/xhtml\">" +
				       "<head></head>" +
				       "<body><b>Number of rows:</b>");
	}

    void nextRow(){
    	rows++;
    }

    void close() {
    	writer.append(" ").append((rows+1) as String).append("</body></html>");
    	writer.close();
    }

    boolean supportsStreaming(){
       return true;
    }

    void addField( Object field, CellFormatter cellFormatter ){}

    CompiledXHtmlReport getTableObject() {
    	return new CompiledXHtmlReport(null);
    }

    void addGroupRow (int[] subtotalIndices, Object[] subtotals, int[] subtotalGroupFieldIndices, Object[] subtotalGroupFieldValues, int rowSize, CellFormatter[] cellFormatters ){ }

    String[] getFormats() {
      String[] formats = ['MY_CUSTOM_FORMAT']
      return formats
    }

	boolean isCatchAll() { return false; }

	CompiledXHtmlReport getFormatInfo() {
    	return new CompiledXHtmlReport(null);
	}

}

/* specify provider */
def provider = [
	provideGenerators : { ->
		return [new MyGenerator()]
	}
] as TableOutputGeneratorProviderHookAdapter

/* plugin hook */
GLOBALS.services.callbackRegistry.attachHook(HOOK_NAME, TableOutputGeneratorProviderHook.class, provider)

File "customDynamicListExporterGui.groovy":

import net.datenwerke.rs.base.client.reportengines.table.dto.decorator.TableReportDtoDec

/* obtain ClientExtensionService */
def ces = GLOBALS.services['clientExtensionService']

/* register format */
ces.addReportExportOutputFormat new TableReportDtoDec(), "My Format", "MY_CUSTOM_FORMAT", ""

""

Offline

#33 2019-04-25 07:16:05

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

try to move the customDynamicListExporter.groovy to onstartup.d and restart your tomcat.
The customDynamicListExporterGui.groovy should remain in onlogin.d.

Does this help?

Regards,
Eduardo

Offline

#34 2019-04-25 10:52:40

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

I had to create folder "onstartup.d": "fileserver/bin/onstartup.d"
Then I copied there my "customDynamicListExporter.groovy" and removed it from "onlogin.d".

Unfortunately after restarting Tomcat and Web Server no changes. Still I don't have such a button.

I can notice that hook is added into hooks using terminal and script to show hooks (found in forum):

reportserver$ cd fileserver/bin/getstarted
reportserver$ exec showhooks.rs
{MY_ADDITIONAL_GENERATOR=net.datenwerke.rs.scripting.service.scripting.scriptservices.CallbackRegistry$HookEntry@322e120d}
MY_ADDITIONAL_GENERATOR: Thu Apr 25 12:28:35 CEST 2019
reportserver$

Last edited by Patryx (2019-04-25 10:53:35)

Offline

#35 2019-04-25 10:56:36

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

can you please send a screenshot of what you see ?

Regards,
Eduardo

Offline

#36 2019-04-25 12:19:09

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Ok, two screens, one from Administration page and one from URL:

no-my-button-1.png

no-my-button-2.png

Last edited by Patryx (2019-04-25 12:26:01)

Offline

#37 2019-04-29 11:50:54

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

this is strange. Can you please try with a new installation (just install the DDLs into a new database) ?  You can try with the existing AUDIT report.

If this doesn't work, could you please send me your DB so I can install it locally and check what may be happening? An sql dump would be the best.

Regards,
Eduardo

Offline

#38 2019-05-06 08:18:26

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Hi Eduardo,
I did as you suggested: I installed the DDLs into a new database, added folder: fileserver/bin/onstartup.d, where I createTextFile my "customDynamicListExporter.groovy".
In folder: fileserver/bin/onlogin.d I did createTextFile my "customDynamicListExporterGui.groovy". Then I restarted all services.

Unfortunately it didn't help. There is still no button in export.

How can I send this dump to you? (I will send the dump of this new almost empty database which I just created and added only these 2 scripts)

Last edited by Patryx (2019-05-06 13:43:55)

Offline

#39 2019-05-08 10:02:16

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

ok, this is strange. I will test again with this exact configuration in a brand new database with reportserver 3.0.7.

Which database are you using exactly?

Regards,
Eduardo

Offline

#40 2019-05-08 11:44:21

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Hi,
I have just installed version 3.0.7 and it started to work smile
Now I see My Format-Export. In your example you have it at next position under Template-Export, I have My Format at the first position (My format-Export) - it's just a small difference.

Offline

#41 2019-05-08 11:53:38

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

ok, sounds great smile
You should also see it calling the report by URL, right ?

Regards,
Eduardo

Offline

#42 2019-05-08 13:56:36

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Yes, it is visible too smile

But you know that I am still waiting for right solution to my problem. Export will be good if it is possible to skip download file - we were talking about it.
Do you work on adding such functionality? When can I expect the solution? ;-)
Step by step I am getting closer and closer but always sth misses smile

Last edited by Patryx (2019-05-09 08:12:48)

Offline

#43 2019-05-09 12:19:37

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

yes, as I mentioned, the ticket for skipping the download file is on its work. Currently, the issue is in the feature request development queue. As such, I cannot say when this will be finished. But as I also think this is an interesting feature we are working on it.

Regards,
Eduardo

Offline

#44 2019-05-13 06:33:38

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Hi Eduardo,
But is it possible that you will issue this feature in one / one and half months or shouldn't I count on it?
It's a crucial issue for our company.
Or maybe before that will you add possibility to use "Send to" in Report Execution View and control visibility of that?

Offline

#45 2019-05-13 06:37:36

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

Patryx wrote:

I have just installed version 3.0.7 and it started to work smile
Now I see My Format-Export.

we identified a timing issue that explains this. The report GUI is dependent on the onlogin.d script execution. Sometimes the script was executed first (correct), sometimes not (for example when you didn't see the buttons). I raised ticket RS-3452 for this and already fixed this: now, the GUI of the report is only created after the onlogin.d scripts (if any) are executed.

This will be fixed with the next reportserver version.

Regards,
Eduardo

Offline

#46 2019-05-13 06:45:04

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

Patryx wrote:

But is it possible that you will issue this feature in one / one and half months or shouldn't I count on it?
It's a crucial issue for our company.

I am happy to announce that we just finished development of ticket RS-3452 (allow to skip download file).

Now, you can install the GUI to skip the download and just notify the user when the script finishes executing like this:

import net.datenwerke.rs.base.client.reportengines.table.dto.decorator.TableReportDtoDec
import net.datenwerke.rs.scripting.service.scripting.extensions.AddReportExportFormatProvider

import net.datenwerke.rs.base.client.reportengines.table.dto.TableReportVariantDto
import net.datenwerke.rs.base.client.reportengines.table.dto.decorator.TableReportVariantDtoDec

/* obtain ClientExtensionService */
def ces = GLOBALS.services['clientExtensionService']

/* register format */
AddReportExportFormatProvider provider = new AddReportExportFormatProvider(new TableReportDtoDec(), "My Format", "MY_CUSTOM_FORMAT", "")
provider.skipDownload = true
ces.addReportExportOutputFormat provider 

""

In the server-side, you still create a file, but it may be empty, e.g.:

import net.datenwerke.rs.base.service.reportengines.table.output.generator.TableOutputGenerator
import net.datenwerke.rs.base.service.reportengines.table.hooks.TableOutputGeneratorProviderHook
import net.datenwerke.rs.base.service.reportengines.table.hooks.adapter.TableOutputGeneratorProviderHookAdapter
import net.datenwerke.rs.core.service.reportmanager.engine.basereports.CompiledXHtmlReport

import java.io.OutputStream

import net.datenwerke.rs.base.service.reportengines.table.entities.Column.CellFormatter
import net.datenwerke.rs.base.service.reportengines.table.entities.TableReport
import net.datenwerke.rs.base.service.reportengines.table.output.object.TableDefinition
import net.datenwerke.rs.core.service.reportmanager.engine.CompiledReport
import net.datenwerke.rs.core.service.reportmanager.engine.config.ReportExecutionConfig
import net.datenwerke.rs.core.service.reportmanager.output.ReportOutputGenerator
import net.datenwerke.security.service.usermanager.entities.User
import net.datenwerke.rs.core.service.reportmanager.parameters.ParameterSet
import groovy.sql.Sql

def HOOK_NAME = "MY_ADDITIONAL_GENERATOR"

/* specify the generator */
class MyGenerator implements TableOutputGenerator {
  
  	def db = [url:'jdbc:sqlserver://IP;databaseName=myDb', user:'myUser', password:'password', driver:'com.microsoft.sqlserver.jdbc.SQLServerDriver']
 	def sql = Sql.newInstance(db.url, db.user, db.password, db.driver)
  
  	def reportName = null
  
	int rows = 0
  
	void initialize(OutputStream os, TableDefinition td, boolean withSubtotals, TableReport report, TableReport originalReport, CellFormatter[] cellFormatters, ParameterSet parameters, User user, ReportExecutionConfig... configs ){
		reportName = report.name
    }

    void nextRow(){
      	rows++;
    }

    void close() {
      	def params = [reportName, rows+1]
 		sql.execute 'insert into execution_counts (report_name, number_of_rows) values (?, ?)', params
    }

    boolean supportsStreaming(){
       return false;
    }

    void addField( Object field, CellFormatter cellFormatter ){}

    CompiledXHtmlReport getTableObject() {
    	return new CompiledXHtmlReport("");
    }

    void addGroupRow (int[] subtotalIndices, Object[] subtotals, int[] subtotalGroupFieldIndices, Object[] subtotalGroupFieldValues, int rowSize, CellFormatter[] cellFormatters ){ }

    String[] getFormats() {
      	String[] formats = ['MY_CUSTOM_FORMAT']
      	return formats
    }

	boolean isCatchAll() { return false; }

	CompiledXHtmlReport getFormatInfo() {
    	return new CompiledXHtmlReport("");
	}

}

/* specify provider */
def provider = [
	provideGenerators : { ->
		return [new MyGenerator()]
	}
] as TableOutputGeneratorProviderHookAdapter

/* plugin hook */
GLOBALS.services.callbackRegistry.attachHook(HOOK_NAME, TableOutputGeneratorProviderHook.
class, provider)

In the example, you count the entries and insert them to a database. In this case, you don't need a download, as you pointed out. With the client-side configuration above, this is achieved smile

Regards,
Eduardo

Offline

#47 2019-05-13 08:39:57

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Hi!
It sounds perfect.
Is it available in the issued version 3.0.7 of Report Server or should I wait for next version?

Offline

#48 2019-05-13 08:46:50

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

ReportServer 3.0.7 is already released, so it is not available here. It will be available in the next version. Either 3.0.8 or a next 3.0.7 build.

We may also create a preview build for you so you can test the new feature. Please let me know if you are interested.

Further, I would like to ask you if you got my Email I sent you some days ago ? Please confirm.

Regards,
Eduardo

Offline

#49 2019-05-13 09:09:56

Patryx
Member
Registered: 2019-03-25

Re: Additional Report Executors - the example doesn't work

Hi Eduardo,
I found your email and I have just answered to it. Of course I really interested in trying the preview version! ;-)

Offline

#50 2019-05-13 10:40:14

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Additional Report Executors - the example doesn't work

Hi Patryx,

we will create a preview version for you and I will send you the link per Email. I think the version will be finished later by today or tomorrow.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB