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

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.

Related

Jasper server error when referencing a custom function

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?

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.

Failed to run or preview report in SSRS and SQL Server Report Builder

I have a couple reports I inherited that needed updating to our new database structure. I have those changes done, but when I try to preview two of the reports using SQL Server Report Builder 3.0 it gives me the following error message:
Failed to preview report
System.Web.Services.Protocols.SoapException: Error while loading code module: ‘ReportLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'ReportLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at Microsoft.ReportingServices.WebServer.ReportingService2010Impl.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)
at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)
The other reports that I have already fixed work perfectly fine when previewing. This same error also shows up when I try to upload it to the Report Server. All of this is running off my Windows 7 x64 machine.
I'm thinking that this report is corrupted, but I don't want to have to rebuild it from scratch if that isn't the case. Any help would be much appreciated.
I believe the problem is with the header (and thus the namespace). Create or look at a working report, then compare the header (which indicates the XML version). If they are different, replace the header from the report that doesn't work with the one that works.
I have had this error a few times and it's so annoying but I am going to say I spent hours searching the web because I didn't want to recreate the report.
But in the end found nothing and had to recreate the report anyway.
Don't waste your time looking for a fix it is corrupt.

VS2005: access denied on SSRS data source

Environment: Visual Studio 2005, SSRS 2005 with Sharepoint 2007 integration
Have a project with two reports and one data source. Has already been deployed to production sharepoint farm.
Needs an enhancement. Change properties to point to test farm and try to deploy:
"Access to the path 'c:\documents and settings\\my documents....\RegLog.rds' is denied"
Path is correct, and properties of files are read-only (because the files are checked in to source control). Now, I understand that SSIS packages won't execute if they are read-only (which is stupid) but I am fairly certain I have deployed SSRS reports and data sources before without having to check them out first. On the other hand, I do know that deployment requires the file to be modified in some way. But the modified version will be in Sharepoint, not in visual studio, and its extension will be .rsds, not .rds (which is the VS name)
I also think it is unusual that the path has been lower-cased. Shouldn't matter in Windows, but it's the first time I have ever seen "documents and settings\\my documents" not all initial caps. So maybe it matters. But this project deployed before without problem.
I was having this problem as well. To fix it, I did a build of the report project (which before converting from 2005 to 2008 I'd never had to do before). Once I did that, it worked just fine.

TFS 2010: Copy _PublishedWebsites to test server

I've seen similar questions and answers but found them not really what I want.
I have a large solution with several web projects in it. All the web projects share some common code so they are all part of the same solution (there is a common project that is referenced by all of them).
I've been running on Team Foundation Server 2008 and we are upgrading to TFS 2010 to be ready for our move to visual studio 2010 and .net 4.0.
I've got the build working with a 2010 build by creating a new build because we only had one customization I'm trying to reproduce.
Once the build is done I have the files dumped at
\\SERVER\tfsdump\devel2010 build\devel2010 build_20101008.3\_PublishedWebsites
by using the dump folder option but the build location is
C:\Builds\1\Web Applications\devel2010 build\Binaries\_PublishedWebsites
All I want to do is after the build is finished I want to copy _PublishedWebsites\SiteA to \ServerA\ShareA
and copy _PublishedWebsites\SiteB to \ServerB\ShareB
Because there is only one build agent all I need is to call a batch file to run the copy but for easy of use for my developers I need this batch file to be called after every build. Is this possible or is there a better solution?
To make things harder the site is still a 2008 project and it is requested that it stays that way until we can fully test it under VS 2010.
Use a CopyDirectory build activity, set Source property equal to BuildDetail.DropLocation + "\_PublishedWebsites\SiteA" and set Destination property to your desired location. I have put this activity as the last activity in build process and it works properly.
Taking a cue from Afshar's answer, for people directly editing XAML template file, create a new sequence after copy to the Drop location is successful:
DisplayName="Something" Source="[BuildDetail.DropLocation + "_PublishedWebsites\SiteA " ]" />
The quotes inside should be written as &quot and semicolon.