cancel
Showing results for 
Search instead for 
Did you mean: 

Transition from Crystal Reports Creation in ASP.NET to Aurelia Framework Help

Former Member
0 Kudos

Hello,

We have been using Crystal Reports for Visual Studio 2015 (currently using Version 13_0_15).  We write our rpt files in Visual Studio and store them on our web server.  We have a custom client interface system which allows clients to utilize some custom filters for each report.  Each report is a self-contained page which houses the:  <cr:crystalreportviewer> on the aspx page.

In our aspx.cs we create our reportObject and Load our rpt file.  We then move through each reportSection within the reportObject and set the datasource to a datatable of results.  This datatable is generated from a query that we store and run at the time the users clicks on the report.

That's great.

But we are transitioning away from ASP.NET entirely.  We will be moving our architecture to a Javascript Framework called "Aurelia."  It's very similar to Angular in many ways and the for the purposes of this post you don't need to know much about it except to say that we now need to view the Crystal Reports using Javascript somehow.

Within this new architecture much is the same.  We will still be storing the rpt files on the same webserver location and still be using Visual Studio to develop the reports.  The queries will be generated at the time the user requests the report (just like before) except now this query will be run using WebAPI instead of ASP.NET webform.  The report will be a self-contained page (just no asp.net now). 

I make a WebAPI call to get all the "datatables" of data which the report will need.  I am storing them in an Array of Objects for the main section and for each subsequent SubReport Section on my Aurelia page (the javascript which they refer to as the View-Model).  I have all this completed and it's so much more efficient now then before. Yay!

But somehow, we have to invoke a crystalviewer platform in Javascript to create the report and "Set the DataSource" to each Report Section from these data objects in Javascript.  I've ready many posts and documentation pointing me to BIP servers and "ViewSeed.js" files and tokens and Report Instance IDs.  I've gone over them for hours and can't even figure out where to start frankly.  It's depressing really.

I'm not sure how to get all this working.  It's terribly confusing for me and I'd love to get a step by step based on our particular situation.  It's possible we are missing something fundamental here that I'm just to ignorant to catch.

Here is what I've learned from the posts thus far from my research online:

  1. Set up head, style and body opening and closing tags. 
    1. Ok


     2. Add a script tag within the head tags and use it to reference ViewerSeed.js.

<script src="http://<hidden servername:port>/clientapi/CR/ViewerSeed.js"></script>


    1. Need to find out where to get this mystery js file
    2. Is this wear installing this "BIP Server" comes into play (Where does one go to install this server?)

     3.Create a token variable, which will hold the logon token and set it to null.

    1. Ok


     4. Create a function called init that sets the value of token to the logon token and creates a new JavaScript viewer instance. Refer to the Business      Intelligence Platform RESTful Web Services Developer Guide for information on generating a logon token.

function init() {

    token = "<hidden token>";

    SAP.CR.Viewer.create("crystalViewer", 'viewerContainer1', onViewerInit, onViewerFailure);

  }

    1. No idea how to get this token.  Are there instructions somewhere for this?

     5. Add a function called onViewerInit that sets the report source.  The reportID is the numerical code assigned to a report. You can discover the            report ID programmatically or through the Central Management Console (CMC). When you right-click a report in the CMC, the report ID is be              listed with the report properties. For more information see the SAP Crystal Reports RESTful web services API.

  function onViewerInit (viewerInstance) {

    viewerInstance.setReportSource('<instance id>', token);

  }

    1. I don’t know what this means at all.  Are they saying I need to "upload" the rpt file to somewhere and it then gets some kind of id?  How do I set the datasource at this point.  I don't see anything indicating how to accomplish this based on how we are currently doing things with Crystal Reports.


     6. Within the body tag set onload event handler equal to the init function.

    1. I’m pretty sure we can do this in the "attached" method of Aurelia.

I'd be willing to submit a support ticket and pay for someone from SAP to assist us with this process if that is what it will take.

Sorry if I have this in the wrong Discussion group.  I figured that since I was moving FROM Crystal Reports for Visual Studio to another framework it might pertain to the topic.  If not, please feel free to move it Ludek if you can find a better location.

Kind Regards,

Lawrence Giles

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

There is a java-based viewer available in SAP Crystal Reports for Eclipse.  Information about how to download and install it is available here: 

-Dell

Former Member
0 Kudos

Thank you for responding!

  Is this supposed to be a better/easier alternative to something I'm missing?  Could you please point me to an example of utilizing the Java-based viewer to invoke the crystal report after having gathered the dataset(s) and rpt file in Javascript possibly?

Much appreciated!

DellSC
Active Contributor
0 Kudos

This is the ONLY way to view the report if you're not using the .NET SDK or BusinessObjects.

The URL I gave you has links to sample code.

-Dell

Former Member
0 Kudos

I think we may be talking about 2 different things here.  I'm not talking about Java.  I'm talking about Javascript.  We aren't using Java in anyway.

I'm trying to parse through the Javascript RESTful documentation (which I go through above with my comments concerning how it's supposed to work)

I'm working off this thread:

Crystal Report Instance with JavaScript Viewer API | SCN

I'm trying to figure out what this has to do with Java?

Thanks!

0 Kudos

Moved to RESTful Forums.

CR for .NET  does not use JS nor does our Java SDK's.

DellSC
Active Contributor
0 Kudos

However, the RESTful Web Services are only available for Crystal Server or BusinessObjects and they don't necessarily work with "classic" Crystal reports, just with Crystal for Enterprise reports.

-Dell

daniel_paulsen
Active Contributor
0 Kudos

The CR Javascript API is designed for reports hosted and managed by a Business Objects Enterprise server, so you will not be able to use this API to load a report directly from the file system.

The reportsource property of the viewer takes the ID of a managed report and a logon token retrieved from logging onto the Business Objects BI Platform server.

The back-end servers handle the processing of the report, the Javascript API allows client-side viewing, but not the processing.

Dan

Former Member
0 Kudos

Thank you Dan.  That is the information I needed!

Answers (0)