Search blog.co.uk

About me

fkerrigan

fkerrigan

Tags

Subscribe by email

You can receive the posts of this weblog by email.

Calendar

<<  <  February 2007  >  >>
Mo Tu We Th Fr Sa Su
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28        

Syndicate this blog

RSS 1.0: Posts, Comments

RSS 2.0: Posts, Comments

Atom: Posts, Comments

What is RSS?

Archives for: February 2007

Crystal Reports: Logon Failed

by fkerrigan @ 21. Feb 2007 - 16:14:49

Another problem with crystal reports thats wildly common. On editing a CR10 (crystal reports version 10) report outwith VS2003 and trying to integrated it again with an application I got an error.

An unhandled exception of type
CrystalDecisions.CrystalReports.Engine.LogOnException; occured in crystaldecisions.crystalreports.engine.dll
Additional information: Log on failed.

I was trying to repoint the crystal database source to another OLE SQL server db connection and this it seems caused the error. When point to the local test server the report was developed it worked fine, but it would not work with another SQL server. Everything looked good, watches in the good suggested that it was getting the correct authenication parameters and I was stuck. So I  figured the problem was to do with the server locations. Crystal is very finicky with database changes and can remove all your database fields if your not careful.

I managed to get round the issue or make it a non issue within VS by:

  1. Open the report in Visual Studio
  2. Right click and select Database à Set DataBase Location
  3. Set db to another OLE DB (ADO) : You may have to set this up prior
  4. Close and exit


This will as it happens do some crystal magic that will allow changes via code to the database location via code.


 
 

Crystal Reports Page Totals

by fkerrigan @ 16. Feb 2007 - 10:44:18

Using Crystal 10 for reference.
Doing a lot with crystal reports this last week or so and I find it eh... challenging as I wish to do some which I consider basis stuff like totals on every page. Crystal does not support this very well so I after a few google searches I put together something that works quite well to my surprise.

First is to create 3 formulas for your running totals. Forget the supported running totals supported in the design. Create each formula and then drag and drop it onto your crystal design

Formula 1: Balance_Reset : Placed on page headersection

WhilePrintingRecords;
NumberVar BalanceDue_total;
BalanceDue_total := 0

Formula 2: Balance_Cum : Placed on Detail section

WhilePrintingRecords;
NumberVar BalanceDue_total;
BalanceDue_total := BalanceDue_total + {@BalanceDue};

Formula 3: Balance_Display : Placed on Page Footer

WhilePrintingRecords;
NumberVar BalanceDue_total;

How this works.

The “WhilePrintingRecords” occurs after all the back end data has been compiled and can be used to do stuff before the page is rendered into a visual entity. See crystal help for a better explanation.

 

The Balance_Reset formuala in the page header sets the BalanceDue_Total to zero.

 

The Balance_Cum  adds cumulative values of @BalanceDue (which is a formula derived from database fields) to BalanceDue_total.

 

The Balance_Display displays the total value on the page footer.

  

TopTip: Only the display formula has to be on non-suppressed section. I created a suppressed sections for Page Header and for Detail to keep the design nice and clean and this works fine.


 

Footer

The content of this website belongs to a private person, blog.co.uk is not responsible for the content of this website.