cancel
Showing results for 
Search instead for 
Did you mean: 

Loading SubReport Dynamically from .rpt file using C#

Former Member
0 Kudos

Hi All,

This question has probably been posted and answered by others a thousand times, but I'm hoping to receive a positive response

It is straight forward to load a report dynamically from a file using something like this (c# code):

ReportDocument repDoc = new ReportDocument();

repDoc.Load(repFilePath);

CrystalReportViewer1.Visible = true;

CrystalReportViewer1.ReportSource = repDoc;

CrystalReportViewer1.RefreshReport();

However, I have a requirement that consists on a Main report with 3 subreports, but where those subreports need to be loaded dynamically. For example, you may want to load reports "1.rpt", "2.rpt" and "3.rpt" in one occasion and reports "a.rpt", "b.rpt" and "c.rpt" in another occasion.

The main reason for this is that 1 PDF has to be created from the reports, and doing it this way would save me from having to use 3rd party tools to merge the PDFs (if I were to load each report separately).

I've spent hours looking around for a valid solution but they all point to RAS, and I'm afraid it is not an option for me.

I've tried using iterations of the following without any success:

  • repDoc.OpenSubreport("subreportName")
  • repDoc.Subreports["subreportName.rpt"].Load("strFilePath");

Any help would be appreciated!!

I'm using C# with VS2008 (framework 3.5), but upgrade to 4.0 and VS2012 is an option if it helps...

Thanks in advance for any answers!

Regards,

Gonzalo

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Gonzalo

RAS is the only way. Why is RAS not an option for you?

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Ludek,

Thanks for your answer.

As far as I know, there is a "high" cost associated with RAS, and this is mainly the reason for not considering as an option, because my clients will rule it out as soon as they hear they will have to purchase it.

What are your thoughts on that?

Regards,

Gonzalo

saurabh_pathak
Active Contributor
0 Kudos

Hi Gonzalo,

There is no cost involved if you use free version of CRVS with VS2012 and it has RAS (inProc) which very well can be used with Windows & Web Application.

You can find relevant downloads for CRVS here.

http://scn.sap.com/docs/DOC-7824

Developer's guide can be found here.

http://scn.sap.com/docs/DOC-27465

~ Saurabh

Former Member
0 Kudos

Saurabh,

I'm after talking to a couple of guys in SAP and they confirmed that there is a cost involved in using RAS (aka Crystal Server).

I'm not referring to a license from the developer's perspective. I am referring to the cost associated to the licence of RAS on the production server once the application is deployed.

Thank you for your answer anyway.

Regards,

Gonzalo

former_member183750
Active Contributor
0 Kudos

Hello Gonzalo

There is no cost to using the InProc RAS SDK / APIs in WIn apps. The runtime is freely distributable for Win apps. For web apps, there is an extra licensing if deployed outside your organization.

Please see the following on how to work with the InPRoc RAS SDK:

How to Use The RAS SDK .NET With In-Process RAS Server

Please do not confuse RAS SDK with SAP Crystal Reports Server, which is essentially a scaled down version of Business Objects Enterprise.

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Ludek,

Thanks again for your contribution. However, the requirement is to deploy it embedded on a web application for clients outside our organisation.

Also, this web application would be deployed to more than 1 location (several clients), and that is where I believe the cost issue arises.

So, is it correct to say that in my scenario as cost will apply? If so, what would that cost be? I've only been provided costs for Crystal Reports and Crystal Reports Server licenses, so if a different license applies, please let me know.

Regarding your link provided, I can see the following:

"New in version XI, however, is a server-less version of the RAS technology referred to as In-process RAS. In-process RAS allows the RAS .NET SDK to process reports without a RAS server. The deployment package for an in-process RAS.NET application need only include the .NET assemblies, which are available for download as merge modules from our support site."

Can you confirm if the RAS.NET SDK is compatible with the .NET Framework 3.5? And higher? Unfortunately none of the links to merge modules, etc seem to be working since they still point to the old business objects site

On your last note, strangely enough, when talking to other SAP guys they were using RAS and Crystal Server as if they were referring to the same thing (i.e.: the same product but being renamed to the latter in the latest version), so apologies if I got this wrong.

Regards,

Gonzalo

saurabh_pathak
Active Contributor
0 Kudos

Hi Gonzalo,

Not sure what lead you to this conclusion, but here are some of the things that you might want to consider:

CRVS

  • CRVS (13.x) is free version for Crystal Reports
  • CRVS(13.x) comes with a version of RAS called inProc RAS which is free & does not require any license.
  • Runtimes for CRVS are free and can be used on any machines (Windows only).

Crystal Reports Server (CRS2008 & CRS2011)

  • CRS is not free and requires a license.
  • It comes with a version of RAS often called as Managed RAS.
  • Runtimes for the same have to be downloaded separately and available to those who have access to SMP.

RAS .NET SDK (Managed & inProc) works with .NET Framework starting from 1.1 depending upon the product you choose. So as far as CRVS is considered you should be able leverage RAS .NET SDK for .NET Framework 3.5.

You can find the runtimes  for CRVS here :

http://scn.sap.com/docs/DOC-7824

SAP guys must have educated you about Enterprise Suite. For e.g. BOE XI 3.1 CRS2008, BI4.0 or CRS2011 as these also contains RAS and requires license.

Hope above explanation helps to clear most of the doubts you have.

~ Saurabh

Answers (0)