Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Re: Dynamic Report Creation At Runtime

$
0
0

Hi Ludek,

 

I have made quite a bit of progress since I last posted on February 21, 2015.

Since then I have been able to establish a connection to the SQL Server database (2005) using Microsoft integrated security.

 

I created a dummy crystal report from within Visual Studio 2013, set the source to a stored procedure which takes 2 parameters (year and quarter), and created a parameter for year and for quarter.  I saved this dummy crystal report in my project.  I also copied the dummy crystal report to my hard drive.

 

So far I have done the following in C# code:

 

1)  Created a text field and placed it on the page header.

 

2)  Created a formula field and placed it on the page header.  The formula takes the parameters for year and quarter passed in and creates a string like "1st Quarter 2015".

 

3)  Created database fields and placed them in the detail section.  The fields created so far are Rank, Branch Name, Branch Number, Goal1, Actual1, Needed1, Percent Of Goal1, Points1.  They correspond to one category, New Checking Accounts.  I placed the category name (in this case "New Checking Accounts") in the page header just above the fields after branch number.  For first quarter of 2015, there are a total of 6 categories.  So there will be Goal1 through Goal6, Actual1 through Actual6, etc.  As of now I created variables for just the first category "New Checking Accounts" and have done a lot of hard coding.  I shall go back and look to generate the fields for the remaining categories using a loop and possibly arrays.

 

4)  Created a formula field to sum Goal1 for all the branches.  Placed it on the report footer section.  I'll go back and create formulas to sum the other 5 fields (Actual1 through Points1).  Eventually the sums will be for all categories.

 

Needless to say I have also changed the font name, size, and weight.  I have changed other properties of the fields.

 

Once I have completed the last sentence in step 3 above and have gotten it to work, I shall attempt to do all the same except without the dummy crystal report, that is, to take it a step further.  When I am finally done with this, I shall post my code here.

 

You are quite correct, the InProc RA SDK API's are not trivial.

 

I have only gotten this far by reading what I can find on the SAP web site, reading the sample code, the API documentation, and using logic to try different things.  When I was stuck I tried to break the problem down to a simpler problem and try that.  Sometimes trying something in the designer helps solve a problem, especially in debugging formula issues.

 

Martin


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>