RSS

Category Archives: Crystal Reports

Crystal Report toolbar images not Displayed ASP.NET

Reposting from old blog

One of my colleague faced a strange problem while using Crystal Reports

He got his report published on the ASPX page but the images in the toolbar weren’t being displayed.
While trying to find out the problem for it I checked the ASPX page and noticed that the src path for the images on the toolbar was from another virtual directory  “crystalreportwebformviewer2” which to our surprise didnt exists on his machine at all.
Well no idea whether that was due to inapropriate installation or what but the fact was we didnt have a directory to which
t he images were being referenced from.

Well anyways here’s the solution to the above problem
When you plan to use the Crystal reports toolbar in your reports it will automatically
refer to the images stored in your program files directory i.e

C:\Program Files\Microsoft Visual Studio .NET 2003\Crystal Reports\Viewers\Images

this directory has all the images in appropriate sub directories inside but for .NET to refer to it at runtime there
needs to be a virtual directory

in Our case the virtual directory being referenced was This might change according to the version of Crystal reports being used.

So all we had to do to get the Images on the toolbar was to

1# Create a virtual directory   crystalreportwebformviewer2
2# M
ap it to  C:\Program Files\Microsoft Visual Studio .NET 2003\Crystal Reports\Viewers\Images

After which the images on the toolbar were displayed without any other issue 🙂

Shounak Pandit

 
 

Tags: ,

Setting margins while printing Crystal reports.

Crystal reports provides its own printing method, which will print the page but there might be some problems in the print out unless you set the margins for the page.

PageMargins margins = new PageMargins();
‘ Get the PageMargins structure and set the ‘ margins for the report.
margins = rep.PrintOptions.PageMargins;
margins.bottomMargin = 350;
margins.leftMargin = 350;
margins.rightMargin = 350;
margins.topMargin = 350; ‘ Apply the page margins.
rep.PrintOptions.ApplyPageMargins(margins);
‘ Print the report.
Set the startPageN and endPageN
‘parameters to 0 to print all pages.
rep.PrintToPrinter(1, False, 0, 0);

PrinttoPrinter method of Crystal reports

 
Leave a comment

Posted by on September 10, 2008 in .NET, Crystal Reports, Problem Solving

 

Tags: , , , ,