Jasper server error when referencing a custom function - jasper-reports

I am using JasperStudio v6.3.1 and I followed the tutorial on how to create a custom Java function that I can use in my report. Everything works fine in Jasper Studio, but when I publish the report to the Jasper Server, then it fails. The report does exist on the Server, but does not run after publishing the latest changes.
"Errors were encountered when compiling report expressions class file: 1. The method CURRENT_MONTH_BEGINNING() is undefined for the type TotalTaskHrsOnly..."
This error is generated because the custom Java functions that I made in Jasper Studio did not get published to the remote Jasper Server. I need help with getting these files onto the Jasper Server, but I'm not sure how to do that within Jasper Studio, Jasper Server, or if I need to log into the remote server, and drop the java files in there somewhere. Can someone please tell me how I can add the custom functionality onto the Jasper Server?

I worked with custom Java functions in Jasperserver reports for quite awhile. Some of the things you will need to ensure:
You import the java class at the top of the Jasper report .jrxml file
The Jar is deployed to the server and is labeled as a resource in the repository. It looks like this is the part you're getting stuck on. If you log into Jasperserver and go to the repository, you can open a folder and upload a new file/resource.
The report references the jar in the repository as a resource
Does this help?

Related

SSRS 2008 R2 Correct Generation of .rsds for SharePoint

I've put together a PowerShell script to deploy some reports and corresponding datasets and datasources as well as link the embedded dataset references to the shared datasets but getting stuck at specifying the shared datasource for the shared dataset.
So initially I had to rename the .rds to .rsds for it to show up as a selectable datasource via the SharePoint UI. I'm getting an error though when I programmatically or manually via the UI set the DataSource for the DataSet saying the schema is wrong. So I've tried running the Build->Deploy from BIDS and then downloaded the .rsds to see the difference. Turns out the BIDS version which is what gets built looks like this:
<?xml....?>
<RptDataSource...>
<ConnectionProperties>
<Extension>SHAREPOINTLIST</Extension>
<ConnectionString>...my sharepoint site url...</ConnectionString>
<IntegratedSecurity>true<IntegratedSecurity>
</ConnectionProperties>
<DataSourceID>...some guid...</DataSourceID>
<RptDataSource>
whereas BIDS generates this for SharePoint when doing Build->Deploy
<?xml....?>
<DataSourceDefinition>
<Extension>SHAREPOINTLIST</Extension>
<ConnectionString>...my sharepoint site url...</ConnectionString>
<CredentialRetrieval>Integrated</CredentialRetrieval>
<Enabled>True</Enabled>
</DataSourceDefinition>
So, is there a built in way (either in BIDS or an existing PowerShell module/script) to get this generated when building locally rather than running a Deploy or am I going to have to run some xslt to transform it (Or just copy an existing source file and replace the connection string as it's the only thing that matters) and rename as a post build process?
Roighto! I found that there's a way to create a datasource via the ReportingServices2010.asmx service. Using that and ignoring the .rds written when building the project in BIDS.

SSRS - Credentials on reports after deploy do not match source rdl file

The project I am working on has been having the issue of stored credentials in the rdl files not being reflected on the server we deploy to and it seems to be inconsistent in its behavior. We are NOT using a shared data source because we have to generate the data source connection dynamically so each report has its own data source embedded (even though they are all identical) and it has the credentials stored. I look in VS at the rdl file and see the credentials are stored, deploy to our test server, look on the test server and the credentials are set to "Not Required". Other strange thing is this doesn't happen to all reports all the time, some reports keep their credentials but not every time. It all seems very random.
Some settings and facts about the project that may be useful:
Using SQL Server 2008 R2
Using Visual Studio 2012 to deploy
ReportProject setting OverwriteDatasets = True
ReportProject setting OverwriteDataSources = True
I have had similar issues, delete the report on the SSRS server first, then deploy the report. SSRS does retain certain attributes of report it is very inconsistent when it does this and this is more of a workaround than an answer, but it works for me.

RDL vs RDLC woes when using custom code and subreports in a local report

I'm having a rather complicated problem with SSRS.
First off, we are using Local reports. We have to because the data we are using comes from rest services.
Secondly, we have build a custom library for our reports called ReportFunctions that we want to use.
We are using sql server data tools to build the .rdl (Not to be confused with RDLC) and then we copy the file into our VS project. We set build action to Content and Copy If Newer.
This works great for all of our base reports. We can even use the custom library.
Now we want to use some of these base reports as sub reports. Let's call this report "AllReports". It consists of a "SummaryReport" and a "DetailReport".
Summary and Detail are two RDL files that also need to be loaded independently.
In the code for building AllReports, I have this:
reportViewer.LocalReport.SubreportProcessing += LocalReport_SubreportProcessing;
reportViewer.LocalReport.LoadSubreportDefinition("SummaryReport", File.OpenText(Server.MapPath("SummaryReport.rdl")));
reportViewer.LocalReport.LoadSubreportDefinition("DetailReport", File.OpenText(Server.MapPath("DetailReport.rdl")));
private void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
{
//Set e.DataSources here depending on e.ReportPath
}
When I run SummaryReport or DetailReport, they work fine. When I run AllReports I get an error:
The subreport 'SummarySubreport' could not be found at the specified location C:\path\to\my\project\Reports\SummaryReport.rdlc. Please verify that the subreport has been published and that the name is correct.
For fun, I switched the extension of the two sub reports to .rdlc Then I get a build error when I compile in visual studio:
Error while loading code module: ‘ReportFunctions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d88351e3d4dffe2f’. Details: Could not load file or assembly 'ReportFunctions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d88351e3d4dffe2f' or one of its dependencies. The system cannot find the file specified.
DetailReport is the one that uses the external library of custom functions.
I cannot place my DLL anywhere on the server except in the bin of the project. I can't stress this enough. I also cannot move to server reports. I have to use local reports.
If I set the build action to None on the RDLC, it works, but when I deploy my RDLC is not published.
Can I get the RDLC to compile? What am I missing to make my report viewer use an RDL instead of an RDLC for my subreports?
After 11 hours of working on this problem, I discovered the build server was assigning revision numbers to all libraries when they were built. So, locally ReportFunctions would be given 1.0.0.0 as the version and everything was cool. Then when it was deployed the build server would do its thing and the reports would break.
To anyone else having this issue, check the version numbers of the compiled DLL's, especially if you are using a build process.
Also, to get around the compile issue of the RDLC, we switched the build action to None and we set up the build server to copy any RDLC files over manually once the build succeeds.

Report deployment on JasperReports Server

I have created a master report along with a sub report.
I run the report in iReport, it works well. I deployed it on JR Server and added the subreport in Resorces folder. Also I changed the subreport expression value. When I run the report through the jasper server, following error occurs:
1 - net.sf.jasperreports.engine.JRException: Error opening input stream from URL : repo:emp_count_subrep.jrxml
Please guide.
Check the xml source, you will find subreport reference to the .jasper file, just change the extension to jrxml and ti will work, at least it worked for me

Jaspersoft ireport designer 4.5.1 /4.6.0 & hive

I am trying to design a report using hive connection.
I created hive connection and tested it is working ok.
Is there anything i am doing wrong. I am new to iReport.
jdbc:hive://192.168.254.132:10000/default
I am using report designer, I typed in my HiveQL it gives REPORT_CONNECTION parameter not specified.
I have specified the hive connection.
i tried simple query, select * from iptable.
message:
net.sf.jasperreports.engine.JRException: Parameter "REPORT_CONNECTION" does not exist.
Level:
SEVERE
Stack Trace:
Parameter "REPORT_CONNECTION" does not exist.
com.jaspersoft.hadoop.hive.HiveFieldsProvider.getFields(HiveFieldsProvider.java:88)
com.jaspersoft.ireport.hadoop.hive.designer.HiveFieldsProvider.getFields(HiveFieldsProvider.java:32)
com.jaspersoft.ireport.hadoop.hive.connection.HiveConnection.readFields(HiveConnection.java:154)
com.jaspersoft.ireport.designer.wizards.ConnectionSelectionWizardPanel.validate(ConnectionSelectionWizardPanel.java:146)
org.openide.WizardDescriptor$7.run(WizardDescriptor.java:1357)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Well, this is a little embarrassing. The wizard worked fine in iReport 4.5.0. But it broke in 4.5.1, and somehow no one noticed it. Reports still work fine, so the bug evaded tests. It seems to affect only the Fields Provider. So it shows up in the wizard but not when running the report.
I uploaded a fixed version of the plugin seconds ago. You'll need to uninstall the existing Hadoop Hive plugin, then restart iReport, then install the updated plugin. Then all should be well.
Here's the general project link. Here's the new file linked directly. This should all be obsolete when the next version of iReport ships with the fixed Hive plugin.