Home    
Log In    
Share Code    
Join    

Navigation
 Skip Navigation Links.

Forums
Skip Navigation Links.

Search

 

Advertisement
 
VB.NET Source Code > Custom Text in a Crystal Report Source Code
Details
Author: ptaylor
Views: 1895

Custom Text in a Crystal Report
Description
A Crystal Report shows all the data from a criteria and allows you to print or save the report

But if you look at the report a few weeks later, you will not know what criteria was used to generate the report, making the data worthless.

This is how to show custom text in a Crystal Report (i.e. Report Date not Printed Date)
 
 
Code:
'In the Crystal Report File Add a Unbound String

'You will find them under
'   Field Explorer
'      Unbound Fields
'         String

'After adding one to the report right click on it and select Edit Formula
'In the List on the left look for an entry like UnboundString1 and rename it.
'I would also delete the formula from the right screen as it's not required.

'In this example we will rename it to strReportDate



'We also have variables
'ReportDate as Date  
'rpt as new CrystalDecisions.CrystalReports.Engine.ReportDocument  

'YOUR CODE TO ADD THE VALUE TO THE REPORT
rpt.DataDefinition.FormulaFields("strReportDate").Text = "'" & Format(ReportDate, "dd/MM/yyyy") & "'"

Date Added: 16/06/2008 16:15:14





Comments
ptaylor Date: 22/01/2010 10:27:48
  Often when creating a Crystal report for something that needs a new page for each group (like Invoices or Purchase Orders) we use the New Page After option for the Group Footer in Crystal’s Section Expert. This works great, however it prints a blank page at the very end of the report. To remove this blank page, you can add a formula for the New Page After option instead of simply checking it. Click on the formula button and add the following: Not OnLastRecord
 


If you log in you can add a comment of your own!
 
 
Welcome Guest
 
  Log In Name
 
  Password
 
 
Statistics
Your Details: Not Logged In
  Join Date: N/A
  Last Logon: N/A
  Code Snippets: N/A
  Code Comments: N/A
  Forum Posts: N/A
  Forum Subjects: N/A

Site Wide
  Code Snippets: 32
  Code Comments: 2
  Forum Posts: 52
  Forum Subjects: 24
 
Random Code
Add Meta Tags to ASP.NET Pages
How to add Meta Tags to ASP.NET Pages programmatic....

Language: ASP.NET

 
Advertisement


All the Source Code and Tutorials on this site are free for you to use as you require.