ssrs subreport not showing when compiled via web app - service

I have this report which uses a tablix and on one of the rows I have a subreport.
Now in development preview everything works as expected. On the server instance online page it works flawlessly.
When I get this report via my web application and send it (.pdf) to a user the subreport doesn't render. Any ideea why?
Exact error is: Data retrieval failed for the subreport, 'Subreport12', located at: *. Please check the log files for more information.
there is nothing in the log files to help me.

With the web-app it is not able to find the path of subreport. Instead of relative path give the absolute path in the report design.

Related

Jaspersoft Studio - not realoading subreport content from server in preview

I'm having trouble with subreports in Jasper studio. Currently I'm working on template where I would like to add header / footer / maybe title as subreports. The reason is that I have around 100 reports where I want to add this "shared footer/header ... " so that if anything changes in future I would only have to change it in one file.
About
For example I have my main report that contains two subreports header / footer. When I upload all these reports to server and run main report, it works fine.
Let's say that I change text in header and I upload it to server and again run main report I can see changed text in header.
Problem:
Now when I work on this report locally and I hit Preview I always see some cached version of that subreport from very early stage when I was making this header subreport.
What I tried:
added -clean to .exe (target)
deleted folder in file:/C:/Users/..../AppData/Local/Temp/
Project - Clean - Clean all project
restarted PC
Subreport settings:
Using cache : false
Expression: "repo:/....."
So far I do not know, where could be the problem... why does the preview tab just do not update that subreport content. How can I remove that cache ?
My solution:
How I managed to make it work is that I went to repository explorer in Jasper Studio I've located my "footer subreport" and I've clicked to that little arrow that opens all files for that report and I used "Open in editor" for main_jrxml file. When I compiled this file I was able to use newest version of this subreport in my main report preview :)

Jasper Reports: how to dynamically adress a report unit as source for subreports

I have a report that needs to be delivered with a dynamic custom header.
To accomplish this, I used a subreport element that uses a header-type parameter to link to the correct header subreport.
This works fine in Jaspersoft Studio, but i cant get it to work on the server itself.
I already copied the folder structure thats on the server within my developemnt workspace so that path would be the same on both systems but no luck.
I guess I am doing something fundamentally wrong.
I have uploaded my header-subreports as individual report units within a headers folder.
Then, I uploaded the main Report which should use one of the headers depending on a parameter.
No matter how i change the subreport expression, the main report never works, while i can perfectly access the header on its own.
Here is some of the things i tried already, if at all they only worked in the dev studio:
standard path: "/reports/aaaaa/headers/"+$P{P_HEADER}+".jasper"
repo path: "repo:/reports/SecondaryDB/Headers/"+$P{P_HEADER}+".jasper"
tried omitting +".jasper" because i cannot see an actual jasper file, just a report unit.
tried to replace +".jasper" with +"/Main.jasper" or "/Main.jrxml"
tried using single or double backslash instead of forward slash
tried using the full external url to the header report
none of that seemed to work.
A thing I have not tried, including the headers right with the main report.
This is because I need to maintain the headers as a single, globally available instance, rather than having compiled copies of them in every single report.
Can someone plase give me an example how this can be achieved?
Thanks to folks on the tibco board, I got a hint in the right direction.
So apparently, my mistake was to upload the subreports as Report-Unit.
Now I use a plain folder with plain jrxmls, and no file extension in the subreport expression - that works now.
But the other thing that confused me a lot, is that somehow my subreport expression gets altered while uploading.
My local developement file had it set to "repo:/reports/SecondaryDB/Headers/"+$P{P_HEADER}"
The upladed File had instead "repo:A_SPECIFIC_HEADER" and got rid of the path as well as the parameter, I guess JasperStudio did that implicitly.
I had to open my report unit and manually alter the main.jrxml on the server to set the subreport expressions back to what they should have been.
Only when I found that out, I finally got some results.
Follow-up Question:
Anyone knows a way so I can use the same configuration for local dev as well as on the production server?
Manually altering subreport expressions whenever uploading changes is not exactly an elegant way to roll out reports.

iReport doesn't see the data from JasperServer

When I connect to a Jasper Server via iReport Designer and choose a report from it I can see a report template but when I click preview I can't see the data of report. Besides that when I go to Jasper Server web page and choose the same report I can see the data without any troubles. Could please explain me why it happens and how I can resolve this issue? Thank you in advance!
Right click on the Report in the Repository Navigator and then click Run JasperSever Report. This will execute the report on the Jasperserver and present you the result.

iReport: Uploading Image to JasperServer (fail)

I am currently using a JasperServer repository to hold reports. I would like to include an image of a logo in the upper-right hand corner of the report. However, every time I attempt to add an image to the resources I get an error that says:
Error:1 - 0
Any guesses?
This is how I did it:
Create a report on Ireport with a picture on it (e.g. logo.jpg)
Edit the .jrxml file using a text editor.
Search for the image file name. You will find the file name (with full path) in a cdata tag
Change it to <![CDATA["repo:logo.jpg"]]>
Save and Upload the report to the JasperServer
Edit the report and choose Controls & Resources.
Add a resource, select the image file (e.g. logo.jpg) and name it exactly as logo.jpg.
Submit and... run... the report :)
When you open the file again on iReport, it will only show an image generic icon...
The most likely reason for the error that you are seeing is that there's a problem with the web services configuration. The most likely problem is that the image is greater than 16Kb, so Axis needs to save the attachment to a temporary directory. A useful test is to make sure that images smaller than 16Kb work with no problems.
Your quickest workaround is to upload the picture via the JasperServer web UI. Then your report should work as expected. If so, it's also validation that the problem is with web services (not with the repository database or some other component).
The most likely permanent solution is to recursively change ownership of the directory .../webapps/jasperserver/. Or you might prefer to only chown .../webapps/jasperserver/WEB-INF/attachments. Or you could change the attachments directory by editing this line in server-config.wsdd:
<parameter name="attachments.Directory" value="attachments"/>

Changing Crystal Reports reports shipped with an application and a runtime version

We have a purchased application (I'm told it's .NET, it's client server, running on Windows XP, connecting to SQL Server 2005) that uses a Crystal Reports runtime and separate report files (.rpt) to do it's reporting function. I have a copy of the CR Designer program but we don't have the CR Enterprise software. I can open the reports in the designer, get to the SQL Server data source (and any others, I guess), add them to the report, run it, print it -- but I can't figure out how to use the same Datasource, which is a subset of the tables in the database that it's connecting to, to do it, and I can't figure out how to save the report files so they'll work with the application. Real gravy would be coming up with new reports.
Is this even possible?
If you open up the report and then go to Database, Set Datasource Location, under the Properties section you will find a lot of info about the datasource and where it is getting it's info from. If the purchased application is creating its own datasource internally though and supplying it to the report at runtime, the best option that I can think of is to start a trace on the SQL Server and then run a report. You should be able to see the SQL that is issued by the Datasource and replicate it in your own version.
You have the possibility to manage your connection's properties at runtime (ie while launching CR from your app). Here is a proposal: Crystal Reports Datasource remap
If you cannot access your app code, you should then do as proposed by #Anthony, by updating all your connection strings in your rpt files, save the rpt files, and copy then on the corresponding report folder of your app: you might have to find where it's located in your system.
First of all, you'd better make sure you're not violating the application's license agreement by attempting to add to it in this way.
It may simply not be possible to add reports to the app in any case - it depends how it loads them and what it does with them.
To use the same datasource, you should just be able to open one of the .rpt files, then go to File > Save As, and give it a new name. Then modify it to what you want. Of course, if you don't know the authentication credentials the app passes to the report to connect, it would be tricky to test it.
It would help greatly if you gave us the name of the purchased application, as we don't really know what you're up against.
It could be that the application is passing through a filter of the data. So when you run the report from Crystal Reports Designer you get the whole data base, however when run through the program the parameters being passed to the report restrict the data back down.
Create a backup of the report. Then edit the existing report, make the changes you require, preview the report to get an idea it looks right, save the report and run the report via the application.
Warning:
As it has already been stated some vendors may not allow you to edit existing reports, your warranty/sport may be voided by editing existing reports, or reports could even be overwritten on the next update.