Why do I get current expression is not valid using JRDataSource? - jasper-reports

I am trying to use List into the jasper report using JasperSoft Studio, but while defining dataset the JRDataSource expression is showing as invalid even after casting REPORT_DATA_SOURCE to the JRXmlDataSource(find image below).
Expression
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/Header/FileName")
Error
The current expression is not valid. Please verify it!
The error is looking so weird and I am not able understand it what is wrong here.

Do not worry about it, this is a bug in the IDE.
If you can't close the expression editor, edit the expression manually in the xml view.

Related

Jasper Reports: how to add own Functions to Expression Editor

I am using Jaspersoft Studio 6.6 and try to add own functions to the Expression Editor.
Therefore i follow the tutorial Jaspersoft Studio Expression Editor: how to extend it and contribute your own functions (part 2) - updated for version 5.5 (i was not able to find a more current version so i guess this one should be still correct)
All works fine but i had to replace the language of the generated report (SampleFunctionsReport.jrxml) from groovy to java to get rid of class not found exceptions
Finally the following Errors are remaining:
Description Resource Path Location Type
The method HELLO_WORLD_MSG() is undefined for the type SampleFunctions_1541665022158_603382 SampleFunctionsReport.jrxml /MyFunctions line 37 JRXML Problem
The method HELLO_WORLD_MSG() is undefined for the type SampleFunctions_1541665022158_603382 value = HELLO_WORLD_MSG( ); SampleFunctionsReport.jrxml /MyFunctions line 0 JRXML Problem
The method REPEAT_MSG(String, int, boolean) is undefined for the type SampleFunctions_1541665022158_603382 SampleFunctionsReport.jrxml /MyFunctions line 52 JRXML Problem
The method REPEAT_MSG(String, int, boolean) is undefined for the type SampleFunctions_1541665022158_603382 value = REPEAT_MSG("A message that will be probably repeated",5,true); SampleFunctionsReport.jrxml /MyFunctions line 0 JRXML Problem
I checked the points of the tutorial a couple of times...
can someone reproduce my problem?
What am i missing?
<import value="test.customfunctions.*"/>
this is the code from my jrxml, which is fine.
when i tried to enter the full class name - i got an error, that the package cannot be added.
today i tried the same again - and its working. even the resulting XML is identical!

how to verify text present in placeholder in selenium IDE

I want to verify the text present in placeholder. I have located the element and i am using Assert text command. I've entered the same string in value. On executing it is showing actual value did not match
Use assertAttribute or verifyAttribute command.
Example:
verifyAttribute | css=#search#placeholder | Sample String
Notes:
In the Target column of Selenium IDE, you need to provide the proper path of the element followed by an # sign
and then the name of the attribute. (placeholder in your case)
Using
verifyAttibute will still continue running the test case once an
error is detected while using assertAttribute doesn't.
You need to understand that assertText function can only check static text on your webpage.
You must be getting an error message.
This is perfectly normal.
What can help in this situation is using the assertAttribute or verifyAttribute functions.
Both these functions perform the same task; the former stops the test after receiving an error message in the text box while verifyValue just records the error in the log and runs the next commands.
While giving the target, either specify the XPath or refer by using the name=name#placeholder format.
You can find the name value by inspecting the box with a firefox addon called Firepath which runs with another firefox tool called Firebug. Install them if you don't already have.
Hope this helps!
Xpath contains() is the best way.
driver.find_element_by_xpath('//input[contains(#placeholder,"email")]')
Format : '//tag[contains(#attribute,"value")]'

iTextSharp error, casting IncCell to Rectangle

I've been asked to look at C# code that's returning the following error:
Unable to cast object of type
'iTextSharp.text.html.simpleparser.IncCell' to type 'iTextSharp.text.Rectangle'.
at iTextSharp.text.pdf.PdfDocument.Add(IElement element)
at iTextSharp.text.Document.Add(IElement element)
It looks like they're using iTextSharp v5.0.2 and have not yet moved from HtmlWorker to XmlWorker.
Questions:
What is IncCell? I see it in the source docs but can't find any info about what it is - I'm assuming it's just for internal use.
Is this related to a cell in a table? A need for a Div or Paragraph within a cell?
What can they do to diagnose issues like this down to the HTML source that caused the error? I suspect this is an issue with not conforming to XHTML, but I can't verify that without knowing exactly what IElement that code was working on when it choked. It could be due to bad styling too, I have no idea at this time. Is there any kind of detail logging that will tell us what element is being processed at any given time? Should I just get them to load source and trace through it?
Is it probable that this will be fixed with an update to the latest version (currently 5.5.9), and a re-fit of XmlWorker?
Other recommendations?
Thanks!

Why is iReport throwing me these subreport exceptions?

I am new to iReport and all I have done so far is simply run an already compiled report. In fact it's a report that we are currently using so there should not be any issue. Though, when ever I run the report I get thrown this error message
 Compiling to file... C:\Program Files\Fishbowl\reports\Custom\PackingListTacticalMedical2015.jasper
 Compiling subreports....
 Subreport C:\Program Files\Fishbowl\reports\Custom\SOPackingListTacticalMedical2015.jrxml already compiled.
 **Unable to locate the subreport with expression: "$P{cbLayoutFormat}.equals("standard") ? $P{path} + "POPackingList.jasper" : $P{cbLayoutFormat}.equals("carton") ? $P{path} + "cartonPOPackingList.jasper" : $P{path} + "POPackingListLoc.jasper"".**
Compilation running time: 13,619
The report does still run and compile but when ever I am prompted to "Enter a shipID" - and I do- the results are blank. I know what the message is saying, I just simply do not understand what it means.
Thanks to anyone that can help with instructions or explanations on this.
Try to change expression datatype of your subreports to InputStream instead of String (path), and then passe your subreport as input stream as a parameter.
Put your subreport in the resources dir. and compile it.
InputStream subReportStream=getClass().getResourceAsStream("subReportName.jasper");
params.put("SUBREPORT_STREAM", subReportStream);
this work fine for me.
With the way Fishbowl inserts it's run path into the $P{path} parameter you need turn off the compile subreports option when compiling and making changes to the the report. Also with the manner in which Fishbowl overrides the parameters at runtime you'd have to know all of the database ID's you're looking for if you want to run it from within iReport instead of inside Fishbowl.
The easiest work around for this is to have the reports compile to the their working directory and you can refresh inside Fishbowl as you compile changes to the reports.

JSON schema validation failed: resource: String does not match pattern:^/[^/~!#\$%^|\s`#&*()\-+={}\[\]:;"'<>,?/\|\\]+(/[^/~!#\

I'm trying to embed Jasper Reports into APEX App. I'm able to gather reports from samples (samples on JasperCommunity website), however, when I'm trying to get created by me and colleagues reports - every time I have the same error:
JSON schema validation failed: resource: String does not match pattern: ^/[^/~!#\$%^|\s#&*()\-+={}\[\]:;"'<>,?/\|\\]+(/[^/~!#\$%^|\s#&()-+={}[]:;"'<>,?/\|\]+)$.
In other words I can't get any of our reports apart from the samples (e.g. /public/Samples/Reports/03._Store_Segment_Performance_Report"). I think the case is that the path to the Report is wrong, but I've tried all possible and impossible options and none of them works. Anyone any ideas please ?! Thanks
P.S. APEX 4.2.6, JasperServer 6.0. And finally, I can get samples Reports ONLY under the JasperAdmin user, simple User always got an error - 'Access Denied'. Why ?!?!?!
Sorted.
If anyone interested - when specify the actual path, in Jasper: right click on Report(or Dashboard, AdHocView etc.) and copy the path from it. As it differs from when you point mouse on it (e.g. adding the underscores etc.), and paste this actual path into your javascript code into HTML section in your web app. Thanks