By default, crystal report will automatically display the page header in each page. But if there is more than one report, where now I have few subreports in a report where each subreport contain its own page header, it will not display the page header in a new page. I have tried to use this method and it works to display the page header for each subreport in each page.
In each of the subreports,
1. add a formula field.
2. Put in this formula in the formula field as below
3. Group by the formula field
4. Put all the columns to the group header section
Each page header will be display nicely in each page.
Lately I’m been involve in a lot of crystal reports and one of them is a cross-tab dynamic report which will grow vertically and horizontally. There are a lot of ways to do it. And I think the most easiest way is to use the cross-tab function in the Crystal report which directly pump in all your data and let the crystal report do the rest. Unfortunately, it is too late for me to realized there is such function to use, and I used the way of coding which will faced some challenges in the midst of preparing the format of data before putting it into crystal report and display it.
OK. Here is just something to share for those who wanna use such method to display your data. This is what I’ve done, and may not be the most efficient way to do. Btw, I’m using MVC c# and nHibernate for this case.
Below is the View in my database, which you can see where the report will be display according to do order ValueDate, BrokerName, and TradePLCcyCode.
And Below is the Crystal report format where data will be populated into and be display. I have created a sub report for this to make ease if next time there is a need of adding new extra report to this report. And the below diagram shows the section where data will be displayed. I have fix it to 10 rows for Currency, 6 Columns for Broker and Total. And yeah, it is group by ValueDate. These fields are also define in my dataset file(.xsd).
Now, we go to the coding part. Before I pump in my data from view to the report, I have to convert all the data from view into a datatable before assigning them row by row into an object. Below is the datatable generated from the view where all data are populated into. As you can see there are different ValueDate which we have to group them later.
Now is the challenging part where I have to split this ‘huge’ datatable into sections of smaller datatable to be displayed. So What I’ve done is, firstly I split it by ValueDate. It depends on how many ValueDate in my datatable.
Above code split the ‘huge’ datatable into smaller lists of datatables with different ValueDate. And from here, I will loop through the number of distinct ValueDate. However, the rows and columns may exceed what I’ve set in the Crystal report, so I have to split these smaller lists of datatables into the sections that fit in the report.
How to know how many section for my rows and columns? As above, I have set 6 rows and 10 columns. So a loop function is use to loop through the ‘huge’ datatable to do the following process:
1. splitting it into smaller datatables. It will split by rows then by columns.
E.g. table is 12 X 20, it will split into 4 smaller tables.
table is 12 X 10, it will split into 2 smaller tables.
2. assigning each smaller datatables in an object.
3. assigning all objects into a list of object.
After that, will pass this list of object into the crystal report to be print.
This error usually due to workspace getting corrupted especially when local workspace are configured. This error doesn’t allow you to view the source control explorer. To solve this and to re-use the same workspace, you have to rename the $tf hidden folder which will be created at the root of your local workspace mapped folder.
* Pls don’t use this method if your code is merge from the branch to the trunk but not yet check-in to the trunk.
I have use quickfix 4.4 and sTunnel for below example to connect to a Currenex demo account. Download the UIDemo project from github. I’m using quickfix\n for c#.
FIX is an electronic messaging protocol for financial transactions. The Financial Information eXchange (FIX) is an open, widely used industry standard. More information is available on the FIX protocol website.
Quick fix is an open source application that provide such service as above. So below is my config file setting.
1. In quickfix.cfg
SocketConnectHost= my external ip address
SocketConnectPort= port to connect to sTunnel in your local pc
# standard config elements
SenderCompID= Hub FIX Taker ID
Username= Hub FIX Taker ID
Password= Hub FIX Taker Password
TargetCompID=CNX (Name I define in sTunnel config file)
SocketConnectHost= my external ip address
2. In stunnel.conf
client = yes
accept = your local pc external ip : port eg.(10.160.103.65:444)
connect = Currenex server ip address eg.(dret-xxx-xxx-xxx.com:444)
3. Build a self-signed pem cert in sTunnel.
Click ‘enter’ and your cert is done!!
4. Add 2 lines of code in QFApp.cs as below, which is your hub username and password.
As Singapore is well known for its marathon, everyone craze for it. I’m not sure what’s the reason behind that but it is quite interesting to try once. So I registered for 10km category with a few bros. Personally, I’m not the one who like to run, honestly, I would rather prefer other sports than running. Any way, I’ve registered and participated.
This is the first time I participated in a marathon. What worried me the most before the event is that I may fain during the half way. But it turn out better than during the training session. I dont have a good stamina, and may run out of breath. I have to improve on this aspect in order to go for another challenge.
On that day we were late to run. We started 20 min after the gun time. It is quite tired when running the first few km. after that, I think I’m numb for my lower part of my body. Just have to struggle to overcome it and go on.
Finishing the course is the best thing. Although is far behind from other contestants, but is still a sense of happiness, satisfaction that I can complete this thing! All tiredness have disappear, but fill with joy. Lastly, through this event, I’m able to know my own limits and train for more advance challenges.There are lot of aspects need to be improve. But with this experience, it can encourage me continue to improve. Is a wonderful experience.