Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle null parameters in reports #35

Closed
ghost opened this issue Jan 12, 2018 · 10 comments
Closed

Handle null parameters in reports #35

ghost opened this issue Jan 12, 2018 · 10 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jan 12, 2018

Since I have not received any ideas at Cuba Platform Forum, going to post a question here.

Hi there,
looking for a way to specify sort of like default values in reports.
I.e. having null value in DataBand I need to put down N/A for example in report.
Any ideas? Custom formats will work, but that’s another story - the absense to plug in your custom formatter is terrible to be honest.
Moreover, it looks that we have a requirement to provide ability to change to default values in templates.
BTW, we are implemented external API dataloader for YARG, is anyone interested in PR?

BR,
Ilia Rodionov.

@tinhol
Copy link
Contributor

tinhol commented Jan 16, 2018

Hello.

Have you tried to override the com.haulmont.yarg.reporting.DataExtractor implementation?

@ghost
Copy link
Author

ghost commented Jan 17, 2018

Hi,
yes, we modified it's logic.
Actually the point is to let templates authors ability to decide what should be used when a null (or empty) value is encountered. In some reports users need to have '---' in others 'N/A'. No reason to have this values stored in application - it's solely a matter of representation, isn't it?

@tinhol
Copy link
Contributor

tinhol commented Jan 17, 2018

Hello.
Well, you are right. In your case even custom value formatter would not help, because our file formatters just ignore null values.

Let me think about it, and I will provide some implementation in next releases.

@ghost
Copy link
Author

ghost commented Jan 17, 2018

Thanks in advance, it would be great. Don't hesitate to contact if I can give you a hand somehow.

tinhol added a commit that referenced this issue Mar 4, 2018
allow to provide custom value formats
@tinhol
Copy link
Contributor

tinhol commented Mar 4, 2018

Hello,

I have implemented the feature in master branch.

Could you please take a look?

@ghost
Copy link
Author

ghost commented Mar 5, 2018

Hi,
looks as if that should work. I am going to try it later on.

@tinhol tinhol closed this as completed Mar 14, 2018
tinhol added a commit that referenced this issue Mar 19, 2018
allow to provide custom value formats
@ghost
Copy link
Author

ghost commented Apr 19, 2018

Hi,
this fully covers what we were talking about. Thank you.
What version of the CUBA platform will bring yarg 2.0.12 with the reporting?

@andreysubbotin
Copy link
Contributor

andreysubbotin commented Apr 20, 2018

Hi
YARG 2.0.12 is used only for 6.9 CUBA. The only beta version of CUBA 6.9 is available.
But you can specify dependency to YARG 2.0.12 in the build.gradle in your project:

  1. Add dependency for core module:
compile('com.haulmont.yarg:yarg:2.0.12')
  1. Add dependency for global module:
compile('com.haulmont.yarg:yarg-api:2.0.12')

@ghost
Copy link
Author

ghost commented Apr 20, 2018

Andrey, thanks a lot, it works well. The only thing I'd like to tell -- eventually I put our formatters classes in a standalone library because when being loaded within the app classloaders they are unavailable for yarg library (not sure that's what's going on actually, but the error is noClassDefFound). But this is just fine anyway.

@andreysubbotin
Copy link
Contributor

Thanks @wrover
I've created an issue: #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants